Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js |
— | — | @@ -28,7 +28,8 @@ |
29 | 29 | 'audio' : 'ref', |
30 | 30 | 'img' : 'ref', |
31 | 31 | 'textstream' : 'ref', |
32 | | - 'video' : 'ref' |
| 32 | + 'video' : 'ref', |
| 33 | + 'smiltext' : 'ref' |
33 | 34 | }, |
34 | 35 | |
35 | 36 | // Constructor: |
— | — | @@ -162,7 +163,7 @@ |
163 | 164 | 'src' : _this.smil.getAssetUrl ( $node.attr('src') ), |
164 | 165 | 'duration' : _this.getNodeDuration( $node ), |
165 | 166 | 'startTime' : $node.data( 'startOffset' ), |
166 | | - 'offset' : 0 // have to add in media-offset support |
| 167 | + 'offset' : _this.smil.parseTime( $node.attr( 'clipBegin') ) |
167 | 168 | }; |
168 | 169 | |
169 | 170 | // If audioTimeline is empty insert directly |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js |
— | — | @@ -331,7 +331,7 @@ |
332 | 332 | if( !animateInRange ) { |
333 | 333 | if( animateTime == 0 ) { |
334 | 334 | // just a hack for now ( should read from previous animation or from source attribute |
335 | | - //this.updateElementLayout( smilImgElement, { 'top':1,'left':1,'width':1, 'height':1 } ); |
| 335 | + // this.updateElementLayout( smilImgElement, { 'top':1,'left':1,'width':1, 'height':1 } ); |
336 | 336 | var $target = $j( '#' + this.smil.getAssetId( smilImgElement )); |
337 | 337 | $target.css( { |
338 | 338 | 'top' : '0px', |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js |
— | — | @@ -326,22 +326,24 @@ |
327 | 327 | * DIGIT ::= [0-9] |
328 | 328 | * |
329 | 329 | * @param {mixed} timeValue time value of smil structure |
330 | | - * @ return {float} Seconds from time value |
| 330 | + * @return {float} Seconds from time value, if timeValue is empty or null return 0 |
331 | 331 | */ |
332 | 332 | parseTime : function( timeValue ){ |
333 | | - // If timeValue is already a number return seconds: |
| 333 | + if( !timeValue ) |
| 334 | + return 0; |
| 335 | + |
| 336 | + // If timeValue is already a clean number of seconds, return seconds: |
334 | 337 | if( ! isNaN( timeValue ) ){ |
335 | 338 | return parseFloat( timeValue ); |
336 | 339 | } |
337 | | - // Trim whitespace |
| 340 | + // Trim whitespace if empty return zero |
338 | 341 | timeValue = $j.trim( timeValue ); |
339 | | - if( timeValue == '' ){ |
340 | | - mw.log("Error: Empty time value "); |
| 342 | + if( timeValue == '' ){ |
341 | 343 | return 0; |
342 | 344 | } |
343 | 345 | |
344 | 346 | // First check for hh:mm:ss time: |
345 | | - if ( timeValue.split( ':' ).length == 3 || timeValue.split( ':' ).length == 2 ) { |
| 347 | + if ( timeValue.split( ':' ).length == 3 || timeValue.split( ':' ).length == 2 ) { |
346 | 348 | return mw.npt2seconds( timeValue ); |
347 | 349 | } |
348 | 350 | |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoCrossFade.html |
— | — | @@ -18,24 +18,18 @@ |
19 | 19 | $j('#videoCrossfade').get(0).load(); |
20 | 20 | return false; |
21 | 21 | }); |
22 | | - $j('#renderToFile').click(function(){ |
23 | | - $j(this).empty().unbind().after( |
24 | | - $j('<span />').text( ' ' ), |
25 | | - $j('<span />').attr('id', 'targetFoggStatus' ) |
26 | | - ); |
27 | | - |
| 22 | + $j('#renderToFile').click(function(){ |
28 | 23 | // xxx for local rendering 'AddMedia.firefogg' is overkill |
29 | | - // but will have to clean up modularity later |
30 | | - |
| 24 | + // but will have to clean up modularity later |
31 | 25 | mw.load( ['AddMedia.firefogg','mw.FirefoggRender'],function(){ |
32 | | - var foggRender = $j('#videoCrossfade').firefoggRender({ |
| 26 | + var foggRender = $j('#videoClipBegin').firefoggRender({ |
33 | 27 | 'statusTarget': '#targetFoggStatus' |
34 | 28 | }); |
35 | | - foggRender.doRender(); |
36 | | - |
37 | | - $j('#renderToFile').text('Stop Render').click(function(){ |
38 | | - foggRender.stopRender(); |
39 | | - }); |
| 29 | + if( foggRender.doRender() ){ |
| 30 | + $j('#renderToFile').text('Stop Render').click(function(){ |
| 31 | + foggRender.stopRender(); |
| 32 | + }); |
| 33 | + } |
40 | 34 | }) |
41 | 35 | return false; |
42 | 36 | }); |
— | — | @@ -52,7 +46,7 @@ |
53 | 47 | <p></p>seek to <input id="seekInputTime" size="4" value = "6"></input><span id="seekInProgress" style="display: none"> Seeking<blink>...</blink></span> |
54 | 48 | <br/> |
55 | 49 | <a id="startBuffer" href="#">Start buffering</a> <br> |
56 | | -<a id="renderToFile" href="#">Render to file</a> |
| 50 | +<a id="renderToFile" href="#">Render to file</a> <span id="targetFoggStatus"></span> |
57 | 51 | </td> |
58 | 52 | <td valign="top"> |
59 | 53 | Sample playlist code: |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoClipBegin.html |
— | — | @@ -18,24 +18,18 @@ |
19 | 19 | $j('#videoClipBegin').get(0).load(); |
20 | 20 | return false; |
21 | 21 | }); |
22 | | - $j('#renderToFile').click(function(){ |
23 | | - $j(this).empty().unbind().after( |
24 | | - $j('<span />').text( ' ' ), |
25 | | - $j('<span />').attr('id', 'targetFoggStatus' ) |
26 | | - ); |
27 | | - |
| 22 | + $j('#renderToFile').click(function(){ |
28 | 23 | // xxx for local rendering 'AddMedia.firefogg' is overkill |
29 | | - // but will have to clean up modularity later |
30 | | - |
| 24 | + // but will have to clean up modularity later |
31 | 25 | mw.load( ['AddMedia.firefogg','mw.FirefoggRender'],function(){ |
32 | 26 | var foggRender = $j('#videoClipBegin').firefoggRender({ |
33 | 27 | 'statusTarget': '#targetFoggStatus' |
34 | 28 | }); |
35 | | - foggRender.doRender(); |
36 | | - |
37 | | - $j('#renderToFile').text('Stop Render').click(function(){ |
38 | | - foggRender.stopRender(); |
39 | | - }); |
| 29 | + if( foggRender.doRender() ){ |
| 30 | + $j('#renderToFile').text('Stop Render').click(function(){ |
| 31 | + foggRender.stopRender(); |
| 32 | + }); |
| 33 | + } |
40 | 34 | }) |
41 | 35 | return false; |
42 | 36 | }); |
— | — | @@ -52,7 +46,7 @@ |
53 | 47 | <p></p>seek to <input id="seekInputTime" size="4" value = "6"></input><span id="seekInProgress" style="display: none"> Seeking<blink>...</blink></span> |
54 | 48 | <br/> |
55 | 49 | <a id="startBuffer" href="#">Start buffering</a> <br> |
56 | | -<a id="renderToFile" href="#">Render to file</a> |
| 50 | +<a id="renderToFile" href="#">Render to file</a> <span id="targetFoggStatus"></span> |
57 | 51 | </td> |
58 | 52 | <td valign="top"> |
59 | 53 | Sample playlist code: |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoClipBeginSmil.xml |
— | — | @@ -14,14 +14,14 @@ |
15 | 15 | <seq> |
16 | 16 | |
17 | 17 | <video src="http://upload.wikimedia.org/wikipedia/commons/9/94/Folgers.ogv" |
18 | | - dur="2s" |
19 | | - clipBegin = "16s" |
20 | | - /> |
| 18 | + dur="5s" |
| 19 | + clipBegin = "17s" |
| 20 | + /> |
21 | 21 | |
22 | 22 | <video src="http://upload.wikimedia.org/wikipedia/commons/1/14/Independence_Day%2C_1940_Promotion.ogv" |
23 | | - dur="5s" |
| 23 | + dur="1s" |
24 | 24 | /> |
25 | | - |
| 25 | + |
26 | 26 | <video src="http://upload.wikimedia.org/wikipedia/commons/1/14/Independence_Day%2C_1940_Promotion.ogv" |
27 | 27 | transIn="fromBlack" |
28 | 28 | dur="2s" |
— | — | @@ -34,17 +34,16 @@ |
35 | 35 | /> |
36 | 36 | |
37 | 37 | <video src="http://upload.wikimedia.org/wikipedia/commons/1/14/Independence_Day%2C_1940_Promotion.ogv" |
38 | | - dur="5" |
| 38 | + dur="2" |
39 | 39 | clipBegin = "18" |
40 | 40 | /> |
41 | 41 | |
42 | | - <!-- where does quality come from |
43 | 42 | <video src="http://upload.wikimedia.org/wikipedia/commons/8/8b/Yochai_Benkler_-_On_Autonomy%2C_Control_and_Cultural_Experience.ogg" |
44 | 43 | transIn="fromBlack" |
45 | | - dur="27" |
| 44 | + dur="10" |
46 | 45 | clipBegin = "0:3:43" |
47 | | - /> |
48 | | - --> |
| 46 | + /> |
| 47 | + |
49 | 48 | </seq> |
50 | 49 | |
51 | 50 | </body> |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js |
— | — | @@ -99,7 +99,7 @@ |
100 | 100 | // If no render target exist create one: |
101 | 101 | $j( this ).html( |
102 | 102 | $j( '<div />') |
103 | | - .attr('id', 'smilCanvas_' + this.id ) |
| 103 | + .attr( 'id', 'smilCanvas_' + this.id ) |
104 | 104 | .css( { |
105 | 105 | 'width' : '100%', |
106 | 106 | 'height' : '100%', |
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.FirefoggRender.js |
— | — | @@ -87,7 +87,10 @@ |
88 | 88 | // Start rendering |
89 | 89 | doRender: function() { |
90 | 90 | var _this = this; |
91 | | - |
| 91 | + // Make sure we get a target destination |
| 92 | + if( !_this.fogg.saveVideoAs() ){ |
| 93 | + return false; |
| 94 | + } |
92 | 95 | // Set the render time to "startTime" of the render request |
93 | 96 | this.renderTime = this.startTime; |
94 | 97 | |
— | — | @@ -118,12 +121,10 @@ |
119 | 122 | |
120 | 123 | // Update previusAudioTime |
121 | 124 | previusAudioTime = currentAudio.startTime + currentAudio.duration; |
122 | | - } |
123 | | - |
124 | | - // Now issue the save video as call |
125 | | - _this.fogg.saveVideoAs(); |
126 | | - |
127 | | - _this.doNextFrame(); |
| 125 | + } |
| 126 | + // Now issue the save video as call |
| 127 | + _this.doNextFrame(); |
| 128 | + return true; |
128 | 129 | }, |
129 | 130 | |
130 | 131 | /** |