You should just poll for the currentTime and pause when it is equal to or greater than the time you want.
Just be aware to only run the limit once or dynamically if you then want to resume..
See this post where it uses timeupdate event and currentTime.
Yes an example of what you have is always a good start. The only reason I never asked for one was because video files can be a pain to post size wise and you are new to posting..
Tip. when posting code select the code in the post and then click the code button.
This will format it for the post.
Here is an example. I added a timeline since you seemed to have ref one?.
But you can also use the video file in that to post back your own example.
The initiation of the listener is done in one function that runs on a prepare for display action.
It will only run once.
I removed the video file so I could post it back.
Just drop your video on the scene again and give it the video1 id
I also have put in the time code element so you can see what is going on time wise.
Remove it and any reference to it (debug code ) in code on production or set debug to false.
but so i can " play and pause " only a single button ?
For example , it's different and complex for all 3 buttons ?
a -> 5 - 10
b -> 10 - 15
c -> 15-20
I did actually have another version that points all the buttons at a single script.
It uses data attributes to determine which button was clicked and then sets the time using a conditional switch.
In the example you sent me of my project, if I click the 3 buttons, the video starts from different points, and this is ok, but in all 3 the actions always stop at the same point, that is when the video reaches the point break (our example 50).
Instead the 3 buttons (a, b, c) the video as well as starting at different points, stop at different points.
I don't know if it's correct.
An example:
Duration Video 20sec.
Button:
a start at 5sec stop at 10sec
b start at 10sec stop at 15sec
c start at 15sec stop at 20sec