I do have serious issues with the youtube api. ytPlayer.seekTo() method crashes under Firefox 33.0 (used through desktop as well as slimerjs). It crashes on both firefox (full-installation) as well as xulrunner. Any ideas what may be the reason for this and how to solve it?
Error: Default Windows Error Promt: XULRunner stopped working The programm was closed in reaseon of an problem. You ll be notified as soon as an solution is available.
Shell Errors (Number in square brakets varii from execution to execution somehow random:
[6064] ###!!! ABORT: Aborting on channel error.: file c:/builds/moz2_slave/rel-m-rel-xr_w32_bld-000000000/build/ipc/glue/MessageChannel.cpp, line 1547
[12464] ###!!! ABORT: Aborting on channel error.: file c:/builds/moz2_slave/rel-m-rel-xr_w32_bld-000000000/build/ipc/glue/MessageChannel.cpp, line 1547
The code
<html>
<head>
<script src="https://www.youtube.com/iframe_api"></script>
</head>
<body style="margin:0; padding:0">
<script>
var ytPlayer;
var nextPlayerTime = 0
// on api ready
function onYouTubeIframeAPIReady() {
console.log("youtube iframe api ready");
ytPlayer = new YT.Player("youTubePlayer", {
events: {
onStateChange: function(e) {
if (e.data == YT.PlayerState.PLAYING) {
console.log("youtube playing go to next");
ytPlayer.pauseVideo();
nextPlayerTime +=10;
ytPlayer.seekTo( nextPlayerTime ,true );
ytPlayer.playVideo();
}
}
}
});
}
</script>
<iframe id="youTubePlayer" src="https://www.youtube.com/embed/hKWmFWRVLlU?version=3&vq=hd1080&enablejsapi=1&playerapiid=ytplayer&allowscriptaccess=always&wmode=opaque&autoplay=1" width="100%" height="100%" style="border: 0px;"></iframe>
</body>
</html>