jhiesey / videostream

Play html5 video when from a file-like object
MIT License
243 stars 74 forks source link

Fix autoplay not working in Firefox and Chromium #39

Closed Daniel-Abrecht closed 5 years ago

Daniel-Abrecht commented 6 years ago

This can be seen with the example in the example folder with Firefox 52.7.2 ESR and Chromium 64.0.3282.119. Firefox an chrome won't create a waiting event if autoplay is set but preload isn't, which cases _onWaiting to not be called and the video to not autoplay. _onWaiting could be called directly, but this commit will just set preload to auto if autoplay is set, which will cause the browser to generate a waiting event and thus _onWaiting to be called.