frankyghost / projekktor

The Free Web Video Player
194 stars 75 forks source link

Autoplay in Safari 7 #36

Open sb-relaxt-at opened 10 years ago

sb-relaxt-at commented 10 years ago

There is an issue concerning enabled autoplay in Safari 7: When opening a page (especially in a new tab), the video won't start more often than not. The video remains in a loading state forever (rotating load indicator). A page refresh "solves" this problem. To reproduce this, add

autoplay: true,

to the video config in the readme.html of the current release and open it in Mac OS 10.9.2 using Safari 7.0.2. I have been able to reproduce it on a second installation as well.

rwlodkowski commented 10 years ago

@sb-relaxt-at could you give us more information?

  1. what's your projekktor version?
  2. what video format are you trying to play?
  3. what is your platforms config?

Probably with the 1.4.00 of projekktor your problems will gone. Could you test upcoming 1.4.00 here: http://projekktor.wlodkowski.net/demo_1.4.00.php

and give us feedback if your issue still applies?

Best fixedmachine

sb-relaxt-at commented 10 years ago

I have been using 1.3.09 (current release) and just used the official demo (I have only added autoplay: true. There are webm, ogv and mp4 files included, I assume Safari to use the mp4.

The provided demo works only occasionally, sometimes it is sound only (black display). Sometimes either the first or the second loop play as expected. Interestingly it seems to work repeatable if either the Safari Devtools are open or if Safari has been reset in advance.

There is another annoying bug, which might be related. If you open the page and immediately open another tab (in a way that the page with the video loads in "the background"), the spinning indicator will be shown after switching back to this tab and you need to refresh the page.

Based on my research, it seems as if the autoplay issues related to "background loading" are independent of using a JS library. A simple HTML5 video shows the same strange behaviour if the page is loaded in the background. I have been starting to handle Safari like any mobile device and to disable autoplay as it seems to be very unreliable (at least since Safari 7)...

The issue concerning sound only playback might be solved by explicitly setting the poster value to an empty string when playback starts. This has solved a similar issue in a recent project of mine.