Index: branches/new-upload/phase3/js2/mwEmbed/example_usage/seeking_example.html |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <!doctype html> |
3 | 3 | <html> |
4 | 4 | <head> |
5 | | - <title>Video element properties</title> |
| 5 | + <title>mv_embed Seeking Example</title> |
6 | 6 | <script type="text/javascript" src="../mv_embed.js"></script> |
7 | 7 | <style> |
8 | 8 | #render_box { |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | </style> |
22 | 22 | <script> |
23 | 23 | var pos = 0; |
24 | | -var duration = 10; |
| 24 | +var duration = 2; |
25 | 25 | var step = 0.04; |
26 | 26 | var render = false; |
27 | 27 | |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | $j('#pos').val(pos); |
30 | 30 | document.getElementById('render_box').setCurrentTime(pos, function(currentTime) { |
31 | 31 | return function() { |
32 | | - //call ogg.addFrame(); |
| 32 | + //ogg.addFrame('frame_overlay'); |
33 | 33 | pos += step; |
34 | 34 | if(render && pos <= duration) |
35 | 35 | renderNext(); |
— | — | @@ -37,15 +37,24 @@ |
38 | 38 | } |
39 | 39 | |
40 | 40 | function startRender() { |
| 41 | + //ogg = new Firefogg(); |
| 42 | + //ogg.initRender('{"videoQuality": 10, "framerate": 25, "width": 400, "height": 300}', 'sample_smil.ogv'); |
| 43 | + $j("#buttonStart").attr("disabled", true); |
41 | 44 | if(!render) { |
42 | | - duration = document.getElementById('render_box').getDuration(); |
43 | | - render = true; |
44 | | - pos = 0; |
45 | | - renderNext(); |
| 45 | + //document.getElementById('render_box').play(); |
| 46 | + //document.getElementById('render_box').pause(); |
| 47 | + setTimeout(function() { |
| 48 | + //duration = document.getElementById('render_box').getDuration(); |
| 49 | + render = true; |
| 50 | + pos = 0; |
| 51 | + renderNext(); |
| 52 | + }, 1000); |
46 | 53 | } |
47 | 54 | } |
48 | 55 | function stopRender() { |
49 | 56 | render = false; |
| 57 | + $j("#buttonStart").attr("disabled", false); |
| 58 | + $j("#buttonSop").attr("disabled", true); |
50 | 59 | } |
51 | 60 | function seek() { |
52 | 61 | var seekTo = $j('#pos').val(); |
— | — | @@ -58,8 +67,8 @@ |
59 | 68 | <div id="frame_overlay"></div> |
60 | 69 | |
61 | 70 | <div id="info" style="position: absolute; top:360px"> |
62 | | - <button onclick="startRender()">Start</button> |
63 | | - <button onclick="stopRender()">Stop</button> |
| 71 | + <button onclick="startRender()" id="buttonStart">Start</button> |
| 72 | + <button onclick="stopRender()" id="buttonStart">Stop</button> |
64 | 73 | position: <input type="text" id="pos" value="6.6" /> |
65 | 74 | <button onclick="seek()">seek</button> |
66 | 75 | <span id="status"></span><br> |