AussieJohn,
I’ve been trying to do the same type of SRC change using the onClick method. But, I haven’t coded in javascript for a while, and I’m not sure how to incorporate the VideoJS code into my HTML page.
I’m trying to create a CSS playlist for the VideoJS player that will match the Flash Playlist on my website: www.ustv.us. Here is the code I have so far:
<html>
<head>
<meta name=“GENERATOR” content=“Microsoft FrontPage 5.0”>
<meta name=“ProgId” content=“FrontPage.Editor.Document”>
<meta http-equiv=“Content-Type” content=“text/html; charset=windows-1252”>
<title>New Page 1</title>
<link href="http://vjs.zencdn.net/c/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/c/video.js"></script>
<style type="text/css" media="screen">
/* playlist style */
#playlist {
width:312px;
height:260px;
overflow-y:auto;
overflow-x:hidden;
border:1px solid #ccc;
padding:4px 10px 12px 10px;
background-color:#efefef;
margin-top:20px;
float:left;
}
/* playlist entry */
#playlist a {
display:block;
width:280px;
height:90px;
padding:7px;
background-color:#fff;
border:1px solid #ccc;
font:11px “bitstream vera sans”, “lucida grande”,verdana;
text-decoration:none;
margin-top:7px;
color:#666;
}
/* different states of a playlist entry */
#playlist a:hover {
background-color:#ffc;
}
#playlist a.progress {
background-color:#efefef;
}
#playlist a.playing {
border:1px solid #666;
background-color:#ffc;
}
#playlist a.paused {
border:1px solid #666;
background-color:#ffc;
}
/* elements inside playlist entry */
#playlist a img {
border:0px none;
float:left;
margin-right:10px
}
#playlist a strong {
color:blue;
padding-bottom:5px;
}
#playlist a em {
border:0px none;
float:left;
margin-right:10px;
background:url(‘/media/img/demos/clock.gif’) no-repeat 0 50%;
padding-left:20px;
color:#333;
font-style:normal;
margin-top:10px
}
#playlist{
margin-top: 0;
}
</style>
</head>
<body>
<video id=“HTML5_video_player” class=“video-js vjs-default-skin” controls
preload=“auto” width=“720” height=“480” poster=“http://www.ustv.us/HTML5_working/BillyB-Thats_Runoff_Man.jpg”
data-setup=“{}”>
<source src=“http://www.ustv.us/BaltWoods/BillyB-Thats_Runoff_Man.mp4” type=‘video/mp4’>
<source src=“http://www.ustv.us/BaltWoods/BillyB-Thats_Runoff_Man.webm” type=‘video/webm’>
</video>
<script type=“text/javascript”>
// <![CDATA[
var myPlayer=“HTML5_video_player”
// ]]>
</script>
<!-- the playlist. simple HTML controlled with CSS –>
<div id=“playlist”>
<a href="#" onClick="myPlayer.src=('http://www.ustv.us/BaltWoods/BillyB-Thats_Runoff_Man.mp4')">
<img src="http://www.ustv.us/dailies/daily_images/BillyB-RunoffMan1.png" width="120" height="67" />
<strong>Baltimore Woods - Billy B Performance - That's Runoff Man</strong><br />
<em>0.22</em>
</a>
<a href="#" onClick="myPlayer.src=('http://www.ustv.us/BaltWoods/BillyB-With_My_Hand.mp4')">
<img src="http://www.ustv.us/dailies/daily_images/BillyB-WithMyHand.png" width="120" height="79" />
<strong>Baltimore Woods - Billy B Performance - With My Hand</strong><br />
<em>0.22</em>
</a>
<a href="#" onClick="myPlayer.src=('http://www.ustv.us/BaltWoods/BillyB-Water_Cycle.mp4')">
<img src="http://www.ustv.us/dailies/daily_images/BillyB-WaterCycle1.png" width="120" height="79" />
<strong>Baltimore Woods - Billy B Performance - Water Cycle</strong><br />
<em>0.22</em>
</a>
<a href="#" onClick="myPlayer.src=('http://www.ustv.us/BaltWoods/BillyB-Flies_in_Black.mp4')">
<img src="http://www.ustv.us/dailies/daily_images/BillyB-FliesInBlack.png" width="120" height="90" />
<strong>Baltimore Woods - Billy B Performance - Flies In Black</strong><br />
<em>0.22</em>
</a>
</div>
<!-- let the rest of the page float normally –>
</body>
</html>