I am using HTTP Live Streaming Protocol to stream video and audio on demand in my app. The video playlist (m3u8 file) has an audio only version which is playing when the connection is very poor. When the app goes in background I want to play the audio of the video. Is there a way to achieve this, like forcing the MPMoviePlayer to switch to audio only, and then when they open the app to switch to a video version.
Related
We have functionality for background recording in app. It is working fine when app in background mode but it is stop when we open other app and play video file in other app then audio recording stop to recording sound in it.How can we continue recording even without stop recording when other app play video file.
Thanks
I have to do a Video streaming app (using a remote url) in swift. But there is no any exact video format. Sometimes it can be m3u8 sometimes mp4 etc.. but my video player should support for what ever the format comes from the back end.
Also when the app is in background, the audio should play and when the app comes foreground video should play without any time delay between the vide and the audio.
I want to know whether is it possible to achieve my objectives using AVPlayerViewController or else what is the best player that I can use to achieve my targets. Please help me.
Thanks
AVPlayerViewController supports m3u8 and mp4 both format. For playing video's audio you need some extra configuration. You can check from here...
How do I get my AVPlayer to play while app is in background?
Is it possible to play video using Avplayer in Background?
So according to me AVPlayerViewController is best option for your requirement.
I have an app that at the beginning plays a video with AVPlayer. The video is muted. The problem is it stops the music that let say iPhone was playing on iTunes and after the video playback is finished the music does not come back automatically. Is there a way to play the video in my app, during the playback of the video the music on iTunes can be muted which is fine with me, but what I want to achieve is to get the iTunes music back playing when the video is finished without the user's interference.
In my application I have made [audioSession setCategory:AVAudioSessionCategoryPlayback] to play audio in back ground and also to mute other audio play backs while playing song in my application. I am playing the audio using AVPlayer and also I have UIWebView for playing video in same Application. The issue arises when I play both video in web view and audio using AVPlayer. The music mixes in this case. Prior to iOS 6 when I rech same situation one audio pauses automatically and the mixing up does not occur. So kindly suggest some solutions.
Try to set
Required background modes -> App plays audio
in Info.plist.
My AVMutableComposition which contains two locally stored video files plays fine on the iPad but cannot play via AirPlay Video.
My AVPlayer implementation works fine for regular AVURLAssets over AirPlay Video, just not for AVComposition assets.
Both locally stored video files play fine via Airplay Video when loaded as individual AVURLAssets.
Is this a limitation with AirPlay Video? Or is there something I need to do to the composition?