youtube api - clear browser cache on redirect javascript -
i'm using youtube api track video onstatechange , it's been working when refresh page(clear cache). when try youtube video on page exact same headers doesn't want respond onstatechange function
var ytplayer; function onyoutubeplayerapiready() { ytplayer = new yt.player('ytplayer', { events: { 'onstatechange': onplayerstatechange } }); } function onplayerstatechange(event) { alert("changed"); if(event.data === 0) { players.playnext(videos_data[0].hash); } } basically, i'm trying autoplay next video using
playnext: function (hash) { window.location.href = "//my.website.com/video?hash=" + hash + "&n=" + date.now(); } note: i'm including javascripts in header of html page question: i'm doing wrong , how make work?
Comments
Post a Comment