I implemented the same thing by pausing the video at specific points. When paused, the user can resume the video by clicking on the link (the controls are deleted when paused).
I have the following HTML where the player and HTML dot points are placed:
<div class="row"> <div class="col-xs-12 col-md-5"> <div id="myElement">Loading the player...</div> </div> <div class="col-xs-12 col-md-7"> <div id="on10seconds" class="hidden"> <p>Show after 10 seconds. <a href="#" class="positionInfoLink" data-position="10">Continue...</a></p> </div> <div id="on25seconds" class="hidden"> <p>Show after 25 seconds. <a href="#" class="positionInfoLink" data-position="25">Continue...</a></p> </div> <div id="on50seconds" class="hidden"> <p>Show after 50 seconds. <a href="#" class="positionInfoLink" data-position="50">Continue...</a></p> </div> </div> </div>
And the following JavaScript:
var positions = [10, 25, 50]; var positionsSeen = []; var player = jwplayer("myElement").setup({ file: "/Content/videos/big_buck_bunny.mp4" }); player.onTime(jwPlayerOnTime); function jwPlayerOnTime(onTimeInfo) { var currentPosition = onTimeInfo.position; for (var i = 0; i < positions.length; i++) { var position = positions[i]; var isPositionSeen = positionsSeen.indexOf(position) != -1;
source share