amazon-archives / web-app-starter-kit-for-fire-tv

Web App Starter Kit Examples
https://amzn.github.io/web-app-starter-kit-for-fire-tv/
Other
372 stars 160 forks source link

Video do not autoplay #59

Open onigetoc opened 5 years ago

onigetoc commented 5 years ago

Video do not autoplay i did this in player-view.js this.videoElement.setAttribute("autoplay", "true"); it did work but the sound play twice. i looked in the Google inspector to find out that there's was two <video tags in the html with the same setting.

i did added a alert on the render function player-view.js and this function is fire twice when we load a video.

this.render = function ($container, data, index) {
alert("render")

the alert fire twice.

onigetoc commented 5 years ago

i did a temporary fix.

 // TEMPORARY AUTOPLAY FIX
if(!document.getElementsByTagName("video").length == 0 ){
    document.getElementsByTagName('video')[0].play();
}