Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBuffer.js |
— | — | @@ -21,6 +21,7 @@ |
22 | 22 | |
23 | 23 | // Get active body elements |
24 | 24 | //this.smil.getBody().getElementsForTime( time ); |
| 25 | + |
25 | 26 | // Check load status per temporal offset |
26 | 27 | |
27 | 28 | // setTimeout to call self until buffer is ready |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js |
— | — | @@ -74,7 +74,7 @@ |
75 | 75 | |
76 | 76 | // Transform the elements per animate engine |
77 | 77 | _this.smil.getAnimate().animateTransform( smilElement, relativeTime, deltaTime ); |
78 | | - }, |
| 78 | + }, |
79 | 79 | /* SMIL Element out of range */ |
80 | 80 | function( smilElement ){ |
81 | 81 | // Hide the element in the layout |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js |
— | — | @@ -56,7 +56,8 @@ |
57 | 57 | }); |
58 | 58 | |
59 | 59 | // Update the root layout css |
60 | | - this.$rootLayout.css( _this.getRootLayoutCss() ) |
| 60 | + this.$rootLayout.css( _this.getRootLayoutCss() ); |
| 61 | + |
61 | 62 | // Update the root layout html |
62 | 63 | this.$rootLayout.html( _this.getRootLayoutHtml() ); |
63 | 64 | } |
— | — | @@ -124,7 +125,7 @@ |
125 | 126 | * Get the transformed smil element in html format |
126 | 127 | * @param |
127 | 128 | */ |
128 | | - getSmilElementHtml: function ( smilElement ) { |
| 129 | + getSmilElementHtml: function( smilElement ) { |
129 | 130 | var smilType = this.smil.getRefType( smilElement ) |
130 | 131 | switch( smilType ){ |
131 | 132 | // Not part of strict smil, but saves time being able have an "html" display mode |
— | — | @@ -159,14 +160,14 @@ |
160 | 161 | */ |
161 | 162 | getSmilVideoHtml: function( videoElement ){ |
162 | 163 | return $j('<video />') |
163 | | - .attr( { |
164 | | - 'id' : this.smil.getAssetId( videoElement ), |
165 | | - 'src' : this.smil.getAssetUrl( $j( videoElement ).attr( 'src' ) ) |
166 | | - } ) |
167 | | - .css( { |
168 | | - 'width': '100%', |
169 | | - 'height' : '100%' |
170 | | - }) |
| 164 | + .attr( { |
| 165 | + 'id' : this.smil.getAssetId( videoElement ), |
| 166 | + 'src' : this.smil.getAssetUrl( $j( videoElement ).attr( 'src' ) ) |
| 167 | + } ) |
| 168 | + .css( { |
| 169 | + 'width': '100%', |
| 170 | + 'height' : '100%' |
| 171 | + } ) |
171 | 172 | }, |
172 | 173 | |
173 | 174 | /** |
— | — | @@ -174,7 +175,7 @@ |
175 | 176 | * XXX Security XXX |
176 | 177 | * Here we are parsing in SMIL -> HTML should be careful about XSS or script elevation |
177 | 178 | * |
178 | | - * @@TODO check if this is "local" only smil and enforce domain on all asset sources |
| 179 | + * @@TODO check all sources are "local" only smil and enforce domain on all asset sources |
179 | 180 | */ |
180 | 181 | getSmilCDATAHtml: function( smilElement ){ |
181 | 182 | // Get "clean" smil data |
— | — | @@ -195,7 +196,7 @@ |
196 | 197 | .attr( 'id' , this.smil.getAssetId( smilElement ) ) |
197 | 198 | // Wrap in font-size percentage relative to virtual size |
198 | 199 | .css( 'font-size', ( ( this.targetWidth / this.virtualWidth )*100 ) + '%' ) |
199 | | - .append( |
| 200 | + .append( |
200 | 201 | // We pass the xmlCdata via jQuery fragment creation, this runs jquery.clean() |
201 | 202 | // and filters the result html. |
202 | 203 | $j( xmlCdata ) |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js |
— | — | @@ -1,4 +1,3 @@ |
2 | | - |
3 | 2 | /** |
4 | 3 | * Handles the smil animate class |
5 | 4 | */ |
— | — | @@ -88,7 +87,9 @@ |
89 | 88 | } |
90 | 89 | } |
91 | 90 | } |
| 91 | + if( |
92 | 92 | |
| 93 | + |
93 | 94 | // Check if we need to do a smilText clear: |
94 | 95 | if( nodeName.toLowerCase() == 'smiltext' ){ |
95 | 96 | var el = $j( smilElement ).get(0); |
— | — | @@ -104,8 +105,7 @@ |
105 | 106 | } |
106 | 107 | } |
107 | 108 | } |
108 | | - //mw.log( 'checkForTransformUpdate::' + nodeName +' ' + animateTime ); |
109 | | - |
| 109 | + //mw.log( 'checkForTransformUpdate::' + nodeName +' ' + animateTime ); |
110 | 110 | return false; |
111 | 111 | }, |
112 | 112 | |
— | — | @@ -119,8 +119,6 @@ |
120 | 120 | transformElement: function( smilElement, animateTime ) { |
121 | 121 | var nodeName = $j( smilElement ).get(0).nodeName ; |
122 | 122 | |
123 | | - |
124 | | - |
125 | 123 | //mw.log("transformForTime: " + nodeName + ' t:' + animateTime ); |
126 | 124 | switch( nodeName.toLowerCase() ){ |
127 | 125 | case 'smiltext': |
— | — | @@ -128,10 +126,13 @@ |
129 | 127 | break; |
130 | 128 | case 'img': |
131 | 129 | return this.transformImageForTime( smilElement, animateTime); |
132 | | - break; |
| 130 | + break; |
133 | 131 | } |
134 | 132 | }, |
135 | 133 | |
| 134 | + /** |
| 135 | + * transformTextForTime |
| 136 | + */ |
136 | 137 | transformTextForTime: function( textElement, animateTime ) { |
137 | 138 | //mw.log("transformTextForTime:: " + animateTime ); |
138 | 139 | |
— | — | @@ -193,15 +194,20 @@ |
194 | 195 | $j( animateElement ).attr( 'attributeName' ) ); |
195 | 196 | } |
196 | 197 | }); |
197 | | - // No animate elements in range, make sure we transform to previus or to initial state if time is zero |
| 198 | + // No animate elements in range, make sure we transform to previous or to initial state if time is zero |
198 | 199 | if( !animateInRange ) { |
199 | 200 | if( animateTime == 0 ) { |
200 | | - // just a hack for now ( should read from previus animation or from source attribute |
| 201 | + // just a hack for now ( should read from previous animation or from source attribute |
201 | 202 | //this.updateElementLayout( smilImgElement, { 'top':1,'left':1,'width':1, 'height':1 } ); |
202 | 203 | var $target = $j( '#' + this.smil.getAssetId( smilImgElement )); |
203 | | - $target.css({ 'top':'0px','left':'0px','width':'100%', 'height':'100%' } ); |
| 204 | + $target.css( { |
| 205 | + 'top' : '0px', |
| 206 | + 'left' :'0px', |
| 207 | + 'width' : '100%', |
| 208 | + 'height' : '100%' |
| 209 | + } ); |
204 | 210 | } |
205 | | - // xxx should check for transform to previus |
| 211 | + // xxx should check for transform to previous |
206 | 212 | } |
207 | 213 | }, |
208 | 214 | |
— | — | @@ -238,8 +244,6 @@ |
239 | 245 | * Get the css layout transforms for a panzoom transform type |
240 | 246 | * |
241 | 247 | * http://www.w3.org/TR/SMIL/smil-extended-media-object.html#q32 |
242 | | - * |
243 | | - * |
244 | 248 | */ |
245 | 249 | transformPanZoom: function( smilImgElement, animateElement, animateTime ){ |
246 | 250 | var begin = this.smil.parseTime( $j( animateElement ).attr( 'begin') ); |
— | — | @@ -295,7 +299,7 @@ |
296 | 300 | |
297 | 301 | var htmlAsset = $j( '#' + this.smil.getAssetId( smilElement ) ).get(0); |
298 | 302 | |
299 | | - // xxx best way may be to use canvaus and fitting system. |
| 303 | + // xxx best way may be to use canvaus and a fitting system. |
300 | 304 | |
301 | 305 | // Setup target height width based target region size |
302 | 306 | var fullWidth = $target.parents('.smilRegion').width() ; |
— | — | @@ -367,6 +371,5 @@ |
368 | 372 | targetValue[ i ] += ( startPointSet[i].indexOf('%') != -1 ) ? '%' : ''; |
369 | 373 | } |
370 | 374 | return targetValue; |
371 | | - } |
372 | | - |
| 375 | + } |
373 | 376 | } |
\ No newline at end of file |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoTransitionSmil.xml |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | </head> |
25 | 25 | <body> |
26 | 26 | <seq> |
27 | | - <ref type="text/html" dur="8" uri="Template:My_Video_Intro_Text"><![CDATA[ |
| 27 | + <ref type="text/html" dur="4" uri="Template:My_Video_Intro_Text"><![CDATA[ |
28 | 28 | <h3> <span class="mw-headline" id="cat">cat</span></h3> |
29 | 29 | <div class="thumb tright"><div class="thumbinner" style="width:102px;"><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/dc/Nos_kota.jpg/120px-Nos_kota.jpg"></div></div> |
30 | 30 | <div style="color:gray"> MY Date: 21 January, 2010 00:45</div> |