Youtube iframe API - Android fullscreen - javascript

I'm using the YouTube iframe api to embed a video.
When playing the video on an iPhone, the video automatically switches to full screen mode. I was wondering if it's possible to force the same behavior on an Android? (currently the video is played inline, which doesn't look so good).

There is no way to automatically play the video fullscreen. The closest you could get is to put the player in a fullscreen div and autoplay it using the url params:
<iframe width="100%" height="100%" src="//www.youtube.com/embed/fSy6uh-GjCc?controls=0&autoplay=1&showinfo=0" frameborder="0" allowfullscreen></iframe>

Related

Disable fullscreen in ipad vimeo

Is it possible to disable the video playing on fullscreen?
When I press play on the player on the iOS, it is playing the video in fullscreen mode, whereas in android it is playing in the normal mode.
Sharing the code I'm using
<div>
<iframe
src="https://player.vimeo.com/video/120061340?playsline=true"
frameborder="0"
allowfullscreen="false"
allow="autoplay; encrypted-media"
webkit-playsinline="true"
playsline="true"
playsinline="true"
style="position:absolute;top:0;left:0;width:100%;height:100%;"
controlsList="nofullscreen"
title="Sample Video">
</iframe>
</div>
<script src="https://player.vimeo.com/api/player.js">
</script>
Please let me know if I'm missing something here
You're loading an iframe and trying to put video element attributes on it. Instead of loading the iframe, you'd need to call the video file directly in your own video element. Alternately, you can add a mutation observer that waits for the Vimeo video element to be inserted into the page and which then adds the webkit-playsinline attribute to it.

Stopping Embedded Vimeo Player Asking for VR Permissions

I've got an embedded Vimeo player on my website, using the Player SDK that Vimeo provides. Something I have noticed is that on Firefox, whenever I visit the site, I am prompted to give Vimeo access to any virtual reality devices attached.
As this prompt is rather instrusive, is there anyway to prevent Vimeo asking for this permission?
For reference, this is the iframe code that I am using to embed the player:
<iframe #videoPlayer src="https://player.vimeo.com/video/(id)" width="100%" height="400px" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
If you send the HTTP Feature-Policy header, you can manually override the nested frame.
One or both of the following headers should do the trick:
Feature-Policy: vr none
Permissions-Policy: xr-spatial-tracking=()

Youtube clip auto play and start from beginning when pressed

Is it possible to have an embed YouTube clip on your website that auto-plays when you load the page and when you press the clip it starts from the beginning
<iframe width="420" height="315"
src="https://www.youtube.com/embed/tgbNymZ7vqY?autoplay=1">
</iframe>
I looked around but I can't find the specific functionality I am looking for.
Auto play policy has been changed.
( https://developers.google.com/web/updates/2017/09/autoplay-policy-changes )
If you want to autoplay, add "mute". (Tested in Chrome)
<iframe width="420" height="315"
src="https://www.youtube.com/embed/tgbNymZ7vqY?autoplay=1&mute=1">
</iframe>
And you can control the youtube video with JavaScript.
https://developers.google.com/youtube/iframe_api_reference
It can be implemented variously. I made a sample. (use "seekTo" API)
https://jsfiddle.net/raykim2414/uv7b6ty4/15/

Autoplay iframe YouTube video in Safari 11

I have a simple modal dialog:
User clicks on button.
Modal overlay shows.
YouTube <iframe> element is added.
All is good in most browsers - video starts playing, except Safari 11.1.
Safari has new auto-play policy that requires explicit click and video element to start playing it: https://webkit.org/blog/7734/auto-play-policy-changes-for-macos/
Is there some way to make it autoplay for dynamically added YouTube (or Vimeo) iframe?
Example YouTube iframe:
<iframe frameborder="0" allowfullscreen="" allow="autoplay; encrypted-media; fullscreen" src="https://www.youtube-nocookie.com/embed/20iMzRklHNU?rel=0&controls=0&showinfo=0&autoplay=1&enablejsapi=1"></iframe>
Safari 11 now disables/blocks autoplay features. You have to manually go to the safari settings and Allow All Auto-Play.

How to Capture youtube video as image which is been played in iFrame?

I am using Youtube API and playing a video from youtube by sending video ID.
and video is been played well.
Code:
<iframe width="420" height="315" src="http://www.youtube.com/embed/XGSy3_Czz8k"></iframe>
Now i have a button and i want the javascript to capture the frame which is been played at that particular time.
<input type="button" id="capture" value="Capture" onclick="Captureimage();"/>
like we have this screen capture in VLC media player
I want to have the same functionality here.
Since its an embedded media(Video inside iFrame), struggling bit.
tried with html2canvas. No lucks.
Can anyone plz help.
Regards,
Arun

Categories

Resources