Adaptive bit rate support in MPMoviePlayer - ios

Does iOS MPMoviePlayer or AVPlayer supports "adaptive bit rate" in live streaming ?

The short answer is yes. Put your alternate streams inside a master playlist then set the video source of the player to the URL of this file. The adaptive part is done automatically.

Related

AVPlayerViewController video's audio background playing and support for multiple formats

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.

Playing live streaming video apart from using MPMoviePlayerController

I have an issue (audio issue) playing live streaming video using MPMoviePlayerController for different reason My existing query for that related to VideoCore
[MPMoviePlayerController alloc] initWithContentURL:url]
My question here is, Is there any other approach that we can use for playing live streaming video apart from using MPMoviePlayerController in iOS? Please suggest.
Thank you
Try playing with AVPlayer
Here is the documentation from apple to it.
Here is the example apple provided for it.
Is not as simple as MPMoviePlayerController but it give you more control over it.
Happy coding.

Playing Vimeo Videos with Custom Video Player in iOS

I have to play Vimeo videos in my iOS application using a video player. I need to log events like play, pause, seek etc. Its not possible to play using MPMoviePlayerController or AVPlayer as Vimeo videos have flash content. I am able to play using UIWebView. But, it is showing default Vimeo player controls. I need to have my own controls to play, pause etc as I need to log those events.
I have tried for lot of solutions. Nothing worked. If anyone knows how to play Vimeo videos using custom player. Please Let me know.
I am able to find out solution for this problem. I have used YTVimeoExtractor present here.
Its README.md file says following :
YTVimeoExtractor helps you get mp4 urls which can be use in iOS's native player. You can even choose between mobile, standard and high definition quality.
YTVimeoExtractor doesn't use UIWebView which makes it fast and clean.
I have used MKMoivePlayerViewController and its notifications - MPMoviePlayerPlaybackStateDidChangeNotification and ˚ notifications to get stop, pause events.
The only official way to use a player besides the Vimeo player to play Vimeo videos is to use third-party player urls provided to PRO members: https://vimeo.com/s/adg

Need youtube audio to continue to play when iOS app enters background

My app has a UIWebView that plays specific youtube content within the app. Some of these videos can be lengthy and are more audio centric (e.g. lectures and/or music). I'd like users of the app to be able to leave the app but have the audio of the youtube video continue to play, without the need for hitting a resume or play button. How can this be done? I'm willing to abandon the UIWebView if there is a better alternative.
Thank You.
I work on the same troube. The problem come from the mpmovieplayer which play the movie in ios.
An article of Matt Gallagher said:
"This pause is sent from the CALayer displaying the video frames. This is a private class for an MPMoviePlayerController and is your own AVPlayerLayer for an AVPlayer."
source - http://www.cocoawithlove.com/2011/04/background-audio-through-ios-movie.html
This article is very old (2011), but maybe the problem is similar.
Good luck

How to play youtube video without UIWebView or detect video player when youtube video start playing using webview?

I need to play youtube video in my iOS application and while video is playing I need to add an overlay on video.
1.Now how can i run youtube video in native player?
2.if I play video in UIWebview then how can i detect that video is
playing and how to add overlay on the video?
MPMoviePlayerViewController cannot directly play youtube video urls.You need to extract the url before loading MPMoviePlayerViewController with the url.
you can see a working demo in my github repo:
Try this::
https://github.com/DpzAtMicRO/IOSYoutubePlayer
LBYoutubeExtractor extracts the youtube Url with JSON.
Please do read the README.md before you use this in your application.
Regards
MPMoviePlayerViewController is a good one but last commit is years ago. I found another solution called 'XCDYouTubeKit' which supports iPhone/iPad and iOS7 onwards with full screen YouTube video.
You can access github page at here and fully documented tutorial at here
This is what official developer says in his page:
The only official way of playing a YouTube video inside an app is with a web view and the iframe player API. Unfortunately, this is very slow and quite ugly, so I wrote this player to give users a better viewing experience.

Resources