I’ve updated my code:
jQuery(document).ready(function(){
if( typeof(flowplayer) != "undefined" ) {
flowplayer(function (api, root) {
jQuery("#ts1").on("click", function (e) {
e.preventDefault();
e.stopPropagation();
console.log("playing");
api.play();
api.seek(200);
});
});
}
});
Now the seek function is working but the play function is not. There is only one video on the page, Do I need to pass the play function a parameter?
This may be the answer to my question:
jQuery(document).ready(function(){
if( typeof(flowplayer) != "undefined" ) {
flowplayer(function (api, root) {
jQuery(".link_1").on("click", function (e) {
e.preventDefault();
e.stopPropagation();
seek_and_play(api, link_1_track)
});
jQuery(".link_2").on("click", function (e) {
e.preventDefault();
e.stopPropagation();
seek_and_play(api, link_2_track)
});
});
}
});
function seek_and_play(api, track) {
if(!api.playing) {
api.load();
setTimeout(function () {
api.seek(track);
}, 1000);
} else {
api.seek(track);
}
}
-
This reply was modified 2 years, 3 months ago by AlanP57.
-
This reply was modified 2 years, 3 months ago by AlanP57.
Hello Alan,
we apologize for the late answer.
Let us know if the last code worked for you, or if you need further help.
Thanks,
Maria