Display banner over AVPlayer from a WKWebView - ios

I'm creating an app to watch live streams from the internet using a table view that opens AVPlayer when a cell is tapped. There are some cases that I can't open streams directly and so I have to use a WKWebView and then the video is opened by this one. I have to put a banner as overlay in AVPlayer and I managed to do it when the player is opened directly; the question is: how can I access to the AVPlayer properties when this is called by a WKWebView?
I tried to add an extension to the AVPlayerViewController class to manage the banner and it works well with the videos I open directly, but my solution seems to be useless with WKWebView-based videos...
Is AVPlayerViewController that manages videos opened by a WKWebView or another class?

Related

Adding Sound With UIPageViewController iOS Swift

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

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?

Playing audio in the background when using a UIWebView

So I´ve don all the preliminary steps of setting the audioSession sharedInstance category, and activated playing audio in the background in the info.plist file
However I am using an UIWebView to display YouTube, and even thought background playing is
supported, pressing the home button the audio stops. Is this cause YouTube uses some built in player? cause when I play an video my tab bar controller disappears.
Is there a way of having it continue playing the youtube videos in background?

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.

How do I display video on external monitor while keeping controls on iPad?

My iPad app has the option to play videos. I use the MPMoviePlayerViewController class to play my videos.
My question is: if I want to play the videos on an attached external monitor, how do I keep the playback controls on the iPad like YouTube does? If I add the view of the MPMoviePlayerViewController 's player to the external screen's hierarchy I can play the video fine, but I now have no control over it. Is there a way to move or duplicate the view where the controls lie and place it on a view which resides on the iPad?
I'm not aware of an officially supported way of pulling out the original UI in this way. The MPMoviePlayerViewController only exposes the MPMoviePlayerController object it uses via its moviePlayer property. The MPMoviePlayerController in turn only exposes view and backgroundView, which aren't helpful for such a purpose. You could in theory inspect the subviews of the movie player's main view, find the playback controls and try to move them to the other screen. I have a feeling this will not end well though, as they're anything but static. You also never know what will happen in later iOS versions, or if they'll let your hack on the app store. It's probably less trouble to just re-do the UI yourself.
Actually controlling the video playback programmatically is straightforward - the view controller's moviePlayer implements the MPMediaPlayback protocol.

Resources