Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js |
— | — | @@ -11,11 +11,18 @@ |
12 | 12 | // Used to store elements for getElementsForTime method |
13 | 13 | elementsInRange: [], |
14 | 14 | |
| 15 | + // Used to store elements out of range for getElementsForTime method |
| 16 | + elementsOutOfRange: [], |
| 17 | + |
15 | 18 | // Index of auto assigned ids |
16 | 19 | idIndex : 0, |
17 | 20 | |
| 21 | + // Cache of ids of previous list of active elements |
| 22 | + // This lets us cache a valid element list for a given amount of time |
| 23 | + cacheElementList: {}, |
| 24 | + |
18 | 25 | // Constructor: |
19 | | - init: function( smilObject ){ |
| 26 | + init: function( smilObject ){ |
20 | 27 | this.smil = smilObject; |
21 | 28 | this.$dom = this.smil.getDom().find( 'body' ); |
22 | 29 | |
— | — | @@ -54,42 +61,55 @@ |
55 | 62 | */ |
56 | 63 | renderTime: function( time, deltaTime ){ |
57 | 64 | var _this = this; |
| 65 | + |
58 | 66 | // Get all the draw elements from the body this time: |
59 | | - var elementList = this.getElementsForTime( time ); |
60 | | - //mw.log("SmilBody::renderTime: draw " + elementList.length + " elementList" ); |
61 | | - |
62 | | - $j.each( elementList , function( inx, smilElement ) { |
63 | | - // xxx need to |
64 | | - // var relativeTime = time - smilElement.parentTimeOffset; |
65 | | - var relativeTime = time - $j( smilElement ).data ( 'parentStartOffset' ); |
66 | | - |
67 | | - // Render the active elements using the layout engine |
68 | | - _this.smil.getLayout().drawElement( smilElement, relativeTime ); |
69 | | - |
70 | | - // Transform the elements per animate engine |
71 | | - _this.smil.getAnimate().animateTransform( smilElement, relativeTime, deltaTime ); |
72 | | - } ); |
| 67 | + var elementList = this.getElementsForTime( time , |
| 68 | + /* SMIL Element in Range */ |
| 69 | + function( smilElement) { |
| 70 | + // var relativeTime = time - smilElement.parentTimeOffset; |
| 71 | + var relativeTime = time - $j( smilElement ).data ( 'parentStartOffset' ); |
| 72 | + |
| 73 | + // Render the active elements using the layout engine |
| 74 | + _this.smil.getLayout().drawElement( smilElement ); |
| 75 | + |
| 76 | + // Transform the elements per animate engine |
| 77 | + _this.smil.getAnimate().animateTransform( smilElement, relativeTime, deltaTime ); |
| 78 | + }, |
| 79 | + /* SMIL Element out of range */ |
| 80 | + function( smilElement ){ |
| 81 | + // Hide the element in the layout |
| 82 | + _this.smil.getLayout().hideElement( smilElement ); |
| 83 | + } |
| 84 | + ); |
73 | 85 | }, |
74 | 86 | |
75 | 87 | /** |
| 88 | + * Check if we have a valid element cache: |
| 89 | + * XXX not yet working. |
| 90 | + */ |
| 91 | + isValidElementCache: function( time ){ |
| 92 | + if( time > this.cacheElementList.validStart && time > this.cacheElementList.validEnd ) { |
| 93 | + return this.cacheElementList.elements; |
| 94 | + } |
| 95 | + }, |
| 96 | + |
| 97 | + /** |
76 | 98 | * Gets all the elements for a given time. |
77 | 99 | */ |
78 | | - getElementsForTime: function ( time ) { |
| 100 | + getElementsForTime: function ( time , inRangeCallback, outOfRangeCallback ) { |
79 | 101 | var startOffset = 0; |
80 | 102 | if( !time ) { |
81 | 103 | time =0; |
82 | | - } |
83 | | - // Empty out the requested element set: |
84 | | - this.elementsInRange = []; |
85 | | - this.getElementsForTimeRecurse( this.$dom, time, startOffset); |
86 | | - return this.elementsInRange; |
| 104 | + } |
| 105 | + // Empty out the requested element set: |
| 106 | + this.getElementsForTimeRecurse( this.$dom, time, startOffset, inRangeCallback, outOfRangeCallback); |
87 | 107 | }, |
88 | 108 | |
89 | 109 | /** |
90 | 110 | * getElementsForTimeRecurse |
91 | 111 | * @param {Object} $node Node to recursively search for elements in the given time range |
92 | 112 | */ |
93 | | - getElementsForTimeRecurse: function( $node, time, startOffset){ |
| 113 | + getElementsForTimeRecurse: function( $node, time, startOffset, inRangeCallback, outOfRangeCallback){ |
94 | 114 | // Setup local pointers: |
95 | 115 | var nodeDuration = this.getNodeDuration( $node ); |
96 | 116 | var nodeType = this.getNodeSmilType( $node ); |
— | — | @@ -100,51 +120,45 @@ |
101 | 121 | if( !startOffset ) { |
102 | 122 | startOffset = 0; |
103 | 123 | } |
104 | | - |
105 | | - /*mw.log( "getElementsForTimeRecurse::" + |
106 | | - ' time: ' + time + |
107 | | - ' nodeName: ' + $j( $node ).get(0).nodeName + |
108 | | - ' nodeType: ' + nodeType + |
109 | | - ' nodeDur: ' + nodeDuration + |
110 | | - ' offset: ' + startOffset |
111 | | - );*/ |
112 | | - |
113 | | - // If startOffset is > time skip node and all its children |
114 | | - if( startOffset > time ){ |
115 | | - mw.log(" Reached end, startOffset is:" + startOffset + ' > ' + time ); |
116 | | - return ; |
117 | | - } |
118 | | - |
119 | | - // Means we need to seek ahead |
120 | | - /*if( startOffset < time ){ |
121 | | - mw.log( "Seek ahead: startOffset is: " + startOffset + ' < ' + time ); |
122 | | - return ; |
123 | | - }*/ |
124 | | - |
| 124 | + |
| 125 | + |
125 | 126 | // If 'par' or 'seq' recurse to get elements for layout |
126 | | - if( nodeType == 'par'|| nodeType == 'seq' ) { |
| 127 | + if( nodeType == 'par' || nodeType == 'seq' ) { |
127 | 128 | if( $node.children().length ) { |
128 | 129 | $node.children().each( function( inx, childNode ){ |
129 | | - //mw.log(" recurse:: startOffset:" + nodeType + ' start offset:' + startOffset ); |
130 | | - var childDur = _this.getElementsForTimeRecurse( $j( childNode ), time, startOffset); |
131 | | - // If element parent is a 'seq' increment startOffset: |
| 130 | + // mw.log(" recurse:: startOffset:" + nodeType + ' start offset:' + startOffset ); |
| 131 | + var childDur = _this.getElementsForTimeRecurse( |
| 132 | + $j( childNode ), |
| 133 | + time, |
| 134 | + startOffset, |
| 135 | + inRangeCallback, |
| 136 | + outOfRangeCallback |
| 137 | + ); |
| 138 | + // If element parent is a 'seq' increment startOffset as we recurse for each child |
132 | 139 | if( nodeType == 'seq' ) { |
133 | 140 | //mw.log(" Parent Seq:: add child dur: " + childDur ); |
134 | 141 | startOffset += childDur; |
135 | | - } |
| 142 | + } |
136 | 143 | }); |
137 | 144 | } |
138 | | - } |
| 145 | + } |
139 | 146 | |
140 | | - // If the nodeType is "ref" add to this.elementsInRange array |
| 147 | + // If the nodeType is "ref" or smilText run the callback |
141 | 148 | if( nodeType == 'ref' || nodeType == 'smilText' ) { |
142 | 149 | // Add the parent startOffset |
143 | | - $node.data( 'parentStartOffset', startOffset ); |
144 | | - // Ref type get the |
145 | | - this.elementsInRange.push( $node ); |
146 | | - //mw.log("Add ref to elementsInRange:: " + nodeType + " length:" + this.elementsInRange.length); |
147 | | - } |
148 | | - |
| 150 | + $node.data( 'parentStartOffset', startOffset ); |
| 151 | + |
| 152 | + // Check if element is in range: |
| 153 | + if( time >= startOffset && time <= ( startOffset + nodeDuration) ){ |
| 154 | + if( inRangeCallback ){ |
| 155 | + inRangeCallback( $node ); |
| 156 | + } |
| 157 | + } else { |
| 158 | + if( outOfRangeCallback ){ |
| 159 | + outOfRangeCallback( $node ); |
| 160 | + } |
| 161 | + } |
| 162 | + } |
149 | 163 | // Return the node Duration for tracking startOffset |
150 | 164 | return this.getNodeDuration( $node ); |
151 | 165 | }, |
— | — | @@ -170,6 +184,7 @@ |
171 | 185 | ) { |
172 | 186 | return $node.data('computedDuration'); |
173 | 187 | } |
| 188 | + |
174 | 189 | var _this = this; |
175 | 190 | var duration = 0; |
176 | 191 | |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js |
— | — | @@ -64,21 +64,27 @@ |
65 | 65 | }, |
66 | 66 | |
67 | 67 | /** |
68 | | - * RenderElement smilElement at a given time. |
69 | | - * If the element does not exist in the html dom add it. |
70 | | - * Updates a given element for the requested time |
| 68 | + * Draw a smilElement to the layout. |
| 69 | + * |
| 70 | + * If the element does not exist in the html dom add it. |
71 | 71 | */ |
72 | | - drawElement: function( smilElement, time ) { |
| 72 | + drawElement: function( smilElement ) { |
73 | 73 | var _this = this; |
74 | | - var nodeName = $j( smilElement ).get(0).nodeName ; |
75 | | - |
| 74 | + // Check for quick "show" path: |
| 75 | + var $targetElement = this.$rootLayout.find( '#' + this.smil.getAssetId( smilElement ) ) |
| 76 | + if( $targetElement.length ){ |
| 77 | + $targetElement.show(); |
| 78 | + } |
| 79 | + |
| 80 | + // Else draw the node into the regionTarget |
| 81 | + |
76 | 82 | //mw.log( "SmilLayout::drawElement: " + nodeName + '.' + $j( smilElement ).attr('id' ) + ' into ' + regionId ); |
77 | 83 | var regionId = $j( smilElement ).attr( 'region'); |
78 | 84 | if( regionId ){ |
79 | 85 | var $regionTarget = this.$rootLayout.find( '#' + regionId ); |
80 | 86 | // Check for region target in $rootLayout |
81 | 87 | if( $regionTarget.length == 0 ) { |
82 | | - mw.log( "Error in SmilLayout::renderElement, Could not find region:" + regionId + " for " + nodeName); |
| 88 | + mw.log( "Error in SmilLayout::renderElement, Could not find region:" + regionId ); |
83 | 89 | return ; |
84 | 90 | } |
85 | 91 | } else { |
— | — | @@ -87,53 +93,90 @@ |
88 | 94 | } |
89 | 95 | |
90 | 96 | // Check that the element is already in the dom |
91 | | - if( $regionTarget.find( '#' + this.smil.getAssetId( smilElement ) ).length == 0 ){ |
| 97 | + var $targetElement = $regionTarget.find( '#' + this.smil.getAssetId( smilElement ) ); |
| 98 | + if( $targetElement.length == 0 ){ |
| 99 | + mw.log(" drawElement:: " + this.smil.getAssetId( smilElement ) ); |
92 | 100 | // Append the Smil to the target region |
93 | | - $regionTarget.append( this.getSmilElementHtml( smilElement ) ) |
| 101 | + $regionTarget.append( |
| 102 | + _this.getSmilElementHtml( smilElement ) |
| 103 | + ) |
| 104 | + } else { |
| 105 | + // Make sure the element is visable ( may be faster to just call show directly) |
| 106 | + if( $targetElement.is(':hidden') ) { |
| 107 | + $targetElement.show(); |
| 108 | + } |
94 | 109 | } |
95 | 110 | }, |
96 | 111 | |
97 | 112 | /** |
| 113 | + * Hide a smilElement in the layout |
| 114 | + */ |
| 115 | + hideElement: function( smilElement ){ |
| 116 | + // Check that the element is already in the dom |
| 117 | + var $targetElement = this.$rootLayout.find( '#' + this.smil.getAssetId( smilElement ) ); |
| 118 | + if( $targetElement.length ){ |
| 119 | + // Issue a quick hide request |
| 120 | + $targetElement.hide(); |
| 121 | + } |
| 122 | + }, |
| 123 | + |
| 124 | + /** |
98 | 125 | * Get the transformed smil element in html format |
99 | 126 | * @param |
100 | 127 | */ |
101 | | - getSmilElementHtml: function ( smilElement, time ) { |
102 | | - var nodeName = $j( smilElement ).get(0).nodeName ; |
103 | | - mw.log("Get Smil Element Html: " + nodeName ); |
104 | | - |
105 | | - var smilType = this.smil.getRefType( smilElement ) |
106 | | - |
| 128 | + getSmilElementHtml: function ( smilElement ) { |
| 129 | + var smilType = this.smil.getRefType( smilElement ) |
107 | 130 | switch( smilType ){ |
108 | 131 | // Not part of strict smil, but saves time being able have an "html" display mode |
109 | 132 | case 'cdata_html': |
110 | | - return this.getSmilCDATAHtml( smilElement, time ); |
| 133 | + return this.getSmilCDATAHtml( smilElement ); |
111 | 134 | break; |
| 135 | + case 'video': |
| 136 | + return this.getSmilVideoHtml( smilElement ); |
| 137 | + break; |
112 | 138 | // Smil Text: http://www.w3.org/TR/SMIL/smil-text.html (obviously we support a subset ) |
113 | 139 | case 'smiltext': |
114 | | - return this.getSmilTextHtml( smilElement, time); |
| 140 | + return this.getSmilTextHtml( smilElement ); |
115 | 141 | break; |
116 | 142 | case 'img': |
117 | | - return this.getSmilImgHtml( smilElement, time); |
| 143 | + return this.getSmilImgHtml( smilElement ); |
118 | 144 | break; |
119 | 145 | } |
120 | 146 | mw.log( "Error: Could not find smil layout transform for element type: " + |
121 | | - nodeName + ' of type ' + $j( smilElement ).attr( 'type' ) ); |
| 147 | + smilType + ' of type ' + $j( smilElement ).attr( 'type' ) ); |
| 148 | + |
122 | 149 | return $j('<span />') |
| 150 | + .attr( 'id' , this.smil.getAssetId( smilElement ) ) |
123 | 151 | .css( { |
124 | 152 | 'position' : 'absolute', |
125 | 153 | 'zindex' : 9999 // xxx need to clean up z-index system |
126 | 154 | }) |
127 | | - .text( 'Error: unknown type:' + nodeName ); |
| 155 | + .text( 'Error: unknown type:' + smilType ); |
128 | 156 | }, |
129 | 157 | |
130 | 158 | /** |
| 159 | + * Return the video |
| 160 | + */ |
| 161 | + getSmilVideoHtml: function( videoElement ){ |
| 162 | + 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 | + }) |
| 171 | + }, |
| 172 | + |
| 173 | + /** |
131 | 174 | * Get Smil CDATA ( passed through jQuery .clean as part of fragment creation ) |
132 | | - * XXX Sequrity XXX |
| 175 | + * XXX Security XXX |
133 | 176 | * Here we are parsing in SMIL -> HTML should be careful about XSS or script elevation |
134 | 177 | * |
135 | 178 | * @@TODO check if this is "local" only smil and enforce domain on all asset sources |
136 | 179 | */ |
137 | | - getSmilCDATAHtml: function( smilElement, time ){ |
| 180 | + getSmilCDATAHtml: function( smilElement ){ |
138 | 181 | // Get "clean" smil data |
139 | 182 | var el = $j( smilElement ).get(0); |
140 | 183 | var xmlCdata = ''; |
— | — | @@ -144,24 +187,27 @@ |
145 | 188 | xmlCdata += node.nodeValue; |
146 | 189 | } |
147 | 190 | } |
| 191 | + |
| 192 | + var textCss = this.transformSmilCss( smilElement ); |
| 193 | + |
148 | 194 | // Return the cdata |
149 | 195 | return $j('<div />') |
150 | | - .attr( 'id' , this.smil.getAssetId( textElement ) ) |
| 196 | + .attr( 'id' , this.smil.getAssetId( smilElement ) ) |
151 | 197 | // Wrap in font-size percentage relative to virtual size |
152 | 198 | .css( 'font-size', ( ( this.targetWidth / this.virtualWidth )*100 ) + '%' ) |
153 | 199 | .append( |
154 | | - // We pass the xmlCdata via jQuery fragment creation to |
155 | | - // filter the result of "non-clean" html. |
156 | | - $j( xmlCdata ) |
| 200 | + // We pass the xmlCdata via jQuery fragment creation, this runs jquery.clean() |
| 201 | + // and filters the result html. |
| 202 | + $j( xmlCdata ) |
| 203 | + .css( textCss ) |
157 | 204 | ); |
158 | 205 | |
159 | 206 | }, |
160 | 207 | |
161 | 208 | /** |
162 | | - * Get a text element per given time |
163 | | - * xxx we need to use "relativeTime" |
| 209 | + * Get a text element html |
164 | 210 | */ |
165 | | - getSmilTextHtml: function( textElement, relativeTime ) { |
| 211 | + getSmilTextHtml: function( textElement ) { |
166 | 212 | var _this = this; |
167 | 213 | |
168 | 214 | // Empty initial text value |
— | — | @@ -174,29 +220,7 @@ |
175 | 221 | textValue = $j( textElement ).text(); |
176 | 222 | } |
177 | 223 | |
178 | | - var textCss = _this.transformSmilCss( textElement ); |
179 | | - |
180 | | - // Make the font size fixed so it can be scaled |
181 | | - // based on: http://style.cleverchimp.com/font_size_intervals/altintervals.html |
182 | | - var sizeMap = { |
183 | | - 'xx-small' : '.57em', |
184 | | - 'x-small' : '.69em', |
185 | | - 'small' : '.83em', |
186 | | - 'medium' : '1em', |
187 | | - 'large' : '1.2em', |
188 | | - 'x-large' : '1.43em', |
189 | | - 'xx-large' : '1.72em' |
190 | | - } |
191 | | - if( sizeMap[ textCss['font-size'] ] ){ |
192 | | - textCss['font-size'] = sizeMap[ textCss['font-size'] ]; |
193 | | - } |
194 | | - |
195 | | - // If the font size is pixel based parent span will have no effect, |
196 | | - // directly resize the pixels |
197 | | - if( textCss['font-size'] && textCss['font-size'].indexOf('px') != -1 ){ |
198 | | - textCss['font-size'] = ( parseFloat( textCss['font-size'] ) |
199 | | - * ( this.targetWidth / this.virtualWidth ) ) + 'px'; |
200 | | - } |
| 224 | + var textCss = _this.transformSmilCss( textElement ); |
201 | 225 | |
202 | 226 | // Return the htmlElement |
203 | 227 | return $j('<span />') |
— | — | @@ -216,24 +240,9 @@ |
217 | 241 | * Get Image html per given smil element and requested time |
218 | 242 | * @param {element} imgElement The image tag element to be updated |
219 | 243 | */ |
220 | | - getSmilImgHtml: function( imgElement, relativeTime ) { |
| 244 | + getSmilImgHtml: function( imgElement ) { |
221 | 245 | // Check if we have child transforms and select the transform that is in range |
222 | | - var panZoom = null; |
223 | | - if( $j( imgElement ).children().length ){ |
224 | | - $j( imgElement ).children().each(function(inx, childNode ){ |
225 | | - if( childNode.nodeName == 'animate' ){ |
226 | | - // add begin / duration to animation bucket ( computed value ) |
227 | | - |
228 | | - // get panZoom value |
229 | | - } |
230 | | - }) |
231 | | - // calculate animation position |
232 | | - } else { |
233 | | - // Set pan zoom from imgElement ( if set ) |
234 | | - if( $j( imgElement ).attr('panZoom') ){ |
235 | | - panZoom = this.parsePanZoom( $j( imgElement ).attr('panZoom') ); |
236 | | - } |
237 | | - } |
| 246 | + var panZoom = null; |
238 | 247 | mw.log( "Add image:" + this.smil.getAssetUrl( $j( imgElement ).attr( 'src' ) ) ); |
239 | 248 | // XXX get context of smil document for relative or absolute paths: |
240 | 249 | return $j('<img />') |
— | — | @@ -430,6 +439,30 @@ |
431 | 440 | cssAttributes[ smilAttributeToCss[ attr.nodeName ]] = attr.nodeValue; |
432 | 441 | } |
433 | 442 | } |
| 443 | + |
| 444 | + // Make the font size fixed so it can be scaled |
| 445 | + // based on: http://style.cleverchimp.com/font_size_intervals/altintervals.html |
| 446 | + var sizeMap = { |
| 447 | + 'xx-small' : '.57em', |
| 448 | + 'x-small' : '.69em', |
| 449 | + 'small' : '.83em', |
| 450 | + 'medium' : '1em', |
| 451 | + 'large' : '1.2em', |
| 452 | + 'x-large' : '1.43em', |
| 453 | + 'xx-large' : '1.72em' |
| 454 | + } |
| 455 | + if( sizeMap[ cssAttributes['font-size'] ] ){ |
| 456 | + cssAttributes['font-size'] = cssAttributes[ textCss['font-size'] ]; |
| 457 | + } |
| 458 | + |
| 459 | + // If the font size is pixel based parent span will have no effect, |
| 460 | + // directly resize the pixels |
| 461 | + if( cssAttributes['font-size'] && cssAttributes['font-size'].indexOf('px') != -1 ){ |
| 462 | + cssAttributes['font-size'] = ( parseFloat( cssAttributes['font-size'] ) |
| 463 | + * ( this.targetWidth / this.virtualWidth ) ) + 'px'; |
| 464 | + } |
| 465 | + |
| 466 | + |
434 | 467 | // Translate rootLayout properties into div |
435 | 468 | return cssAttributes; |
436 | 469 | } |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js |
— | — | @@ -46,28 +46,28 @@ |
47 | 47 | var animateTimeDelta = 0; |
48 | 48 | |
49 | 49 | this.animateInterval[ this.smil.getAssetId( smilElement ) ] = |
50 | | - setInterval( |
51 | | - function(){ |
52 | | - var timeElapsed = new Date().getTime() - animationStartTime; |
53 | | - // Set the animate Time delta |
54 | | - animateTimeDelta += _this.callbackRate; |
55 | | - |
56 | | - if( animateTimeDelta > deltaTime || timeElapsed > deltaTime ){ |
57 | | - // Stop animating: |
58 | | - clearInterval( _this.animateInterval[ _this.smil.getAssetId( smilElement ) ] ); |
59 | | - return ; |
60 | | - } |
61 | | - |
62 | | - if( Math.abs( timeElapsed - animateTimeDelta ) > 100 ){ |
63 | | - mw.log( "Error more than 100ms lag within animateTransform loop: te:" + timeElapsed + |
64 | | - ' td:' + animateTimeDelta + ' diff: ' + Math.abs( timeElapsed - animateTimeDelta ) ); |
65 | | - } |
66 | | - |
67 | | - // Do the transform request: |
68 | | - _this.transformElement( smilElement, animateTime + ( animateTimeDelta/1000 ) ); |
69 | | - }, |
70 | | - this.callbackRate |
71 | | - ); |
| 50 | + setInterval( |
| 51 | + function(){ |
| 52 | + var timeElapsed = new Date().getTime() - animationStartTime; |
| 53 | + // Set the animate Time delta |
| 54 | + animateTimeDelta += _this.callbackRate; |
| 55 | + |
| 56 | + if( animateTimeDelta > deltaTime || timeElapsed > deltaTime ){ |
| 57 | + // Stop animating: |
| 58 | + clearInterval( _this.animateInterval[ _this.smil.getAssetId( smilElement ) ] ); |
| 59 | + return ; |
| 60 | + } |
| 61 | + |
| 62 | + if( Math.abs( timeElapsed - animateTimeDelta ) > 100 ){ |
| 63 | + mw.log( "Error more than 100ms lag within animateTransform loop: te:" + timeElapsed + |
| 64 | + ' td:' + animateTimeDelta + ' diff: ' + Math.abs( timeElapsed - animateTimeDelta ) ); |
| 65 | + } |
| 66 | + |
| 67 | + // Do the transform request: |
| 68 | + _this.transformElement( smilElement, animateTime + ( animateTimeDelta/1000 ) ); |
| 69 | + }, |
| 70 | + this.callbackRate |
| 71 | + ); |
72 | 72 | }, |
73 | 73 | |
74 | 74 | /** |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js |
— | — | @@ -222,12 +222,13 @@ |
223 | 223 | var contextUrl = mw.absoluteUrl( this.smilUrl ); |
224 | 224 | return mw.absoluteUrl( assetPath, contextUrl ); |
225 | 225 | }, |
| 226 | + |
226 | 227 | /** |
227 | 228 | * Get the smil resource type based on nodeName and type attribute |
228 | 229 | */ |
229 | | - getRefType: function( |
| 230 | + getRefType: function( smilElement ) { |
230 | 231 | // Get the smil type |
231 | | - var smilType = nodeName.toLowerCase(); |
| 232 | + var smilType = $j( smilElement ).get(0).nodeName.toLowerCase(); |
232 | 233 | if( smilType == 'ref' ){ |
233 | 234 | // If the smilType is ref, check for a content type |
234 | 235 | switch( $j( smilElement ).attr( 'type' ) ) { |
— | — | @@ -241,6 +242,7 @@ |
242 | 243 | break; |
243 | 244 | } |
244 | 245 | } |
| 246 | + return smilType; |
245 | 247 | }, |
246 | 248 | |
247 | 249 | /** |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBuffer.js |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | timeIsBuffered: function( time, callback ) { |
22 | 22 | |
23 | 23 | // Get active body elements |
24 | | - var activeElements = this.smil.getBody().getElementsForTime( time ); |
| 24 | + //this.smil.getBody().getElementsForTime( time ); |
25 | 25 | // Check load status per temporal offset |
26 | 26 | |
27 | 27 | // setTimeout to call self until buffer is ready |
Index: branches/MwEmbedStandAlone/modules/AddMedia/tests/Firefogg_GUI.html |
— | — | @@ -103,7 +103,7 @@ |
104 | 104 | $j( '#fogg-status' ).append( |
105 | 105 | gM('fogg-wont-upload-to-server' ), |
106 | 106 | $j('<br />' ), $j('<br />' ) |
107 | | - ); |
| 107 | + ); |
108 | 108 | |
109 | 109 | for( var i = 0; i < langSupported.length; i++ ){ |
110 | 110 | var urlParts = mw.parseUri( document.URL ); |