Hello,
I am using the videojs plugin to add a video player to my site (http://videojs.com/). I have multiple videos on the same page that when the user clicks i want to display in the video player. I have not put the links in <li> tags they are simple <a> tags.
When I click on the link i want it to update the player with the new video. From what i can work out i need to do this on the onclick event. However, i need it to be able to update multiple sources within the <video> tag because each browser reads a different file (because onbviously they do not all support the same format)
I have made this work successfully for updating one of the sources, but can't make it work for more the others.... can anyone help?
This is the code i have been using for the video player:
and this is the code for a couple of the links.....Code:<video id="video" class="video-js vjs-default-skin" controls width="960" height="544" autoplay="true" preload="auto" data-setup="{}"> <source src="#" type='video/mp4'> <source href="#" type='video/webm'> </video>
Any help is appreciated....Code:<a href="#" onclick="document.getElementsByTagName('video') .src = 'assets/videos/misc/antibioclic.mp4'">Antibioclic</a> <a href="#" onclick="document.getElementsByTagName('video') .src = 'assets/videos/misc/google.mp4'">Google</a>


Reply With Quote



Bookmarks