http://www.mediawiki.org/wiki/Special:Code/MediaWiki/74126

Revision: 74126
Author:   dale
Date:     2010-10-01 23:42:24 +0000 (Fri, 01 Oct 2010)

Log Message:
-----------
* some fixes to avoid so many video seeks
* fix the transition In animation 

Modified Paths:
--------------
    branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js
    branches/MwEmbedStandAlone/modules/Sequencer/tools/mw.SequencerTools.js
    branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js
    branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js
    branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBuffer.js
    branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js
    branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilTransitions.js

Modified: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js
===================================================================
--- branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js        
2010-10-01 23:31:08 UTC (rev 74125)
+++ branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js        
2010-10-01 23:42:24 UTC (rev 74126)
@@ -362,7 +362,7 @@
                        .click(function(){
                                //Add clip to selection
                                _this.handleMultiSelect( this );
-                       })                              
+                       });
        },
        // calls the edit interface passing in the selected clip:
        editClip: function( selectedClip ){
@@ -387,7 +387,7 @@
                        $j( selectedClip ).fadeOut('fast', function(){
                                $j(this).remove();
                        });
-               })              
+               });
                
                // Invalidate / update embedPlayer duration: 
                this.sequencer.getEmbedPlayer().getDuration( true );

