Play audio from beginning
Submitted by axym on Fri, 01/29/2016 - 21:10
Forums:
How can I play audio(video) from beginning when I change slide.Thanks
How can I play audio(video) from beginning when I change slide.Thanks
Navigation
Connect with H5P
About
H5P is a registered trademark of H5P Group
Privacy policy |
Copyright ©
2024
falcon
Mon, 02/01/2016 - 09:36
Permalink
You mean via a setting, or as
axym
Tue, 02/02/2016 - 19:22
Permalink
I use a similar code for the
I use a similar code for the video. ( Flexslider + videojs).
How can I implement something similar in H5P?
Thanks.
Drupal.behaviors.my_custom2_flexslider_behaviour = {
attach: function (context, settings) {
$('#slidem').bind('after', function(e, slider) {
var currentVidID;
currentVidID = $('#slidem .flex-active-slide video').attr('id');
//alert(currentVidID);
if (currentVidID ){
myPlayer = videojs(currentVidID); // Setting to the currently viewed player. We might not be on the first video when this is called.
//var player = currentVidID;
//$f(player).addEvent('ready', ready);
if (myPlayer.duration() > 0){
$('#slidem').flexslider("pause");
myPlayer.currentTime(0);
myPlayer.play();
//myPlayer.addEvent('ended', resumeslider() );
myPlayer.on('ended',function(){
console.log('Video Complete');
$('#slidem').flexslider("play");
myPlayer.stop();
});
};
}
});
}
};
Thanks
falcon
Tue, 02/02/2016 - 20:18
Permalink
The suggestions below are not
The suggestions below are not complete and have not been tested. They're just written to you as pointers on how you might try to achieve what you want.
For interactive video inside Flexslider you could try...
Inside the $('#slidem').bind('after', function(e, slider) { block you could try to add something like:
For Audio inside CP it would be something like this: