Skip to main content
Participant
Nov 30, 2022 7:40 AM UTC
Question

I can't pause video while playing

I wanted to pause video while it plays. 

For example after video started playing it has to be stopped at 21st second.

After it stopped, some button will show up.

If I click on the button, It will start playing from 30th second etc. 

 

PS: I want to use it on the web.

    This topic is closed to new replies. Start a new post to keep the conversation going.

    3 replies

    kglad
    Community Expert
    Community Expert
    Nov 30, 2022 3:52 PM UTC

    and how are you playing the video?  in a video component?

     

    if yes, what's the component's instance name?

    Translate
    Participant
    Dec 1, 2022 5:25 AM UTC

    Yes, instance name is mainVideoId

    If I click on the video, it will start playing. 

    So it should be paused or stopped at 21 seconds. 

    $('#dom_overlay_container').on('click', '#MainVideoId', function() {
    	$('#MainVideoId')[0].play();
    }.bind(_this));

     

    Translate
    kglad
    Community Expert
    Community Expert
    Dec 1, 2022 2:31 PM UTC

    $('#dom_overlay_container').on('click', '#MainVideoId', function() {
    $('#MainVideoId')[0].play();

    setTimeout(stopVideoF,21000);
    }.bind(_this));

     

    function stopVideoF(){

     

    }$('#MainVideoId')[0].stop();

    Translate