Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
25
rated 0 times [  28] [ 3]  / answers: 1 / hits: 15780  / 13 Years ago, thu, december 29, 2011, 12:00:00

I have an iframe with a video, for example:



<iframe src=http://player.vimeo.com/video/18150336 width=500 height=281 frameborder=0 webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>


The source won't always be vimeo, it can be YouTube, BrightCove, Hulu etc etc.



Is there a way to use jQuery/JavaScript to seek to a certain time in the video? For example, if I wanted to get to 3:41 inside of a video could I write code to automatically seek to that time w/o API access to the sites providing the video?


More From » jquery

 Answers
124

Sure. You can use VideoJS. You may have a hard time getting control of the iFrame as you put it. You can embed various video hosting sites' video with VideoJS, supposedly.



<script>
VideoJS.DOMReady(function() {
var player = VideoJS.setup(current_video);
player.play();
player.currentTime(666);
});
</script>


ref:



https://github.com/zencoder/video-js/blob/df41661f47201cfbc979b1fbba68fba3d67c06b0/dev/src/tech/youtube.js



http://videojs.com/



https://github.com/zencoder/video-js/blob/master/docs/api.md


[#88333] Tuesday, December 27, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mitchell

Total Points: 95
Total Questions: 110
Total Answers: 87

Location: Gabon
Member since Thu, Jul 15, 2021
3 Years ago
;