Index: branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js |
— | — | @@ -103,7 +103,7 @@ |
104 | 104 | 'position': 'absolute', |
105 | 105 | 'bottom' : '0px', |
106 | 106 | 'left' : '0px', |
107 | | - 'right' : '0px' |
| 107 | + 'right' : '0px' |
108 | 108 | }) |
109 | 109 | .hide() |
110 | 110 | // Make sure the interface is correct height: |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | } else { |
115 | 115 | // Add some space to interface for the control bar ( if not overlaying controls ) |
116 | 116 | embedPlayer.$interface.css( { |
117 | | - 'height' : parseInt( embedPlayer.height ) + parseInt( this.height ) + 2 |
| 117 | + 'height' : parseInt( embedPlayer.height ) + parseInt( this.height ) +2 |
118 | 118 | } ); |
119 | 119 | // update the control bar display to "block" |
120 | 120 | $controlBar.css( 'display', 'block' ); |
— | — | @@ -215,7 +215,8 @@ |
216 | 216 | return { |
217 | 217 | 'height': targetHeight, |
218 | 218 | 'width' : targetWidth, |
219 | | - 'top' : offsetTop |
| 219 | + 'top' : offsetTop, |
| 220 | + 'left': offsetLeft |
220 | 221 | } |
221 | 222 | }, |
222 | 223 | |
— | — | @@ -314,7 +315,7 @@ |
315 | 316 | 'left' : leftOffset, |
316 | 317 | 'width' : $j( window ).width(), |
317 | 318 | 'height' : $j( window ).height(), |
318 | | - 'overlow' : 'hidden' |
| 319 | + 'overlow' : 'hidden' |
319 | 320 | } ) |
320 | 321 | |
321 | 322 | // Set the player height width: |
— | — | @@ -325,7 +326,7 @@ |
326 | 327 | .animate( _this.getFullscreenPlayerCss() ); |
327 | 328 | |
328 | 329 | // Resize the timed text font size per window width |
329 | | - $interface.find( '.itext' ).animate( _this.getFullscreenTextCss() ); |
| 330 | + $interface.find( '.itext' ).css( _this.getFullscreenTextCss() ); |
330 | 331 | |
331 | 332 | // Reposition play-btn-large ( this is unfortunatly not easy to position with 'margin': 'auto' |
332 | 333 | $interface.find('.play-btn-large').animate( _this.getFullscreenPlayButtonCss() ) |
— | — | @@ -434,7 +435,7 @@ |
435 | 436 | } ); |
436 | 437 | |
437 | 438 | // Restore text size: |
438 | | - $interface.find('.itext').animate({ |
| 439 | + $interface.find( '.itext' ).css({ |
439 | 440 | 'font-size' : '100%' |
440 | 441 | }) |
441 | 442 | }, |
— | — | @@ -783,7 +784,7 @@ |
784 | 785 | ); |
785 | 786 | } |
786 | 787 | ) |
787 | | - }, |
| 788 | + }, |
788 | 789 | |
789 | 790 | // Download the file menu |
790 | 791 | 'download': function( ctrlObj ) { |
— | — | @@ -1499,8 +1500,6 @@ |
1500 | 1501 | if ( embedPlayer.userSlide ) { |
1501 | 1502 | embedPlayer.userSlide = false; |
1502 | 1503 | embedPlayer.seeking = true; |
1503 | | - // Stop the monitor timer (if we can) |
1504 | | - embedPlayer.stopMonitor(); |
1505 | 1504 | |
1506 | 1505 | var perc = ui.value / 1000; |
1507 | 1506 | // set seek time (in case we have to do a url seek) |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/loader.js |
— | — | @@ -64,6 +64,8 @@ |
65 | 65 | * |
66 | 66 | * NOTE: this function can be part of setup can run prior to jQuery being ready |
67 | 67 | */ |
| 68 | + |
| 69 | + |
68 | 70 | mw.documentHasPlayerTags = function() { |
69 | 71 | var rewriteTags = mw.getConfig( 'rewritePlayerTags' ); |
70 | 72 | if( rewriteTags ) { |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js |
— | — | @@ -258,35 +258,16 @@ |
259 | 259 | if( ! mw.playerManager ) |
260 | 260 | mw.playerManager = new EmbedPlayerManager(); |
261 | 261 | |
262 | | - //Add the current callback |
263 | | - if( typeof callback == 'function' ) |
| 262 | + //Add the embedPlayer ready callback |
| 263 | + if( typeof callback == 'function' ){ |
264 | 264 | mw.playerManager.addCallback( callback ); |
265 | | - |
266 | | - // IE not working well with jQuery selector on "VIDEO", "AUDIO" etc. |
267 | | - var ie_safe_selector = coma = ''; |
268 | | - if( $j.browser.msie ) { |
269 | | - var selectors = player_select.split(','); |
270 | | - for( var i=0; i < selectors.length; i++ ) { |
271 | | - if( selectors[i] == 'video' || |
272 | | - selectors[i] == 'playlist' || |
273 | | - selectors[i] == 'audio' |
274 | | - ) { |
275 | | - $j( document.getElementsByTagName( selectors[ i ] )).each( function( ) { |
276 | | - mw.playerManager.addElement( this, attributes ); |
277 | | - } ); |
278 | | - }else{ |
279 | | - ie_safe_selector += coma + selectors[i]; |
280 | | - coma = ','; |
281 | | - } |
282 | | - } |
283 | | - player_select = ie_safe_selector; |
284 | 265 | } |
285 | | - if( player_select != '') { |
286 | | - // Add each selected element to the player manager: |
287 | | - $j( player_select ).each( function(na, playerElement) { |
288 | | - mw.playerManager.addElement( playerElement, attributes); |
289 | | - } ); |
290 | | - } |
| 266 | + |
| 267 | + // Add each selected element to the player manager: |
| 268 | + $j( player_select ).each( function(na, playerElement) { |
| 269 | + mw.playerManager.addElement( playerElement, attributes); |
| 270 | + } ); |
| 271 | + |
291 | 272 | // Once we are done adding new players start to check if players are ready: |
292 | 273 | mw.playerManager.waitPlayersReadyCallback(); |
293 | 274 | } |
— | — | @@ -882,30 +863,10 @@ |
883 | 864 | if ( $j( video_element ).attr( "src" ) ) { |
884 | 865 | this.tryAddSource( video_element ); |
885 | 866 | } |
886 | | - |
887 | | - if( ! $j.browser.msie ){ |
888 | | - // Most browsers are oky with inner unknown element selectors: |
889 | | - $j( video_element ).find( 'source,itext' ).each( function( ) { |
890 | | - _this.tryAddSource( this ); |
891 | | - } ); |
892 | | - } else { |
893 | | - // IE on the other hand is not. |
894 | 867 | |
895 | | - // IE apperntly has the source tags floating in DOM space but not |
896 | | - // as child of the unknown video tag element rather as its "sibling" |
897 | | - |
898 | | - // Add the video element with an identifiable div |
899 | | - |
900 | | - // NOTE this fails for multiple video tags in a given div |
901 | | - // but if we $j( video_element ).wrap ( $j('<div />' ) ) it fails all together |
902 | | - $j( $j( video_element ).parent().get(0).getElementsByTagName('source') ).each( function(){ |
903 | | - _this.tryAddSource( this ); |
904 | | - }); |
905 | | - |
906 | | - $j( $j( video_element ).parent().get(0).getElementsByTagName( 'itext' ) ).each( function(){ |
907 | | - _this.tryAddSource( this ); |
908 | | - }); |
909 | | - } |
| 868 | + $j( video_element ).find( 'source,itext' ).each( function( ) { |
| 869 | + _this.tryAddSource( this ); |
| 870 | + } ); |
910 | 871 | }, |
911 | 872 | |
912 | 873 | /** |
— | — | @@ -2148,8 +2109,7 @@ |
2149 | 2110 | mw.log( "embedPlayer:showPlayer::AddControls" ); |
2150 | 2111 | this.ctrlBuilder.addControls(); |
2151 | 2112 | } |
2152 | | - |
2153 | | - |
| 2113 | + |
2154 | 2114 | if ( this.autoplay ) { |
2155 | 2115 | mw.log( 'showPlayer::activating autoplay' ); |
2156 | 2116 | this.play(); |
— | — | @@ -2518,9 +2478,9 @@ |
2519 | 2479 | mw.log( 'no selected_player' ); |
2520 | 2480 | this.showPluginMissingHTML(); |
2521 | 2481 | } else { |
2522 | | - this.doEmbedPlayer(); |
2523 | | - this.paused = false; |
2524 | 2482 | this.thumbnail_disp = false; |
| 2483 | + this.paused = false; |
| 2484 | + this.doEmbedPlayer(); |
2525 | 2485 | } |
2526 | 2486 | } else { |
2527 | 2487 | // the plugin is already being displayed |
— | — | @@ -2600,16 +2560,17 @@ |
2601 | 2561 | // no longer seeking: |
2602 | 2562 | this.didSeekJump = false; |
2603 | 2563 | |
2604 | | - // first issue pause to update interface (only call the parent) |
| 2564 | + // first issue pause to update interface (only call this parent) |
2605 | 2565 | if ( this['parent_pause'] ) { |
2606 | 2566 | this.parent_pause(); |
2607 | 2567 | } else { |
2608 | 2568 | this.pause(); |
2609 | 2569 | } |
2610 | 2570 | |
2611 | | - // reset the currentTime: |
| 2571 | + // Reset the currentTime: |
2612 | 2572 | this.currentTime = 0; |
2613 | | - // check if thumbnail is being displayed in which case do nothing |
| 2573 | + |
| 2574 | + // Check if thumbnail is being displayed in which case do nothing |
2614 | 2575 | if ( this.thumbnail_disp ) { |
2615 | 2576 | // already in stooped state |
2616 | 2577 | mw.log( 'already in stopped state' ); |
— | — | @@ -2734,7 +2695,7 @@ |
2735 | 2696 | * underling plugin objects are responsible for updating currentTime |
2736 | 2697 | */ |
2737 | 2698 | monitor: function() { |
2738 | | - var _this = this; |
| 2699 | + var _this = this; |
2739 | 2700 | //mw.log(' ct: ' + this.currentTime + ' dur: ' + ( parseInt( this.duration ) + 1 ) + ' is seek: ' + this.seeking ); |
2740 | 2701 | if ( this.currentTime && this.currentTime > 0 && this.duration ) { |
2741 | 2702 | if ( !this.userSlide && !this.seeking ) { |
— | — | @@ -2774,33 +2735,17 @@ |
2775 | 2736 | |
2776 | 2737 | // Update buffer information |
2777 | 2738 | this.updateBufferStatus(); |
| 2739 | + // Call monitor at 250ms interval. |
| 2740 | + if( ! this.isStoped() ) { |
| 2741 | + setTimeout( function(){ |
| 2742 | + _this.monitor(); |
| 2743 | + }, 250 ) |
| 2744 | + } |
2778 | 2745 | |
2779 | | - // Update monitorTimerId to call child monitor |
2780 | | - if ( ! this.monitorTimerId ) { |
2781 | | - // Make sure an instance of this.id exists: |
2782 | | - if ( document.getElementById( this.id ) ) { |
2783 | | - this.monitorTimerId = setInterval( function() { |
2784 | | - if ( _this.id && $j( '#' + _this.id ).length != 0 ) { |
2785 | | - _this.monitor(); |
2786 | | - //$j( '#' + _this.id ).get( 0 ).monitor(); |
2787 | | - } |
2788 | | - }, 250 ); |
2789 | | - } |
2790 | | - } |
2791 | 2746 | this.runHook( 'monitor' ); |
2792 | | - }, |
| 2747 | + }, |
2793 | 2748 | |
2794 | 2749 | /** |
2795 | | - * Stop the playback monitor |
2796 | | - */ |
2797 | | - stopMonitor:function() { |
2798 | | - if ( this.monitorTimerId != 0 ) { |
2799 | | - clearInterval( this.monitorTimerId ); |
2800 | | - this.monitorTimerId = 0; |
2801 | | - } |
2802 | | - }, |
2803 | | - |
2804 | | - /** |
2805 | 2750 | * Update the buffer status based on the local bufferedPercent var |
2806 | 2751 | */ |
2807 | 2752 | updateBufferStatus: function() { |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/binPlayers/cortado/cortado-january.jar |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/binPlayers/cortado/cortado-january.jar |
___________________________________________________________________ |
Name: svn:executable |
2808 | 2753 | + * |
Name: svn:mime-type |
2809 | 2754 | + application/octet-stream |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/javaEmbed.js |
— | — | @@ -73,9 +73,10 @@ |
74 | 74 | newDoc.write( '<html><body>' + appletCode + '</body></html>' ); |
75 | 75 | // spurious error in some versions of FF, no workaround known |
76 | 76 | newDoc.close(); |
77 | | - } else {*/ |
| 77 | + } else { |
78 | 78 | $j( this ).html( appletCode ); |
79 | 79 | //} |
| 80 | + */ |
80 | 81 | |
81 | 82 | // Start the monitor: |
82 | 83 | this.monitor(); |
— | — | @@ -86,15 +87,15 @@ |
87 | 88 | */ |
88 | 89 | getAppletLocation: function() { |
89 | 90 | var mediaSrc = this.getSrc() |
90 | | - if ( mediaSrc.indexOf( '://' ) != -1 & !mw.isLocalDomain( mediaSrc ) ) { |
| 91 | + if ( !mw.isLocalDomain( mediaSrc ) ) { |
91 | 92 | if ( window.cortadoDomainLocations[ mw.parseUri( mediaSrc ).host ] ) { |
92 | | - applet_loc = window.cortadoDomainLocations[mw.parseUri( mediaSrc ).host]; |
| 93 | + applet_loc = window.cortadoDomainLocations[ mw.parseUri( mediaSrc ).host ]; |
93 | 94 | } else { |
94 | 95 | applet_loc = 'http://theora.org/cortado.jar'; |
95 | 96 | } |
96 | 97 | } else { |
97 | 98 | // should be identical to cortado.jar |
98 | | - applet_loc = mw.getMwEmbedPath() + 'modules/EmbedPlayer/binPlayers/cortado/cortado-ovt-stripped-0.5.0.jar'; |
| 99 | + applet_loc = mw.getMwEmbedPath() + 'modules/EmbedPlayer/binPlayers/cortado/cortado-january.jar'; |
99 | 100 | } |
100 | 101 | return applet_loc; |
101 | 102 | }, |
— | — | @@ -107,10 +108,10 @@ |
108 | 109 | if ( this.playerElement ) { |
109 | 110 | try { |
110 | 111 | // java reads ogg media time.. so no need to add the start or seek offset: |
111 | | - mw.log(' ct: ' + this.playerElement.getPlayPosition() + ' ' + this.supportsURLTimeEncoding()); |
112 | | - this.currentTime = this.playerElement.getPlayPosition(); |
113 | | - if ( this.playerElement.getPlayPosition() < 0 ) { |
114 | | - mw.log( 'pp:' + this.playerElement.getPlayPosition() ); |
| 112 | + //mw.log(' ct: ' + this.playerElement.getPlayPosition() + ' ' + this.supportsURLTimeEncoding()); |
| 113 | + this.currentTime = this.playerElement.currentTime; |
| 114 | + if ( this.currentTime < 0 ) { |
| 115 | + mw.log( 'pp:' + this.currentTime ); |
115 | 116 | // Probably reached clip end |
116 | 117 | this.onClipDone(); |
117 | 118 | } |
— | — | @@ -120,7 +121,7 @@ |
121 | 122 | }else{ |
122 | 123 | mw.log(" could not find playerElement " ); |
123 | 124 | } |
124 | | - // Once currentTime is updated call parent_monitor |
| 125 | + // Once currentTime is updated call parent_monitor |
125 | 126 | this.parent_monitor(); |
126 | 127 | }, |
127 | 128 | |
— | — | @@ -137,8 +138,8 @@ |
138 | 139 | this.parent_doSeek( percentage ); |
139 | 140 | } else if ( this.playerElement ) { |
140 | 141 | // do a (generally broken) local seek: |
141 | | - mw.log( "cortado javascript seems to always fail ... but here we go... doSeek(" + ( percentage * parseFloat( this.getDuration() ) ) ); |
142 | | - this.playerElement.doSeek( percentage * parseFloat( this.getDuration() ) ); |
| 142 | + mw.log( "Cortado seek is not very accurate :: doSeek(" + ( percentage * parseFloat( this.getDuration() ) ) ); |
| 143 | + this.playerElement.currentTime = ( percentage * parseFloat( this.getDuration() ) ); |
143 | 144 | } else { |
144 | 145 | this.doPlayThenSeek( percentage ); |
145 | 146 | } |
— | — | @@ -175,10 +176,13 @@ |
176 | 177 | * Update the playerElement instance with a pointer to the embed object |
177 | 178 | */ |
178 | 179 | getPlayerElement:function() { |
| 180 | + //this.playerElement = $j( '#' + this.pid ).get( 0 ); |
| 181 | + this.playerElement = document.applets[ 0 ]; |
| 182 | + // NOTE we are currently not using the iframe embed method: |
179 | 183 | //if ( $j.browser.mozilla ) { |
180 | 184 | // this.playerElement = $j('#cframe_' + this.id).contents().find( '#' + this.pid ); |
181 | 185 | //} else { |
182 | | - this.playerElement = $j( '#' + this.pid ).get( 0 ); |
| 186 | + // this.playerElement = $j( '#' + this.pid ).get( 0 ); |
183 | 187 | //} |
184 | 188 | }, |
185 | 189 | |
— | — | @@ -189,7 +193,7 @@ |
190 | 194 | play: function() { |
191 | 195 | this.getPlayerElement(); |
192 | 196 | this.parent_play(); |
193 | | - if ( this.playerElement && this.playerElement.play ) { |
| 197 | + if ( this.playerElement ) { |
194 | 198 | this.playerElement.play(); |
195 | 199 | } |
196 | 200 | }, |
— | — | @@ -203,7 +207,7 @@ |
204 | 208 | // Update the interface |
205 | 209 | this.parent_pause(); |
206 | 210 | // Call the pause function if it exists: |
207 | | - if ( this.playerElement && this.playerElement.pause ) { |
| 211 | + if ( this.playerElement ) { |
208 | 212 | this.playerElement.pause(); |
209 | 213 | } |
210 | 214 | } |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/nativeEmbed.js |
— | — | @@ -217,11 +217,10 @@ |
218 | 218 | /** |
219 | 219 | * Monitor the video playback & update the currentTime |
220 | 220 | */ |
221 | | - monitor: function() { |
| 221 | + monitor: function() { |
222 | 222 | this.getPlayerElement(); // make sure we have .vid obj |
223 | 223 | if ( !this.playerElement ) { |
224 | 224 | mw.log( 'could not find video embed: ' + this.id + ' stop monitor' ); |
225 | | - this.stopMonitor(); |
226 | 225 | return false; |
227 | 226 | } |
228 | 227 | |
— | — | @@ -235,6 +234,7 @@ |
236 | 235 | |
237 | 236 | /** |
238 | 237 | * Get video src URI |
| 238 | + * appends this.urlAppend for unique urls for re-requesting src urls on broken playback |
239 | 239 | */ |
240 | 240 | getSrc: function() { |
241 | 241 | var src = this.parent_getSrc(); |
— | — | @@ -253,8 +253,6 @@ |
254 | 254 | if ( this.playerElement ) { |
255 | 255 | this.playerElement.pause(); |
256 | 256 | } |
257 | | - // stop updates: |
258 | | - this.stopMonitor(); |
259 | 257 | }, |
260 | 258 | |
261 | 259 | /** |
— | — | @@ -346,6 +344,7 @@ |
347 | 345 | */ |
348 | 346 | getPlayerElement : function () { |
349 | 347 | this.playerElement = $j( '#' + this.pid ).get( 0 ); |
| 348 | + return this.playerElement; |
350 | 349 | }, |
351 | 350 | |
352 | 351 | /** |
Index: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js |
— | — | @@ -1,3 +1,7 @@ |
| 2 | +// Add support for html5 / mwEmbed elements to IE ( must come before js code ) |
| 3 | +// For discussion and comments, see: http://remysharp.com/2009/01/07/html5-enabling-script/ |
| 4 | +/*@cc_on'video source itext playlist'.replace(/\w+/g,function(n){document.createElement(n)})@*/ |
| 5 | + |
2 | 6 | /** |
3 | 7 | * ~mwEmbed ~ |
4 | 8 | * For details see: http://www.mediawiki.org/wiki/MwEmbed |