Adding Sound With UIPageViewController iOS Swift - ios

I am new to iOS, and am using PageViewController to set up an app with books. I am having a hard time finding any information on setting up sound with each page. How do you add mp3 files into an array using AVFoundation?

You can play a audio file in background usinf AVAudioPlayer u can even play different audio for different page.... Change audio file inside page view controller delegate method, visit this link for more detail info

Related

How to add trick play to custom iOS video player build on top of AVPlayer to play .m3u8 files?

Goal:
To add youtube like preview feature when user seeks manually using the player seek bar.
From what I understand so far is that I will have to add "I-Frame only playlist" to my stream to enable trick play but I am not able to figure out how I will be using this to show the preview view on the video player?
Other solutions I considered:
AVAssetImageGenerator: It does not work on streams. Explained here.
This says if my .m3u8 file contains "I-Frame only playlist", AVAssetImageGenerator will start returning the snapshot, but even if it does, generating thumbnails of a complete 1 hour video upfront is just not optimal.
AVPlayerItemVideoOutput This also seems like a very brut force way to approach the problem as I need thumbnails of almost complete video.
Current player implementation:
I have added AVPlayerLayer as a sublayer to my view controller's view and added custom controls on top of it.
I am thinking of using something like this https://github.com/pbs/iframe-playlist-generator to add the I-Frame playlist.
PS: I am new to this, so if I have made any wrong assumption, please let me know.
Also, any links or references to some reading material I can use to dive in deeper are appreciated. Thanks.

How to play a video in uiview Xcode obj C

I Need to play a video when the view load but, other code i have try to do the video player comes up. I want to play the video in the UIVIEW. Can someone please help!
You will need to use an AVPlayer, specifying an AVPlayerItem. This should allow you to use multiple AV items within a single view.
Basically, everything is explained here:
https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/02_Playback.html

How to custom video player of UIWebView

I want to make a customized video player for UIWebView.
I have 2 ideas about it:
1. hook the notifications of UIMoviePlayer***, but I can't get any information about the current player from the notification, so I can't replace it with my custom video player
2. replace video.play in js, use my js to tell objective c to launch my video player. But it only works for some website, not for all.
Is there any solution for launch custom video player for UIWebView?

Play a list of media (video/audio) items on iOS

I'm developing an iPhone App and I need to implement a player to play a list of media (video/audio) items.
Following is a screenshot of player I have captured from an another iPhone app, I found many apps playing video/audio using a player has similar UI like this.
Can this player (including UI) can be implement by official API? Or just implement manually?
How can I implement a same player like this?
To Play audio follow this blog
And to play video, either you can use CustomMovieplayer or go with UIWebView with embedded html.
Movie Player sample code from here
To play video as embedded html in UIWebView, check this..
https://stackoverflow.com/a/7551375/790794
As per the file type, you can modify the source type.

Can iOS APP play downloaded MP4 files in custom window?

We have an iOS APP project which will play video in our custom window and would like to play the downloaded video files. According to such kind of demand, is that possible to do that?
This is possible. Please check the documents for MPMoviePlayerController . This allows you to play a video and managing your own view hierarchy/custom views. To play a video inline, you need to use the view property of your MPMoviePlayerController instance an put it into your view hierarchy. The features of MPMoviePlayerController have changed with iOS 3.2, so while using it, be sure to only use features for your deployment target.

Resources