I have this working for one video , where you can rollover each video and see one video play, but I'm stuck on how to apply this every element.
I know its a noob question but I'm learning mediaelements for the first time
jQuery(document).ready(function(){
var player = jQuery('.member-player').mediaelementplayer({
// add desired features in order
clickToPlayPause: false,
hideVideoControlsOnLoad: true,
enableProgressTooltip: false,
features: [],
success: function(mediaElement, originalNode, instance) {
let videoPlayer = instance
// jQuery(document).on('mouseenter','.member-video', function(e)
// console.log('success inner',videoPlayer)
// videoPlayer.play()
// });
//jQuery(document).on('mouseleave',instance, function(e) {
/ /console.log('success inner',instance, videoPlayer)
// return videoPlayer.pause()
// });
}
})
player.each(function(x,val){
/// answer may be here
})
jQuery(document).on('mouseenter', '.member-video', function(e) {
console.log('success inner', player.find(), jQuery(this).attr('id'))
player[1].play()
});
jQuery(document).on('mouseleave', '.member-video', function(e) {
player[1].setCurrentTime(0)
player[1].pause()
});
});
My goal is when you roll over a element it plays the video , when you roll out it rewinds