Index: branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | enabledSources: null, |
49 | 49 | |
50 | 50 | /** |
51 | | - * The current langauge key |
| 51 | + * The current language key |
52 | 52 | */ |
53 | 53 | currentLangKey : null, |
54 | 54 | |
— | — | @@ -106,7 +106,6 @@ |
107 | 107 | */ |
108 | 108 | init: function( embedPlayer, options ) { |
109 | 109 | var _this = this; |
110 | | - mw.log("TimedText: init() "); |
111 | 110 | this.embedPlayer = embedPlayer; |
112 | 111 | this.options = options; |
113 | 112 | |
— | — | @@ -297,7 +296,6 @@ |
298 | 297 | * @param {Function} callback Function to be called once text sources are setup. |
299 | 298 | */ |
300 | 299 | setupTextSources: function( callback ) { |
301 | | - mw.log( 'mw.TimedText::setupTextSources'); |
302 | 300 | var _this = this; |
303 | 301 | if( this.textSourceSetupFlag ) { |
304 | 302 | if( callback ) { |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js |
— | — | @@ -782,19 +782,19 @@ |
783 | 783 | */ |
784 | 784 | detectType: function( uri ) { |
785 | 785 | // NOTE: if media is on the same server as the javascript |
786 | | - // we can issue a HEAD request and read the mime type of the media ... |
787 | | - // ( this will detect media mime type independently of the url name) |
| 786 | + // we can issue a HEAD request and read the mime type of the media... |
| 787 | + // ( this will detect media mime type independently of the url name ) |
788 | 788 | // http://www.jibbering.com/2002/4/httprequest.html |
789 | | - var end_inx = ( uri.indexOf( '?' ) != -1 ) ? uri.indexOf( '?' ) : uri.length; |
790 | | - var no_param_uri = uri.substr( 0, end_inx ); |
791 | | - switch( no_param_uri.substr( no_param_uri.lastIndexOf( '.' )+1 ).toLowerCase() ) { |
| 789 | + var urlParts = mw.parseUri( uri ); |
| 790 | + // Get the extension from the url or from the relative name: |
| 791 | + var ext = ( urlParts.file )? /[^.]+$/.exec( urlParts.file ) : /[^.]+$/.exec( uri ); |
| 792 | + switch( ext.toString().toLowerCase() ) { |
792 | 793 | case 'smil': |
793 | 794 | case 'sml': |
794 | | - return 'application/smil' |
| 795 | + return 'application/smil'; |
795 | 796 | break; |
796 | 797 | case 'm4v': |
797 | 798 | case 'mp4': |
798 | | - case 'mov': |
799 | 799 | return 'video/h264'; |
800 | 800 | break; |
801 | 801 | case 'webm': |
— | — | @@ -829,6 +829,7 @@ |
830 | 830 | return 'video/mpeg'; |
831 | 831 | break; |
832 | 832 | } |
| 833 | + mw.log( "Error: could not detect type of media src: " + uri ); |
833 | 834 | } |
834 | 835 | }; |
835 | 836 | |
— | — | @@ -2628,12 +2629,10 @@ |
2629 | 2630 | if( this.paused === true ){ |
2630 | 2631 | this.paused = false; |
2631 | 2632 | // Check if we should Trigger the play event |
2632 | | - if( this.bubbleEventCheck() ) { |
2633 | | - mw.log("EmbedPlayer:: trigger play even::" + !this.paused); |
2634 | | - if( this._propagateEvents ){ |
2635 | | - $j( this ).trigger( 'play' ); |
2636 | | - _this.tempDisableEvents(); |
2637 | | - } |
| 2633 | + mw.log("EmbedPlayer:: trigger play even::" + !this.paused); |
| 2634 | + if( this._propagateEvents ){ |
| 2635 | + $j( this ).trigger( 'play' ); |
| 2636 | + _this.tempDisableEvents(); |
2638 | 2637 | } |
2639 | 2638 | } |
2640 | 2639 | |
— | — | @@ -2659,18 +2658,6 @@ |
2660 | 2659 | this.monitor(); |
2661 | 2660 | }, |
2662 | 2661 | /** |
2663 | | - * Returns true if the event should be triggered or false if not |
2664 | | - * |
2665 | | - * @@FIXME:: firefox nightlies now Do NOT bubble events. Once release tag |
2666 | | - * every version after that |
2667 | | - */ |
2668 | | - bubbleEventCheck: function(){ |
2669 | | - if( $j.browser.webkit ){ |
2670 | | - return true; |
2671 | | - } |
2672 | | - return false; |
2673 | | - }, |
2674 | | - /** |
2675 | 2662 | * Base embed pause Updates the play/pause button state. |
2676 | 2663 | * |
2677 | 2664 | * There is no general way to pause the video must be overwritten by embed |
— | — | @@ -2682,14 +2669,10 @@ |
2683 | 2670 | // controls: |
2684 | 2671 | if( this.paused === false ){ |
2685 | 2672 | this.paused = true; |
2686 | | - mw.log( "EmbedPlayer:: pause: " + this._propagateEvents ); |
2687 | | - |
2688 | | - if( this.bubbleEventCheck() ){ |
2689 | | - mw.log('EmbedPlayer:trigger pause:' + this.paused); |
2690 | | - if( this._propagateEvents ){ |
2691 | | - $j( this ).trigger( 'pause' ); |
2692 | | - _this.tempDisableEvents(); |
2693 | | - } |
| 2673 | + mw.log('EmbedPlayer:trigger pause:' + this.paused); |
| 2674 | + if( this._propagateEvents ){ |
| 2675 | + $j( this ).trigger( 'pause' ); |
| 2676 | + _this.tempDisableEvents(); |
2694 | 2677 | } |
2695 | 2678 | } |
2696 | 2679 | |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerNative.js |
— | — | @@ -199,7 +199,7 @@ |
200 | 200 | _this['on' + eventName ].apply( _this, argArray); |
201 | 201 | } else { |
202 | 202 | // No local handler directly propagate the event to the abstract object: |
203 | | - $j( _this ).trigger( eventName, argArray ) |
| 203 | + $j( _this ).trigger( eventName, argArray ); |
204 | 204 | } |
205 | 205 | } |
206 | 206 | }) |
Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | mwReqParam['embedplayer'] = 'yes'; |
36 | 36 | } |
37 | 37 | |
38 | | -//mwReqParam['debug'] = true; |
| 38 | +// mwReqParam['debug'] = true; |
39 | 39 | |
40 | 40 | // Setup up some globals to wrap mwEmbed mw.ready and mw.setConfig functions |
41 | 41 | |
— | — | @@ -447,6 +447,24 @@ |
448 | 448 | var re = new RegExp( /videoUrl(":?\s*)*([^&]*)/ ); |
449 | 449 | src = re.exec( rewriteHTML )[2]; |
450 | 450 | |
| 451 | + var timeHash = ''; |
| 452 | + // Check for temporal url in document hash |
| 453 | + if( location.hash.indexOf('#t=') === 0 ){ |
| 454 | + timeHash = location.hash; |
| 455 | + } |
| 456 | + // Check for temporal url in template hack |
| 457 | + var $startTime = $j( '#' + vidId ).parent().find('.starttime'); |
| 458 | + if( $startTime.length ){ |
| 459 | + timeHash= '#t=' + $startTime.text(); |
| 460 | + // if we have a start time also look for endtime |
| 461 | + var $endTime = $j( '#' + vidId ).parent().find('.endtime'); |
| 462 | + if( $endTime.lenght ){ |
| 463 | + timeHash += $endTime.text(); |
| 464 | + } |
| 465 | + } |
| 466 | + // Update the video source with the temporal time hash: |
| 467 | + src+=timeHash; |
| 468 | + |
451 | 469 | var apiTitleKey = src.split( '/' ); |
452 | 470 | apiTitleKey = decodeURI( apiTitleKey[ apiTitleKey.length - 1 ] ); |
453 | 471 | |
— | — | @@ -472,7 +490,6 @@ |
473 | 491 | |
474 | 492 | if ( src ) { |
475 | 493 | var html_out = ''; |
476 | | - |
477 | 494 | var common_attr = ' id="mwe_' + vidId + '" ' + |
478 | 495 | 'apiTitleKey="' + apiTitleKey + '" ' + |
479 | 496 | 'src="' + src + '" ' + |