i need to work with setTimeout function but that function does not work.
First of all,
Player.prototype.playByUrl = function (url) {
this.object.data = url;
return this.play();
}
Above code is my function and i call it
window.onload = function () {
player = new Player('playerObject');
setTimeout(player.playByUrl($mp4Link),3000);
}
However, in above code, setTimeout does not work why ?
setTimeoutneeds afunction:The way you were doing it was that it was executing
player.playByUrl($mp4Link)immediately on the start of the script.