Muted Iframe video with googles new Autoplay Policy Changes - google-chrome

googles just updated there "Autoplay Policy Changes" but I want to implement a muted auto-playing Vimeo background video and after reading the article I believed adding the following to the iframe would work.
chrome version: 68
allow="autoplay; fullscreen"
but no luck and I'm not sure what else to try other then the JS API which i don't even know if it will make a difference.
<iframe src="https://player.vimeo.com/video/265188275?autoplay=1&loop=1&autopause=false&byline=false&title=false&byline=false&frameborder=0" allow="autoplay; fullscreen">
thanks in advance for any helpful advice.

If you're using the Vimeo embedded iframe player as a background video, you should use the embed code with the background parameter instead of the autoplay and loop parameters:
<iframe src="https://player.vimeo.com/video/76979871?background=1" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
The background parameter will hide all player buttons and elements (play/pause, playbar, title, byline, etc.), loop the video, autoplay the video, and mute the video. That last part is important - by default, Chrome will always allow muted videos to autoplay. For videos to autoplay with audio turned on, Chrome uses a "Media Engagement Index" to determine if the viewer actually wants or expects video with audio to autoplay when navigating to your page. That whole process is documented by Google here: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
The background parameter of the Vimeo Player is documented here: https://help.vimeo.com/hc/en-us/articles/115011183028-Embedding-background-videos

Related

How to autoplay HTML5 embedded player?

I want to autoplay my online radio but can't seem to fixed it.
Autoplay="true" autoplay="1" doesnt work
I got this shortcode
[html5radio radiolink="http://server:port/" radiotype="shoutcast" bcolor="000000" image="" title="Stream Title" artist="Stream Artist" facebook="http://www.facebook.com/radioforgecom" twitter="http://twitter.com/radioforgecom"]
and this
< iframe src="https://player.radioforge.com/v2/shoutcast.html?radiolink=http://server:port/&radiotype=shoutcast&bcolor=000000&image=&facebook=http://www.facebook.com/radioforgecom&twitter=http://twitter.com/radioforgecom&title=Stream Title&artist=Stream Artist" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" width="367" height="227"></iframe>
After trying codes that I can think of, the video is still not autoplaying.
Auto-playing audio is something that browsers are trying to do away with. In order for audio to be allowed to play, the user must first interact with the page in some way. See this post about Chrome’s autoplay policy.

Chrome Vimeo Iframe autoplay not working anymore

since some days my vimeo iframe will not autoplay anymore. I know the chrome update, which will block autoplay videos with sound. Is the block already active?
The Vimeo Example code doesn't work:
<iframe src="https://player.vimeo.com/video/12345?autoplay=1&loop=1&autopause=0" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
But netflix.com and vimeo itself has an autoplay video on the homepage, which works.
EDIT: Chrome version 66.0.3359.139 macOS High Sierra 10.13.4
Does anyone have an idea or answer?
Thanks!
Annotating the <iframe> with an allow attribute worked for me:
<iframe ... allow="autoplay; fullscreen"></iframe>
It's called "Iframe delegation" and is described here: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes.
You need to add &muted=1 to the iFrame src path and you need to add the attribute allow="autoplay" to the iFrame. Now the Vimeo video starts automatically again in Chrome.
yes, according to their documentation it is.
https://help.vimeo.com/hc/en-us/articles/115004485728-Autoplaying-and-looping-embedded-videos
EDIT:
Advance browsers like FireFox, Chrome and Safari are now blocking video autoplay by default.
CHROME Auto-Play Policy:
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
The Media Engagement Index, or MEI for short, a way of Chrome is to allow AutoPlay audio on your page to be based on your previous interactions with this webpage as a user. You can see what this looks like by going to
chrome://media-engagement/
MEI is calculated per user profile, and is persisted to incognito mode.
WEBKIT/SAFARI Auto-Play Policy:
https://webkit.org/blog/7734/auto-play-policy-changes-for-macos/
FIREFOX Auto-Play Improvements:
https://www.ghacks.net/2018/09/21/firefox-improved-autoplay-blocking/
NOTE:
Don’t assume a media element will play, and don’t show the pause button from the start. Look at the Promise returned by the play function on HTMLMediaElement to see if it was rejected:
var promise = document.querySelector('video').play();
if (promise !== undefined) {
promise.catch(error => {
// Auto-play was prevented
// Show a UI element to let the user manually start playback
}).then(() => {
// Auto-play started
});
}
Autoplay + Mute + Start at time x sec =
<div>
<iframe src="https://player.vimeo.com/video/342787403?&autoplay=1&loop=1&title=0&byline=0&portrait=0&muted=1&#t=235s" style="position:absolute;top:0;left:0;width:100%;height:100%;" width="1400" height="900" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen>
</iframe>
</div>
#t parameter must be the last one.
Now the autoplay video just works if the audio is muted, you need to add the muted parameter into your api or iframe code &muted=1, you can change your browser preferences to allow autoplay unmuted videos:
chrome://flags/#autoplay-policy
Change the default option to "No user gesture is required"
If the user clicks the video you can unmuted it!!
If you are paid member and want to use video as a background, this is probably what you need:
?background=1: This parameter automatically disables all elements in the player (play bar, buttons, etc), autoplays, loops, and mutes your video on load. Please note: the background parameter is only supported for videos hosted by paid members. Learn more here.
Or, if you are not:
?muted=1 This parameter will automatically mute your video on load. Once your video plays, viewers can manually un-mute by clicking on the volume bar within the player.
BUT, I still can't make it work on the phone.
muted parameter fixed my issue:
<iframe src="https://player.vimeo.com/video/xbackground=1&autoplay=1&loop=1&byline=0&title=0&muted=1" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen allow="autoplay; fullscreen"></iframe>