Modified: 
branches/MwEmbedStandAlone/modules/Sequencer/tools/mw.SequencerTools.js
===================================================================
--- branches/MwEmbedStandAlone/modules/Sequencer/tools/mw.SequencerTools.js     
2010-10-01 23:31:08 UTC (rev 74125)
+++ branches/MwEmbedStandAlone/modules/Sequencer/tools/mw.SequencerTools.js     
2010-10-01 23:42:24 UTC (rev 74126)
@@ -45,7 +45,7 @@
                },
                'transitions' : {                       
                        'editWidgets' : ['editTransitions'],            
-                       'contentTypes': ['video', 'img', 'mwtemplate' ]
+                       'contentTypes': ['video', 'img', 'cdata_html', 
'mwtemplate' ]
                }
        },
        editableAttributes:{            
@@ -833,7 +833,7 @@
                                // Update the preview thumbs
                                var $target = $j( '#editWidgets_trimTimeline' );
                                // (local function so it can be updated after 
the start time is done with its draw ) 
-                               var updateDurationThumb = function(){
+                               /*var updateDurationThumb = function(){
                                        // Check the duration:
                                        var clipDur = 
$j('#editTool_trim_dur').val();
                                        if( clipDur ){
@@ -859,6 +859,7 @@
                                                updateDurationThumb()
                                        )
                                }
+                               */
                                
                                // Register the edit state for undo / redo 
                                _this.sequencer.getActionsEdit().registerEdit();
@@ -868,7 +869,7 @@
                                var smil = _this.sequencer.getSmil();
                                var sliderScale = 2000 // assume slider is 
never more than 2000 pixles wide. 
                                // check if thumbs are supported 
-                               if( _this.sequencer.getSmil().getRefType( 
smilElement ) == 'video' ){ 
+                               /*if( _this.sequencer.getSmil().getRefType( 
smilElement ) == 'video' ){ 
                                        $j(target).append(
                                                $j('<div />')                   
                
                                                .addClass( 'trimStartThumb 
ui-corner-all' ),                                    
@@ -876,7 +877,7 @@
                                                .addClass( 'trimEndThumb 
ui-corner-all' ),
                                                $j('<div 
/>').addClass('ui-helper-clearfix') 
                                        )                       
-                               }
+                               }*/
                                // The local scope fullClipDuration
                                var fullClipDuration = null;
                                

Modified: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js
===================================================================
--- branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js 
2010-10-01 23:31:08 UTC (rev 74125)
+++ branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js 
2010-10-01 23:42:24 UTC (rev 74126)
@@ -288,7 +288,7 @@
                        // Reset the pausedForBuffer flag: 
                        this.pausedForBuffer = false;
                        
-                       mw.log( "Call animateTime: " + this.smilPlayTime);
+                       //mw.log( "Call animateTime: " + this.smilPlayTime);
                        // Issue an animate time request with monitorDelta 
                        this.smil.animateTime( this.smilPlayTime, 
this.monitorRate ); 
                }
@@ -319,8 +319,9 @@
        * Get the duration of smil document. 
        */
        getDuration: function( forceRefresh ){
-               if( forceRefresh )
+               if( forceRefresh ){
                        this.duration = null;
+               }
                if( !this.duration ){
                        if( this.smil ){
                                this.duration = this.smil.getDuration( 
forceRefresh  );

Modified: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js
===================================================================
--- branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js        
2010-10-01 23:31:08 UTC (rev 74125)
+++ branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js        
2010-10-01 23:42:24 UTC (rev 74126)
@@ -209,7 +209,7 @@
                                                }
                                        }
                                }
-                               // add audioObject to end ( currentAudioObj has 
latest startTime
+                               // Add audioObject to end ( currentAudioObj has 
latest startTime
                                if( ! addedAudioFlag &&  audioEndTime > 
currentAudioEndTime ){
                                        var audioObjDuration = ( audioEndTime - 
currentAudioEndTime );
                                        if( currentAudioEndTime + 
audioObjDuration > _this.getDuration() ){
@@ -346,7 +346,7 @@
         * @param {boolean} forceRefresh If a fresh duration should be 
calculated 
         */
        getClipDuration: function( $node, forceRefresh ){                       
-               /* 
+               /**
                 * mw.log( 'SmilBody::getClipDuration: node children::' + 
                 *              $node.children().length + 'calle: ' + 
arguments.callee.toString() );
                */

Modified: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBuffer.js
===================================================================
--- branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBuffer.js      
2010-10-01 23:31:08 UTC (rev 74125)
+++ branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBuffer.js      
2010-10-01 23:42:24 UTC (rev 74126)
@@ -153,7 +153,8 @@
                        // Hide the element ( in modern browsers this should 
not cause a flicker 
                        // because DOM update are displayed at a given dom draw 
rate )
                        _this.smil.getLayout().hideElement( smilElement );
-                       mw.log('loadElement::Add:' + 
this.smil.getSmilElementPlayerID( smilElement )+ ' len: ' +  $j( '#' + 
this.smil.getSmilElementPlayerID( smilElement ) ).length );
+                       mw.log('loadElement::Add:' + 
this.smil.getSmilElementPlayerID( smilElement ) + 
+                                       ' len: ' +  $j( '#' + 
this.smil.getSmilElementPlayerID( smilElement ) ).length );
                }
 
                // Start "loading" the asset (for now just video ) 

Modified: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js
===================================================================
--- branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js      
2010-10-01 23:31:08 UTC (rev 74125)
+++ branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js      
2010-10-01 23:42:24 UTC (rev 74126)
@@ -101,6 +101,7 @@
                
                // Check for quick "show" path:
                var $targetElement = $j( '#' + 
this.smil.getSmilElementPlayerID( smilElement ) );
+               
                if( $targetElement.length ){
                        $targetElement.show();
                        return ;
@@ -108,6 +109,7 @@
                var $regionTarget = this.getRegionTarget( smilElement );        
        
                // Make sure we have a $regionTarget
                if( !$regionTarget ){
+                       mw.log("Error missing regionTarget");
                        return ;
                }
                                                        
@@ -115,6 +117,7 @@
                _this.drawPlayerSmilElement(smilElement, $regionTarget );
                
        },
+       
        /**
         * Add the transformed smil element to the $regionTarget
         * 
@@ -141,7 +144,7 @@
                                                'top' : '0px',
                                                'left' : '0px'
                                        })
-                               $regionTarget.append( $target )
+                               $regionTarget.append( $target );
                                this.drawSmilElementToTarget( smilElement, 
$target );
                                return ;
                        break;
@@ -177,7 +180,7 @@
                
                switch ( this.smil.getRefType( smilElement )  ){
                        case 'video':
-                               this.getVideoCanvasThumb(smilElement, $target,  
relativeTime, callback )                
+                               this.getVideoCanvasThumb( smilElement, $target, 
 relativeTime, callback );
                                return ;
                        break;
                        case 'img':
@@ -338,7 +341,7 @@
         * Hide a smilElement in the layout
         */     
        hideElement: function( smilElement ){           
-               mw.log(" hide: " + this.smil.getSmilElementPlayerID( 
smilElement ));
+               //mw.log(" hide: " + this.smil.getSmilElementPlayerID( 
smilElement ));
                // Check that the element is already in the dom
                var $targetElement = this.$rootLayout.find( '#' + 
this.smil.getSmilElementPlayerID( smilElement ) );
                if( $targetElement.length ){
@@ -518,14 +521,7 @@
                                        })
                                });                                     
                        })
