I have downloaded the ASPNetFlashVideo and am playing around with it in order to determine if it will fit my development needs, but seem to have an issue with the SetPostion() javascript call. I don't know if I am doing this correctly, so bear with me as I am still learning the odds and ends of the control.
Basically, I have several images that I am listing as "slides." Each of these has a click event that will move the video to the correct point in time. However, the SetPosition function jumps the FLV video to another point that is towards the end of the video. Here is the sample code:
Code:<ASPNetFlashVideo:FlashVideo ID="objMovie" runat="server" AllowFullScreen="true" AutoPlay="true" Width="450" Height="450" EolasFixEnabled="true" BufferTime="5" VideoURL="~/videos/sample.flv" StartUpImageURL="startingSlide.JPG" ScaleMode="StretchToFit" ShowControlPanel="true" DebugMode="false"></ASPNetFlashVideo:FlashVideo>
<br />
<br />
<table style="text-align: center;">
<tr align="center">
<td>
<img id="slide1" src="~/images/slide1.JPG" onclick="shiftSlide('1')" />
</td>
<td>
<img id="slide2" src="~/images/slide2.JPG" onclick="shiftSlide('2')" />
</td>
<td>
<img id="slide3" src="~/images/slide3.JPG" onclick="shiftSlide('3')" />
</td>
<td>
<img id="slide4" src="~/images/slide4.JPG" onclick="shiftSlide(4')" />
</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
var movie = ASPNetMedia.FlashVideo("objMovie");
mark_time = new Array();
mark_time[1] = 0;
mark_time[2] = 16;
mark_time[3] = 37;
mark_time[4] = 49;
mark_time[5] = 1256;
movie.OnPlay = function (object, position) {
setTimeout('checkTime(' + position + ');', 1000);
allowSlideShift = 1;
}
function checkTime(position) {
var currSlide = 0;
for (counter = 1; counter < 5; counter++) {
if ((position >= mark_time[counter]) && (position < mark_time[counter + 1])) {
currSlide = counter;
}
}
if (currSlide != 4) {
var newPosition = movie.GetPosition();
setTimeout('checkTime(' + newPosition + ');', 1000);
}
}
function shiftSlide(id) {
if (id > 0 && allowSlideShift > 0) {
setPosition(mark_time[id]);
}
}
function setPosition(pos) {
movie.SetPosition(pos);
}
</script>
To recap, shiftSlide gets the second where I would like to move the FLV video to that particluar second. However, setPostion does not go to the indicated second but rather a point in time that is towards the end of the FLV.
Any help is greatly appreciated.