I need to make something like a "skip to chapter" section. Under the player will be some links, on click the movie should jump to a given time. I tried something but it's a little buggy. The movie supports streaming, but it seems like that player cannot receive 2 acctions, jump to time and play.. do you have any ideas ?
<script type="text/javascript">
// some variables to save
var currentPosition;
var currentVolume;
var currentItem;
// these functions are caught by the JavascriptView object of the player.
function sendEvent(typ,prm) { thisMovie("mpl").sendEvent(typ,prm); };
function getUpdate(typ,pr1,pr2,pid) {
if(typ == "time") { currentPosition = pr1; }
else if(typ == "volume") { currentVolume = pr1; }
else if(typ == "item") { currentItem = pr1; setTimeout("getItemData(currentItem)",100); }
var id = document.getElementById(typ);
id.innerHTML = typ+ ": "+Math.round(pr1);
pr2 == undefined ? null: id.innerHTML += ", "+Math.round(pr2);
if(pid != "null") {
document.getElementById("pid").innerHTML = "(received from the player with id <i>"+pid+"</i>)";
}
};
// These functions are caught by the feeder object of the player.
function loadFile(obj) { thisMovie("mpl").loadFile(obj); };
function addItem(obj,idx) { thisMovie("mpl").addItem(obj,idx); }
function removeItem(idx) { thisMovie("mpl").removeItem(idx); }
function getItemData(idx) {
var obj = thisMovie("mpl").itemData(idx);
var nodes = "";
for(var i in obj) {
nodes += "<li>"+i+": "+obj[i]+"</li>";
}
document.getElementById("data").innerHTML = nodes;
};
// This is a javascript handler for the player and is always needed.
function thisMovie(movieName) {
if(navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
};
function openPlay(x){
if(state == 0){
sendEvent('playitem', 0);
}
else{
s = "sendEvent('scrub', " + x + ")";
setTimeout(s, 500);
}
if(state != 2){
p = "openPlay(" + x + ")";
setTimeout(p, 500);
}
}
</script>
Actions are sent like this:
<a href="javascript:sendEvent('playpause')">Play/Pause</a> | <a href="javascript:sendEvent('stop')">Stop</a> | <a href="javascript:openPlay(50);">Jump to article 2</a>
Something seems wrong in the javascript.

@Sorin,
Have you read this post [url=http://www.jeroenwijering.com/?thread=6080#msg33286]Chapterizer - Town Meeting[/url]?
I have published several systems to chapterize a video file, automatically create a playlist with thumbnails, and stream the chapters.
If the application in the post referenced above does not meet your exact needs, I can modify it, provided you can give me a detailed description of how you want it to work.