-                       // Switch any named font-size attribute to em
-                       $htmlLayout.find('[style]').each( function(inx, node){  
                
-                               if( $j(node).css('font-size') ){
-                                       $j(node).css('font-size', 
-                                               ( fontScalePercent * 
parseFloat( $j(node).css('font-size') ) ) + 'px'
-                                       );                              
-                               }
-                       })      
+                       
                        // Strip any links for thumbs of player
                        $htmlLayout.find('a').attr('href', '#');
                }

Modified: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilTransitions.js
===================================================================
--- branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilTransitions.js 
2010-10-01 23:31:08 UTC (rev 74125)
+++ branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilTransitions.js 
2010-10-01 23:42:24 UTC (rev 74126)
@@ -28,10 +28,10 @@
                                if( transitionDirection == 'transOut' ){
                                        var nodeDuration = 
_this.smil.getBody().getClipDuration( smilElement ); 
                                        if( animateTime > ( nodeDuration - 
transitionDuration ) ){                      
-                                               percent = animateTime - ( 
nodeDuration - transitionDuration ) / transitionDuration;
-                                       }                                       
-                                       // Invert the percentage for "transOut"
-                                       percent = 1 - percent;
+                                               percent = ( animateTime - ( 
nodeDuration - transitionDuration ) ) / transitionDuration;
+                                               // Invert the percentage for 
"transOut"
+                                               //percent = 1 - percent;
+                                       }                                       
                                        
                                }
                                if( percent !== false ){
                                        inRangeTransitions.push( {
@@ -128,7 +128,7 @@
         */
        transitionFunctionMap : {
                'fade' : {
-                       'fadeFromColor': function( _this, percent, $transition, 
smilElement ){
+                       '_doColorOverlay': function( _this, percent, 
$transition, smilElement ){
                                // Add the overlay if missing                   
                        
                                var transitionOverlayId = 
_this.getTransitionOverlayId( $transition, smilElement );             
                                if( $j( '#' + transitionOverlayId  ).length == 
0 ){
@@ -147,12 +147,18 @@
                                // Update the color: 
                                $j( '#' + transitionOverlayId  ).css( 
'background-color', $transition.attr( 'fadeColor'))
                                
-                               // Invert the percentage since we setting 
opacity from full color we are fading from            
-                               percent = 1 - percent;  
-                               
                                // Update the overlay opacity
                                $j( '#' + transitionOverlayId  ).show().css( 
'opacity', percent );
                        },
+                       'fadeFromColor': function( _this, percent, $transition, 
smilElement ){
+                               // Invert the percentage since we setting 
opacity from full color we are fading from            
+                               percent = 1 - percent;
+                               
+                               this._doColorOverlay( _this, percent, 
$transition, smilElement );
+                       },
+                       'fadeToColor': function( _this, percent, $transition, 
smilElement ){
+                               this._doColorOverlay( _this, percent, 
$transition, smilElement );                               
+                       },
                        'crossfade': function( _this, percent, $transition, 
smilElement ){
                                // fade "ourselves" ... in cases of overlapping 
timelines this will create a true cross fade
                                $j( '#' + _this.smil.getSmilElementPlayerID( 
smilElement )  ).css( 'opacity', percent );



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to