Video.js: Autoplay Does not work in Chrome 70

Created on 13 Nov 2018  路  12Comments  路  Source: videojs/video.js

Description

Autoplay does not function in chrome when used with data-setup or in the video tag itself.

Steps to reproduce

Explain in detail the exact steps necessary to reproduce the issue.

  1. use autoplay attribute on a Video tag running videojs
  2. use autoplay in the data-setup attribute running videojs
  3. Notice autoplay does not function on chrome

https://jsfiddle.net/afridley/dvLgr1cb/

Results

Expected

Autoplay functions in chrome

Actual

The video does not autoplay

Additional Information

Please include any additional information necessary here. Including the following:

versions

videojs

Latest cdn 7.0.4

browsers

Chrome Version 70.0.3538.102

OSes

Mac OS mojave

plugins

All 12 comments

馃憢 Thanks for opening your first issue here! 馃憢

If you're reporting a 馃悶 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.

This is expected. Browsers now will not autoplay by default anymore, unless the video is muted. To that end, we have extra values for the autoplay option to video.js: https://docs.videojs.com/tutorial-options.html#autoplay. However, that option seems to not be working properly right now, and it's something we should fix.

For more information on autoplay, you should check out our autoplay best practices blogpost.

I have added the muted tag to the example but the player still is not working in chrome 70. I also added a standard html5 video player with the same attributes that does autoplay. I would expect videojs to function in a similar way as the default player in regards to these attributes.

https://jsfiddle.net/afridley/dvLgr1cb/13/

Yeah, there's definitely something weird going on, we'll take a look.

Looking into this a bit, it seems like there's some weird timing issue. I can't reproduce it at all locally but if I create a new page on say codepen, I can reproduce it. And there's more chatter of things being an issue in #4720.

This issue is already running with version 70 of chrome. I can't understand in which commit that happen and why this issue is still opened.
thanks

Yeah it definitely looks like it's the same issue as #4720
Both the solutions that were posted there seem to work

var player = videojs('video_delay');
player.ready(function() {
  setTimeout(function() {
    player.autoplay('muted');
    player.fluid('true')
  }, 1000);
});


var video = $("video").get(2);
video.load();
video.play();
if (video.paused) {
  location.reload(true);
}

I updated the fiddle to illustrate each of the fixes and current behavior https://jsfiddle.net/afridley/dvLgr1cb/

This seems to be fixed with Chrome 71.

It's happening with chrome latest version(71) and videojs version 7.3.0. Can someone help me to resolve this issue.

@joe455 you can see autoplay still being broken in chrome 71 with Video.js 7.3? What OS are you on? Do you have an example?

The fiddle created by @afridley works great for me in chrome 71 on macos currently.

Also, I want to redirect this issue into #5233 so that we have only one issue on going related to this.

Hi All,

I found solution here.

chrome://settings/content/sound

allow you domain there..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

onigetoc picture onigetoc  路  4Comments

cshah123 picture cshah123  路  4Comments

dingyaguang117 picture dingyaguang117  路  4Comments

uikoo9 picture uikoo9  路  4Comments

shivamg705 picture shivamg705  路  4Comments