javascript - Prevent Slider Revolution from pausing HTML5 video - Stack Overflow

I'm using the Themepunch Revolution slider in a project, which shows a single video slide in HTML

I'm using the Themepunch Revolution slider in a project, which shows a single video slide in HTML 5.

When I click on it, it pauses, which I don't want.

The <video> element in the page is generated by the slider plugin.

Here's what I tried so far:

$('body').on('click', 'video', function(e) {
    e.preventDefault();
    e.stopPropagation();
    return false;
});

This is the code in the slider library:

html5vid.find('video, .tp-poster, .tp-video-play-button').click(function() {
    if (html5vid.hasClass("videoisplaying"))
        video.pause();
    else
        video.play();
})

I also tried catching the pause event, but it never fires:

$('body').on('pause', 'video', ...);

I'm using the Themepunch Revolution slider in a project, which shows a single video slide in HTML 5.

When I click on it, it pauses, which I don't want.

The <video> element in the page is generated by the slider plugin.

Here's what I tried so far:

$('body').on('click', 'video', function(e) {
    e.preventDefault();
    e.stopPropagation();
    return false;
});

This is the code in the slider library:

html5vid.find('video, .tp-poster, .tp-video-play-button').click(function() {
    if (html5vid.hasClass("videoisplaying"))
        video.pause();
    else
        video.play();
})

I also tried catching the pause event, but it never fires:

$('body').on('pause', 'video', ...);
Share Improve this question asked Feb 27, 2016 at 13:44 OliOli 2,4742 gold badges28 silver badges47 bronze badges 3
  • well, isn't the code in the slider library telling you why it's pausing? it's checking whether it's running, if so it will pause... don't think you can override that outside the library unless you edited the script... – benomatis Commented Feb 27, 2016 at 13:46
  • ...have you tried unbinding click? – benomatis Commented Feb 27, 2016 at 13:49
  • @webeno yeah my only working solution so far is directly removing the lines from the library, which is ugly :( – Oli Commented Feb 27, 2016 at 14:00
Add a ment  | 

3 Answers 3

Reset to default 5

For Revolution Slider 6.x, it's easier, just select the video layer option > Content > (Scroll down) Advanced Media Settings > Set "No Interaction" off

This will disable the click to pause/play also remove controls, you end up with a playing video with no interactions, also don't forget to set Loop Media on for plete experience

Revolution Slider No Interaction Setting to prevent controls and stop click for play/pause:

Hey it is 2019 but anyone who look for solution is that :

Put transparent shape layer onto video layer as full width and height.

Make sure put this layer one step above the video layer as showing below(this shape looks like it below the video layer but in rev slider animation settings the more bottom the more up on the front-end i hope i make it clear :)

Layer positions on rev slider animation settings

Try

html5vid.find('video, .tp-poster, .tp-video-play-button').unbind('click');

Replace html5vid with whatever element the script is looking to find in.

EDITED

...or better yet, try to unbind click on the video element as follows:

$('video').unbind( "click" );

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745346716a4623585.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信