Index: branches/MwEmbedStandAlone/skins/common/mw.style.mwCommon.css |
— | — | @@ -185,7 +185,7 @@ |
186 | 186 | * Lets us use root common style sheets with jquery based skins |
187 | 187 | * ( without additional assets in the embedPlayer skins folder ) |
188 | 188 | */ |
189 | | -.mv-player .play-btn-large { |
| 189 | +.play-btn-large { |
190 | 190 | width : 130px; |
191 | 191 | height : 96px; |
192 | 192 | background : url(images/player_big_play_button.png); |
Index: branches/MwEmbedStandAlone/mwEmbed.js |
— | — | @@ -1168,10 +1168,10 @@ |
1169 | 1169 | */ |
1170 | 1170 | mw.isHTML5FallForwardNative = function(){ |
1171 | 1171 | // Check for a mobile html5 user agent: |
1172 | | - if ( (navigator.userAgent.indexOf('iPhone') != -1) || |
1173 | | - (navigator.userAgent.indexOf('iPod') != -1) || |
1174 | | - (navigator.userAgent.indexOf('iPad') != -1) || |
1175 | | - (navigator.userAgent.indexOf('Android 2.') != -1) || |
| 1172 | + if ( ( mw.isIphone() ) || |
| 1173 | + ( mw.isIpod() ) || |
| 1174 | + ( mw.isIpad() ) || |
| 1175 | + ( mw.isAndroid2() ) || |
1176 | 1176 | // to debug in chrome / desktop safari |
1177 | 1177 | (document.URL.indexOf('forceMobileHTML5') != -1 ) |
1178 | 1178 | ) { |
— | — | @@ -1191,9 +1191,14 @@ |
1192 | 1192 | return false; |
1193 | 1193 | } |
1194 | 1194 | } |
| 1195 | +<<<<<<< .mine |
| 1196 | + } |
| 1197 | + // For IE: |
| 1198 | +======= |
1195 | 1199 | } |
1196 | 1200 | |
1197 | 1201 | // For IE: |
| 1202 | +>>>>>>> .r76860 |
1198 | 1203 | var hasObj = true; |
1199 | 1204 | try { |
1200 | 1205 | var obj = new ActiveXObject( 'ShockwaveFlash.ShockwaveFlash' ); |
— | — | @@ -1212,12 +1217,22 @@ |
1213 | 1218 | // No video tag or flash, return false ( normal "install flash" user flow ) |
1214 | 1219 | return false; |
1215 | 1220 | } |
| 1221 | +<<<<<<< .mine |
| 1222 | + mw.isIphone = function(){ |
| 1223 | + return ( navigator.userAgent.indexOf('iPhone') != -1 ); |
| 1224 | + }; |
| 1225 | + mw.isIpod = function(){ |
| 1226 | + return ( navigator.userAgent.indexOf('iPod') != -1 ); |
| 1227 | + }; |
| 1228 | + mw.isIpad = function(){ |
| 1229 | + return ( navigator.userAgent.indexOf('iPad') != -1 ); |
| 1230 | + }; |
| 1231 | + // Android 2 has some restrictions vs other mobile platforms |
| 1232 | +======= |
1216 | 1233 | // Android 2 has some restrictions vs other mobile platforms |
1217 | | - mw.isAndroid2 = function(){ |
1218 | | - if ( navigator.userAgent.indexOf('Android 2.') != -1) { |
1219 | | - return true; |
1220 | | - } |
1221 | | - return false; |
| 1234 | +>>>>>>> .r76860 |
| 1235 | + mw.isAndroid2 = function(){ |
| 1236 | + return ( navigator.userAgent.indexOf( 'Android 2.') != -1 ); |
1222 | 1237 | }; |
1223 | 1238 | |
1224 | 1239 | /** |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js |
— | — | @@ -2422,27 +2422,32 @@ |
2423 | 2423 | // in the dom , and no auto-play ) |
2424 | 2424 | // and only with 'native display' |
2425 | 2425 | if( mw.isAndroid2() ){ |
2426 | | - $j( '#' + _this.pid ).siblings('.play-btn-large').remove(); |
2427 | | - $j( '#' + _this.pid ).after( |
2428 | | - $j('<div />') |
2429 | | - .css({ |
2430 | | - 'position' : 'relative', |
2431 | | - 'top' : -1 * ( .5 * _this.getPlayerHeight() ) - 52, |
2432 | | - 'left' : ( .5 * _this.getPlayerWidth() ) - 75 |
2433 | | - }) |
2434 | | - .attr( { |
2435 | | - 'title' : gM( 'mwe-embedplayer-play_clip' ), |
2436 | | - 'class' : "ui-state-default play-btn-large" |
2437 | | - } ) |
2438 | | - .click( function() { |
2439 | | - _this.play(); |
2440 | | - // no need to hide the play button since android plays |
2441 | | - // fullscreen |
2442 | | - } ) |
2443 | | - ) |
| 2426 | + this.addPlayBtnLarge(); |
2444 | 2427 | } |
2445 | 2428 | return ; |
2446 | 2429 | }, |
| 2430 | + addPlayBtnLarge:function(){ |
| 2431 | + var _this = this; |
| 2432 | + $j( '#' + _this.pid ).siblings('.play-btn-large').remove(); |
| 2433 | + $j( '#' + _this.pid ).after( |
| 2434 | + $j('<div />') |
| 2435 | + .css({ |
| 2436 | + 'position' : 'relative', |
| 2437 | + 'top' : -1 * ( .5 * _this.getHeight() ) - 52, |
| 2438 | + 'left' : ( .5 * _this.getWidth() ) - 75 |
| 2439 | + }) |
| 2440 | + .attr( { |
| 2441 | + 'title' : gM( 'mwe-embedplayer-play_clip' ), |
| 2442 | + 'class' : "play-btn-large" |
| 2443 | + } ) |
| 2444 | + .click( function() { |
| 2445 | + $j( this ).hide(); |
| 2446 | + _this.play(); |
| 2447 | + // no need to hide the play button since android plays |
| 2448 | + // fullscreen |
| 2449 | + } ) |
| 2450 | + ) |
| 2451 | + }, |
2447 | 2452 | /** |
2448 | 2453 | * Should be set via native embed support |
2449 | 2454 | */ |
— | — | @@ -2775,22 +2780,29 @@ |
2776 | 2781 | this.pause(); |
2777 | 2782 | } |
2778 | 2783 | } |
2779 | | - |
2780 | | - // Rewrite the html to thumbnail disp |
2781 | | - this.showThumbnail(); |
2782 | | - this.bufferedPercent = 0; // reset buffer state |
2783 | | - this.controlBuilder.setStatus( this.getTimeRange() ); |
2784 | | - |
2785 | | - // Reset the playhead |
2786 | | - mw.log("EmbedPlayer::Stop:: Reset play head") |
2787 | | - this.updatePlayHead( 0 ); |
2788 | | - |
2789 | | - // Bind play-btn-large play |
2790 | | - this.$interface.find( '.play-btn-large' ) |
2791 | | - .unbind( 'click' ) |
2792 | | - .click( function() { |
2793 | | - _this.play(); |
2794 | | - } ); |
| 2784 | + // Native player controls: |
| 2785 | + if( this.useNativePlayerControls() ){ |
| 2786 | + this.getPlayerElement().currentTime = 0; |
| 2787 | + this.getPlayerElement().pause(); |
| 2788 | + // add play button on top |
| 2789 | + this.addPlayBtnLarge(); |
| 2790 | + } else { |
| 2791 | + // Rewrite the html to thumbnail disp |
| 2792 | + this.showThumbnail(); |
| 2793 | + this.bufferedPercent = 0; // reset buffer state |
| 2794 | + this.controlBuilder.setStatus( this.getTimeRange() ); |
| 2795 | + |
| 2796 | + // Reset the playhead |
| 2797 | + mw.log("EmbedPlayer::Stop:: Reset play head") |
| 2798 | + this.updatePlayHead( 0 ); |
| 2799 | + |
| 2800 | + // Bind play-btn-large play |
| 2801 | + this.$interface.find( '.play-btn-large' ) |
| 2802 | + .unbind( 'click' ) |
| 2803 | + .click( function() { |
| 2804 | + _this.play(); |
| 2805 | + } ); |
| 2806 | + } |
2795 | 2807 | }, |
2796 | 2808 | |
2797 | 2809 | /** |
— | — | @@ -3080,6 +3092,7 @@ |
3081 | 3093 | |
3082 | 3094 | // Get the buffer target based for playlist vs clip |
3083 | 3095 | $buffer = this.$interface.find( '.mw_buffer' ); |
| 3096 | + |
3084 | 3097 | //mw.log(' set bufferd %:' + this.bufferedPercent ); |
3085 | 3098 | // Update the buffer progress bar (if available ) |
3086 | 3099 | if ( this.bufferedPercent != 0 ) { |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerNative.js |
— | — | @@ -564,8 +564,8 @@ |
565 | 565 | * |
566 | 566 | * Used to update the bufferedPercent |
567 | 567 | * |
568 | | - * Note: this way of updating buffer was only supported in firefox 3.x and |
569 | | - * not supported in firefox 4.x |
| 568 | + * Note: this way of updating buffer was only supported in Firefox 3.x and |
| 569 | + * not supported in Firefox 4.x |
570 | 570 | */ |
571 | 571 | onprogress: function( event ) { |
572 | 572 | var e = event.originalEvent; |