Web View - Playback requires user action - Swift - ios

Web View - Playback Requires User Action - in Swift
Hi there.
In my Main Storyboard I have a Web View, that is triggered by a button.
When the button is pressed, it pops up a music video from Youtube. When I then press the “Play-button” in this Youtube view, the song is played, meaning I have visuals and audio :-)
Under the Web View Options, there is a checkbox called "Playback Requires User Action”.In the help explanation it says:
“mediaPlaybackRequiresUserAction
Property
A Boolean value that determines whether HTML5 videos can play automatically or require the user to start playing them.
Declaration
SWIFT
var mediaPlaybackRequiresUserAction: Bool
Discussion
The default value on both iPad and iPhone is YES. To make media play automatically when loaded, set this property to NO and ensure the or element you want to play has the autoplay attribute set.”
What does "autoplay attribute set” mean ?
I want this music video played, without pressing the “Play-button” in the Youtube view ? Is this even possible ?
Have searched, but found nothing.
I'm a novice and can’t figure out, how to do this.
Does anyone have a clue ? :-)
It would be highly appreciated.
Ola

Related

You Tube - Disable all links to actual video in the player

I am using a light box type of player to open and play you tube videos. My people don't want the video link to be accessible or shared from within the player.
I.E they only want the video to play when the video loads in the player. So they don't want the share button visible and they don't want the YouTube icon that links directly to the video visible.
I can remove the share button and I can remove the YouTube icon but not at the same time.So there is always an easy way for the user to get the video url and share it etc...
I can also chose the videos to be private and that removes both. But then all of my users would need a google account which they dont.
It seems to me that Google wouldn't offer free use to its player without some type of reference to You Tube. Either with the share button or the You Tube icon that links to the video.
i have tried modifying the url parameters (embed?v=#v_ID#&rel=0&autohide=1&showinfo=0&wmode=transparent&modestbranding=1&controls=0") to no avail.
And I have tried using embed and watch to no avail..
Is there a way to do this?
You can append the following onto the end of the YouTube embed url, to remove the Watch on YouTube button from the playback controls which is accomplished by setting modestbranding to 1. The player controls are NOT removed. they are just auto0hidden by setting the parameter autohide to 1.
Try to change & to &amp
Here's a sample format to solves your issue:

AirPlay View in YTPlayerView doesn't appear

I'm using YTPlayerView (YouTube helper library) in my iOS application and according to requirements, I've made custom controls for airplay, share, play etc. For that I've hidden the default controls of YTPlayer using "control" tag.
The problem I'm facing is that, when I play video via airplay on some other media (e.g. appleTV, air server), the default view of YTPlayerView saying "Streaming to ... " Doesn't appear.
I guess it's because I've hidden the default controls.
I want this view to appear on screen whenever user choose other route for video. Unfortunately I'm unable to find the solution. Is there any way to do this or any notification that's fired whenever user switches video route, so that I can place my custom view for that scenario.

What can be done to make a Youtube video play properly upon the first attempt to view it?

What can be done to make a Youtube video play properly upon the first attempt to view it?
Most of the time I get dark areas as shown for example in the attached:
https://www.imageupload.co.uk/images/2015/05/28/ytquestion.png
Update your flash player. That is probably corrupt.

how to play video with native player instead of web player for a <video> tag?

We have a UIWebView that load html page including video tag. When the user tap the video element, a fullscreen movie player is presented.
As there is some logic in the web page that handle events and need to stop and close the movie player. Is there any API to do so (stop the web movie player and exit fullscreen)?
Any one know how to do this?
Further more, even we want to detect tapping on the video element, then we'll have to provide our own custom player, instead of the system web player. Any way to do it?
Thank you!
This might be helping, if you want to controll the HTML5 video with js: http://www.w3.org/2010/05/video/mediaevents.html
I am not shure if - on a mobile device - javascript will be running while the video is in fullscreen mode.

MPMoviePlayerController, disallow fullscreen but allow navigation through clip?

I have a video in my iPad app, but I dont want it to be able to go to fullscreen. However I do potentially want the user to be able to navigate to the part of the video that they want to see.
As far as I can tell there are only three options for the controls that you give the user:
None, Embedded, or Fullscreen.
None gives the user no control.
Embedded and Fullscreen basically give the use the same amount of control but just start in different states.
Basically what I want is Embedded with the switch to Fullscreen option taken out.
Anybody know if its possible? Thanks
You can set the controls style to "None", and then add your own custom view to navigate using a UISlider (I've done this in the past).
MPMoviePlayerController adheres to the MPMediaPlayback protocol, so you take the total playback time of the movie, multiply it by the UISlider value (when it changes), and then adjust the movie's playback head position.
You'll also need an NSTimer or KVO to monitor the playback time so it can update the slider UI element in realtime.

Resources