First, sorry with my English, I'm French.
So, I have to work on JW Player for school and I have to create a chapter modules for videos.
So I tried this :
<script type="text/javascript">
var player = null;
function playerReady(thePlayer) {
player = window.document[thePlayer.id];
}
function createPlayer() {
var flashvars = {
file:"http://content.bitsontherun.com/videos/3ta6fhJQ.flv",
autostart:"true"
}
var params = {
allowfullscreen:"true",
allowscriptaccess:"always"
}
var attributes = {
id:"player1",
name:"player1"
}
swfobject.embedSWF("player.swf", "placeholder1", "320", "196", "9.0.115", false, flashvars, params, attributes);
}
</script>
</head>
<body onload="createPlayer()">
<a href="http://www.jeroenwijering.com/?item=JW_FLV_Media_Player">JW FLV Media Player</a><br>
External javascript control.<br>
<br>
<div id="placeholder1">
<a href="http://www.adobe.com/go/getflashplayer">Get flash</a> to see this player
</div>
<br>
<a href="#" onclick="player.sendEvent('PLAY')">play/pause toggle</a>
<br>
<a href="#" onclick="player.sendEvent('STOP')">stop playing and buffering</a>
<br>
<a href="#" onclick="player.sendEvent('SEEK', 10)">seek absolute position (10th. second)</a>
<br>
<a href="#" onclick="player.sendEvent('VOLUME', 50)">set absolute volume 50%</a>
<br>
Seen on : http://home5.inet.tele.dk/nyboe/flash/mediaplayer4/JW_API_xmpl_5-1-0-0.html
Everything is working fine, exept the seeking one, so, I have several questions.
First, can I seek a frame and not a second ? (All my videos are in 25 FPS)
Does it only work every 5 seconds ?
Thanks :)
Here's a similar implementation that you might take a look at:
http://www.longtailvideo.com/support/forum/JavaScript-Interaction/14622/SEEK-not-working
Since your video is coming from bitsontherun, it has the metadata array of time/byte-position that is needed for the player to scrub.
Look at the 'times' array and you can see the time position of the keyframes that you can scrub to:
Magic: FLVVersion: 1
Has audio: yes
Has video: yes
Offset: 9
--- Tag #1 at 0xD (13) ---
Tag type: Meta
Body length: 726
Timestamp: 0
* Metadata event name: onMetaData
* Metadata contents: {
'metadatacreator' => 'Yet Another Metadata Injector for FLV - Version 1.2'
'hasKeyframes' => true
'hasVideo' => true
'hasAudio' => true
'hasMetadata' => true
'canSeekToEnd' => false
'duration' => 27.193000
'datasize' => 1844101.000000
'videosize' => 1389313.000000
'videocodecid' => 4.000000
'width' => 352.000000
'height' => 256.000000
'framerate' => 23.939985
'videodatarate' => 397.089784
'audiosize' => 448016.000000
'audiocodecid' => 2.000000
'audiosamplerate' => 44100.000000
'audiosamplesize' => 16.000000
'stereo' => true
'audiodatarate' => 125.421179
'filesize' => 1844855.000000
'lasttimestamp' => 27.193000
'lastkeyframetimestamp' => 25.208000
'lastkeyframelocation' => 1713738.000000
'keyframes' => {
'filepositions': [
1187.000000
323732.000000
651368.000000
980273.000000
1266413.000000
1383638.000000
1713738.000000
]
<strong> 'times': [
0.000000
5.000000
10.000000
14.333000
18.708000
20.208000
25.208000
]</strong>
}
'' => ''
}
* Missing: 57616 bytes
Previous tag size: 737