* (bug 21152) fixed position of playhead to seek position on native html5 seeking
authorMichael Dale <dale@users.mediawiki.org>
Fri, 16 Oct 2009 17:32:40 +0000 (17:32 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Fri, 16 Oct 2009 17:32:40 +0000 (17:32 +0000)
js2/mwEmbed/libEmbedVideo/embedVideo.js
js2/mwEmbed/libEmbedVideo/nativeEmbed.js
js2/mwEmbed/php/languages/mwEmbed.i18n.php

index 61bda8e..ae503a7 100644 (file)
@@ -49,7 +49,8 @@ loadGM({
        "mwe-playerselect" : "Players",
        "mwe-read_before_embed" : "Please read the <a href=\"http:\/\/mediawiki.org\/wiki\/Security_Notes_on_Remote_Embedding\" target=\"_new\">security notes on remote embedding<\/a> before actually embedding!",
        "mwe-embed_site_or_blog" : "Embed on your site or blog",
-       "mwe_related_videos" : "Related videos"
+       "mwe-related_videos" : "Related videos",
+       "mwe-seeking": "seeking"
 });
 
 //set the globals:
@@ -1043,7 +1044,7 @@ embedVideo.prototype = {
                return 'function getEmbedHTML should be overitten by embedLib ';
        },
        //do seek function (should be overwritten by implementing embedLibs)
-       // first check if seek can be done on locally downloaded content. 
+       // to check if seek can be done on locally downloaded content. 
        doSeek : function( perc ){              
                if( this.supportsURLTimeEncoding() ){                   
                        //make sure this.seek_time_sec is up-to-date:
@@ -1199,7 +1200,7 @@ embedVideo.prototype = {
                if( this.wikiTitleKey){
                        $j('#dc_'+this.id).append(
                        '<div class="related_vids" >' +
-                          '<h1>' + gM('mwe_related_videos') + '</h1>'+
+                          '<h1>' + gM('mwe-related_videos') + '</h1>'+
                                '<ul>' +
                                '</ul>' +
                        '</div>');      
@@ -2060,7 +2061,7 @@ embedVideo.prototype = {
        //plugin objects are responsible for updating currentTime
        monitor:function(){             
                if( this.currentTime && this.currentTime > 0 && this.duration){
-                       if( !this.userSlide ){
+                       if( !this.userSlide && ! this.seeking ){
                                if( this.start_offset  ){ 
                                        //if start offset include that calculation 
                                        this.setSliderValue( ( this.currentTime - this.start_offset ) / this.duration );                        
index 2936508..405e4e6 100644 (file)
@@ -36,11 +36,14 @@ var nativeEmbed = {
                        eb+='autoplay="true" ';*/
                        
                //continue with the other attr:                                         
-               eb+=            'oncanplaythrough="$j(\'#'+this.id+'\').get(0).oncanplaythrough();return false;" ' +
-                                          'onloadedmetadata="$j(\'#'+this.id+'\').get(0).onloadedmetadata();return false;" ' + 
-                                          'loadedmetadata="$j(\'#'+this.id+'\').get(0).onloadedmetadata();return false;" ' +
-                                          'onprogress="$j(\'#'+this.id+'\').get(0).onprogress( event );return false;" '+
-                                          'onended="$j(\'#'+this.id+'\').get(0).onended();return false;" >' +
+               eb+= 'oncanplaythrough="$j(\'#'+this.id+'\').get(0).oncanplaythrough();return false;" ' +
+                          'onloadedmetadata="$j(\'#'+this.id+'\').get(0).onloadedmetadata();return false;" ' + 
+                          'loadedmetadata="$j(\'#'+this.id+'\').get(0).onloadedmetadata();return false;" ' +
+                          'onprogress="$j(\'#'+this.id+'\').get(0).onprogress( event );return false;" '+
+                          'onended="$j(\'#'+this.id+'\').get(0).onended();return false;" '+
+                          'onseeking="$j(\'#'+this.id+'\').get(0).onseeking();" ' +
+                          'onseeked="$j(\'#'+this.id+'\').get(0).onseeked();" ' +
+                          '>' +                           
                        '</video>';
                return eb;
        },
@@ -68,7 +71,14 @@ var nativeEmbed = {
                        }                       
                }
        },      
-       doSeek:function(perc){                          
+       onseeking:function(){
+               this.seeking = true;
+               this.setStatus( '<blink>' + gM('mwe-seeking') + '</blink>' );
+       },
+       onseeked: function(){
+               this.seeking = false;
+       },
+       doSeek:function(perc){                                  
                //js_log('native:seek:p: ' + perc+ ' : '  + this.supportsURLTimeEncoding() + ' dur: ' + this.getDuration() + ' sts:' + this.seek_time_sec );            
                //@@todo check if the clip is loaded here (if so we can do a local seek)
                if( this.supportsURLTimeEncoding() || !this.vid){                       
@@ -100,7 +110,7 @@ var nativeEmbed = {
                        _this.getVID();         
                        //if we have duration then we are ready to do the seek
                        if(this.vid && this.vid.duration){
-                               _this.doSeek(perc);
+                               _this.doSeek( perc );
                        }else{                  
                                //try to get player for 10 seconds: 
                                if( rfsCount < 200 ){
index 1f8a738..9d4d351 100644 (file)
@@ -278,7 +278,8 @@ $messages['en'] = array(
        'mwe-playerselect' => 'Players',
        'mwe-read_before_embed' => 'Please read the <a href="http://mediawiki.org/wiki/Security_Notes_on_Remote_Embedding" target="_new">security notes on remote embedding</a> before actually embedding!',
        'mwe-embed_site_or_blog' => 'Embed on your site or blog',
-       'mwe_related_videos' => 'Related videos',
+       'mwe-related_videos' => 'Related videos',
+       'mwe-seeking' => "seeking",
 );
 
 /** Message documentation (Message documentation)