Google Drive video does not start on smartphones

I'm using a code to embed video from Google Drive. It works perfect when I'm watching on desktop. But, when I'm trying to watch the same video on my smartphone, it never starts.
Here is my code:
<iframe class="embed-responsive-item" src="https://drive.google.com/file/d/0B1MJDhOwhGWOaTZSYzM4ZkRPZDQ/view?autoplay=1 scrolling="no" border="1" bordercolor="red" width="640" height="480" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true">
</iframe>
Is there any solution for me?
You will have no issue if you use "request Desktop site version" from your mobile browser, to see the video. It worked for me.
Instead of /view?autoplay=1 on the video link, just use /preview
For some reason, Google or Android limit the video streaming functionality.
The other way around, would be to store the video in another platform.
I know this post is old but I stumbled upon this problem just now and I couldn't find any google provided solution. As a workaround, I compressed the video the most I could and placed in the HTML as a video with the source from google cloud:
<video width="100%" height="300px" controls>
<source src="https://drive.google.com/uc?id=VIDEO_ID&export=download&authuser=0"
type="video/mp4">
</video>
Keep in mind that the video has to be public for it to w
Now it works on desktop or on mobile, The only issue is that you sacrifice the google drive embedded controls like quality and captions obviously...

Video streaming-Error

My code for a simple video streaming web page is given below. On Firefox the error that it gives is:
No video with supported format and MIME type found
The code is:
<video width="320" height="240" controls>
<source src="http://www.youtube.com/watch?v=zY1vLEk8B9c" type="video/mp4" />
</video>
On trying it with chrome the play button does not turn up.
I am new to web development and do not know where I am going wrong. What should I do to get the video running?
you don't need to make a special code
YouTube give you on every video, a link named share.
under that link you will find another link named embed
for example: in your question under the link embed
you will find the following code to use it in your page:
<iframe width="640" height="360" src="//www.youtube.com/embed/zY1vLEk8B9c" frameborder="0" allowfullscreen></iframe>
my best wishes

The youtube video is not loading in the my local webpage

I have taken the following iframe code for the youtube video from the youtube itself.
<iframe width=”560? height=”315? src=”http://www.youtube.com/embed/V3oJR5IAMxM” frameborder=”0? allowfullscreen></iframe>
But when i try to embed this video on simple web-page inside a div element. I can see the you-tube player in the web page.But the video is not loading in my webpage. But the same video is playing for me in youtube.
Can someone tell what might be the problem,..
Is the problem with a code or with the browser, i am using mozilla 13.
HiTbmBizz,
Try this instead,
<iframe width="640" height="360" src="http://www.youtube.com/embed/V3oJR5IAMxM?feature=player_embedded" frameborder="0" allowfullscreen></iframe>
Worked for me in HTMLSandbox if you want to test.
Let me know how it goes.