PodCastena / my_functions.js
AlbertoFH98's picture
Load utils + javascript files
6996634
raw
history blame
654 Bytes
var tag = document.createElement('script');
tag.src = 'https://www.youtube.com/iframe_api';
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player, seconds = 0;
function onPlayerReady(event) {
event.target.playVideo();
}
function seek(sec){
var documentContainer = document;
var iframe = documentContainer.getElementById('player');
console.log("iframe");
console.log(iframe);
player = new YT.Player(iframe, {
events: {
'onReady': onPlayerReady
}
});
if(player){
player.seekTo(sec, true);
}
}