Video.JS - Multiple events firing on exact time once
<p>I'm developing a web application in which I've got a video element. This, as I've had good experiences with it, is controlled via the <a href="http://videojs.com/" rel="nofollow">VideoJS</a> scripts.</p>

<p>However, on my app, there are some points in which the video needs to be paused until played by the user (or by a script, it's not relevant), but not after.</p>

<h1>What I have</h1>

<p>Basically - and the basic information you need - what I have is an array of items, let's say <code>item_array</code>, with objects in it. Each object has an <code>id</code>, a <code>media</code> object with some information of it, including a <code>src</code>, and an <code>indications</code> array - which would be the pause-times objects. Something like that:</p>

<pre><code>var items_array = [
    {
        id: 1234,
        media: {
            id: 2345,
            src: 'video_source.mp4',
            duration: 302.56
        },
        indications: [
            {
                id: 1, 
                time: 65.380
            },
            {
                id: 2,
                time: 89.238
            },
            {
                id: 3,
                time: 123.765
            }
        ]
    }
]
</code></pre>

<p>Of course, I've got the <code>video</code> variable, which stores the VideoJS reference and is accessible all along the code as a global variable (maybe it's useful for you to know that).</p>

<h1>What I need</h1>

<p>Basically, I need to be able to load a video source and tell the script that the video must pause at 1:05.380, 1:29.238 and 2:03.765, for example. </p>

<p>Once paused, the user can play the video again, and it will not be paused (at least, by the script) again until the next time mark is reached.</p>

<p>Then, the user can specify a new video to load, with its new pause-points, so old pause-points should be removed and new ones set.</p>

<p>Also, it would be necessary to perform other actions apart from pausing the video (such as showing a message, etc.). But it's not necessary for you to know any of these - just I have to be able to write some actions to do on every pause-point.</p>

<h1>What I've tried</h1>

<p>Well, I've been playing with <code>timeupdate</code>. The first problem is that this only fires every now and then, so <code>video.currentTime() == NN.NNN</code> will not always work. </p>

<p>The script <code>video.currentTime() &gt;= NN.NNN</code> is not possible neither, because the user must be able to play further the pause-time (yes, the event can be set off once reached, but if the user skips it on the time line, the video must not be paused).</p>

<p>So, if the pause-time is at 1:05 and the user skips from 0:45 to 1:25, the pause-time set to 1:05 must not be triggered, thus the video must not be paused - so the line written before does not work as I'd like to.</p>

<p><strong>Thank you everyone in advance for your time and help!</strong> If you need any further information, please ask me and I will submit it as soon as I can!</p>

<p>Best regards.</p>