I have UIWebviews that contains different styled texts, images, youtube videos etc. If UIWebview has Youtube video, it has Picture-In-Picture button as default (I have PiP feature in app for my video gallery with AVPictureInPictureController, means PiP enabled in app).
1) How can I opt-out for PiP for those embedded youtube videos
Another case is my UIWebviews are in UICollectionViewCells, that is in horizontal mode, 1 cell per page, paging enabled, I can't pause the youtube video when change page to another, because I have no variable or something that assigned to that player to control player. This case arises in iPad, because in iPhone when you try to play embedded youtube video it goes for full screen, to change another cell you have to press Done(that pauses video) so video handles itself to stop, but in iPad it plays in UIWebview autmatically, doesn't goes for fullscreen
2) How can I get controll on embedded youtube video in my UIWebview
Found solution for #1:
myWebiew.allowsPictureInPictureMediaPlayback = false
Related
So I have wkwebview which displays an html text that includes video urls as well. On tapping the video thumbnail, the wkwebview launches the AVPlayer to play the video just fine. But after viewing the video, I need to remove the player so that other information on the wkWebview is visible.But the player makes the wkwebview go blank. I am attaching the screenshots
1. normal article with text and video thumbnail(calendar icon)
2. Video being played normally
3. After video being played, the rest of the wkwebview going blank.
I want to get back to state 1 from 3.
I'm developing an iOS iPad app with an embedded YouTube video.
I'm having issues when the user tries to play the video touching the red square play image from YouTube, it seems that pressing that image won't trigger the play action. However, touching anywhere outside the red square play button works.
I've tested it with the iPad user agent with same results.
When embedding with controls:0 it seems that the action triggers perfectly, but I need the default controls.
Is there anyway to keep controls:1 and detect that touch to successfully play the video?
Try playing the video itself when it is loaded. If hitting the big red button is not a compulsion add "event.target.playVideo();" to the onReady function in the embeded HTML body. I have done so and the player in my application shows the big red button and starts the video itself immediately. I have used the following YouTube iFrame library youtube-ios-player-helper
Hello Guys (and girls) I am embedding an IFRAME of a youtube video on a website and it works perfectly on a DESKTOP VERSION.
However, when viewing it with any touch device, the play button DOESN'T trigger playing the video. The strange thing is that when you click outside the play button (on the video) it does play the video. This only occurs on touch devices and I verified and the issue is occurring across all touch devices.
This isn't a site specific issue, so you can try out embedding any Youtube video e.g:
You'll notice it plays when touching everywhere on the video EXCEPT when clicking play. If you have youtube embedded videos you'll probably having this issue as well.
Thanks for your help
In my app I'm supposed to make a menu where users can play a video from a list. The list is presented in a horizontal UIScrollView and I have a frame of 120x80 (in points, in pixels it's 240:160 on retina). The links for videos are either youtube urls or addresses of .m3u8 files on our server (I put them in a simple html from apple's http live streaming documentation).
My problem is with the youtube urls. These pages opened in UIWebView always have a bar on top that limits the tappable surface to half. Also when I play the video for first time another bar shows up (for like, dislike and things like that), which limits the space that will launch the video on tap to 0.
My goal here is to have the videos represented by images (UIImageViews) with buttons on top of them in shape of the "Play" triangle. When I press that UIButton, the video should show, as normal, inside an MPMovieController.
So I need 1 of 2 things:
Have the UIWebView show just the video of the youtube page, without the bars.
Make the youtube video show inside an MPMovieController after user taps a UIButton.
Any tips on how to do either of these?
Yes you can do like this and you need use set property on UIWebView.look this example
here
I'm trying to present a youtube playlist in a table (using YouTube Data v3), where each video should be opened in fullscreen (landscape) when the user taps on the cell.
How could I achieve it?
First attempt:
each table cell contains the title of the video and a small web view containing the iframe of the video; in this scenario if the user taps on the thumbnail, as it is a web view, the video automatically plays in fullscreen. The problem in this case is that the entire cell is not tappable but only the thumbnail.
Second attempt:
the cell contains an image with the thumbnail of the video (no web view) and the title. On the tap a new view controller with a fullscreen web view is pushed. The problem here is that there is an intermediate step that I'd like to skip.
The perfect result would be exactly what the YouTube app does: in the video result list, when you tap on a cell, the video opens and automatically starts; but differently from this case I need it to be opened in fullscreen.
Thanks a lot for any hint,
DAN
go with first Attemp, but minor modification,
If the user clicks on the cell reload the webview with change in iframe html code making it autoPlay.How to autoplay a YouTube video in a UIWebView