I'm looping the video URL from database and each video has a certain frame that I would like to "seek" to. I'm using the "seek" function provided from JwPlayer.
However, I can't seem to get it right on how to pass the variable to JwPlayer javascript. Below is my JS for JwPlayer:
$('.video').fancybox({
content : '<div id="myElement">Loading the player...</div>',
fitToView : true,
afterShow : function() {
this.content = jwplayer('myElement').setup({
flashplayer: "js/jwplayer.flash.swf",
file: this.href,
height: 360,
width: 640,
autoStart : false,
stretching : "fill"
});
// Store references to tag and rates
var videoTag;
var currentRate = 1;
jwplayer().onReady(function() {
jwplayer().seek(<?=$sec?>);
});
}
});
And this is my HTML
<a class="video fancybox.iframe" href="<?=$video_link;?>">Watch Video</a>
Can anyone help to advise how I can put in the "sec" to jwplayer.seek
? I tried using "id" and then get the ID but it's not working either.