Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Triggers a jquery event at a certain time in a video http://jsfiddle.net/XTEWW/6/ -->
- <!--
- HTML
- -->
- <div id = "showdiv" style="display:none" align="center">
- this is the message that will pop up.
- </div>
- <video id='myVideo' align="center" margin-top="100px" class='video-js vjs-default-skin' preload='auto' data-setup='{}' width='400' height='300' controls="controls">
- <source src='http://www.808.dk/pics/video/gizmo.mp4' type='video/mp4'></source>
- </video>
- <!--
- JQUERY
- -->
- <script>
- function myHandler() {
- $("#showdiv").toggle("slow");
- }
- var runAtTime = function(handler, time) {
- var wrapped = function() {
- if(this.currentTime >= time) {
- $(this).off('timeupdate', wrapped);
- return handler.apply(this, arguments);
- }
- }
- return wrapped;
- };
- $('#myVideo').on('timeupdate', runAtTime(myHandler, 3));
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement