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

Revision: 69038
Author:   dale
Date:     2010-07-04 23:44:43 +0000 (Sun, 04 Jul 2010)

Log Message:
-----------
sync with kalorg updates
* added getAbsoluteOverlaySpinner for spinner overlay on images and video
* stubs for video clipBegin smil player test

Modified Paths:
--------------
    
branches/MwEmbedStandAlone/modules/EmbedPlayer/binPlayers/kaltura-player/config.xml
    branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js
    branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
    branches/MwEmbedStandAlone/mwEmbed.js

Added Paths:
-----------
    branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoClipBegin.html
    branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoClipBeginSmil.xml

Modified: 
branches/MwEmbedStandAlone/modules/EmbedPlayer/binPlayers/kaltura-player/config.xml
===================================================================
--- 
branches/MwEmbedStandAlone/modules/EmbedPlayer/binPlayers/kaltura-player/config.xml
 2010-07-04 23:40:20 UTC (rev 69037)
+++ 
branches/MwEmbedStandAlone/modules/EmbedPlayer/binPlayers/kaltura-player/config.xml
 2010-07-04 23:44:43 UTC (rev 69038)
@@ -1,4 +1,4 @@
-<layout id="full" name="player" skinPath="assets/skin.swf">
+<layout id="full" skinPath="assets/skin.swf">
   <HBox id="topLevel" width="100%" height="100%">
     <VBox id="player" width="100%" height="100%" styleName="black">
       <Canvas height="100%" width="100%" id="PlayerHolder" styleName="black">

Modified: branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js
===================================================================
--- branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js    2010-07-04 
23:40:20 UTC (rev 69037)
+++ branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js    2010-07-04 
23:44:43 UTC (rev 69038)
@@ -129,30 +129,13 @@
                                if ( $j( element ).attr( "id" ) == '' ) {
                                        $j( element ).attr( "id",  'v' + ( 
rewriteElementCount++ ) );
                                }
-
+                               
                                // Add an absolute positioned loader
-                               var pos = $j( element ).offset();               
                
-                               var posLeft = (  $j( element ).width() ) ? 
-                                       parseInt( pos.left + ( .4 * $j( element 
).width() ) ) : 
-                                       pos.left + 30;
-                                       
-                               var posTop = (  $j( element ).height() ) ? 
-                                       parseInt( pos.top + ( .4 * $j( element 
).height() ) ) : 
-                                       pos.top + 30;
-                                                       
-                               $j('body').append(
-                                       $j('<div />')
-                                       .loadingSpinner()
+                               $j( element )
+                                       .getAbsoluteOverlaySpinner()
                                        .attr('id', 'loadingSpinner_' + $j( 
element ).attr('id') )
-                                       .addClass( 'playerLoadingSpinner' )
-                                       .css({
-                                               'width' : 32,
-                                               'height' : 32,
-                                               'position': 'absolute',
-                                               'top' : posTop + 'px',
-                                               'left' : posLeft + 'px'
-                                       })                                      
        
-                               )
+                                       .addClass( 'playerLoadingSpinner' );
+                                                               
                        });                                                     
                
                        // Load the embedPlayer module ( then run queued hooks 
)                        
                        mw.load( 'EmbedPlayer', function ( ) {          

Modified: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
===================================================================
--- branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js    
2010-07-04 23:40:20 UTC (rev 69037)
+++ branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js    
2010-07-04 23:44:43 UTC (rev 69038)
@@ -390,6 +390,13 @@
                mw.load( playerDependencyRequest, function() {                  
                                        
                        var waitForMeta = true;                                 
                        
+                       // Be sure to "stop" the target ( sometimes firefox 
keeps playing the video even 
+                       // though its been removed from the DOM )               
                        
+                       if( playerElement.pause ){
+                               playerElement.pause();
+                       }
+                                               
+                       
                        // Let extensions determine if its worthwhile to wait 
for metadata:
                        // We pass an object to the trigger to preserve 
reference values                
                        var eventObject = { 
@@ -536,13 +543,14 @@
                                swapPlayerElement[ method ] = playerInterface[ 
method ];
                        }
                }
+               
                // Check if we are using native controls ( should keep the 
video embed around )
                // "wrap" the player interface
                if( playerInterface.useNativeControls() ) {
                        $j( targetElement )
                        .attr('id', playerInterface.pid )
                        .after( 
-                               swapPlayerElement
+                               $j( swapPlayerElement ).css('display', 'none')
                        )
                } else {
                        $j( targetElement ).replaceWith( swapPlayerElement );
@@ -557,10 +565,16 @@
                
                // If we don't already have a loadSpiner add one: 
                if( $j('#loadingSpinner_' + playerInterface.id ).length == 0 ){
-                       $j( swapPlayerElement ).append( 
-                               $j('<div />')
-                               .loadingSpinner()       
-                       );
+                       if( playerInterface.useNativeControls() ) {
+                               $j( targetElement )
+                                       .getAbsoluteOverlaySpinner()
+                                       .attr('id', 'loadingSpinner_' + 
playerInterface.id ) 
+                       }else{
+                               $j( swapPlayerElement ).append( 
+                                       $j('<div />')
+                                       .loadingSpinner()       
+                               );
+                       }
                }
                return true;
        },
@@ -1421,10 +1435,13 @@
                                if( customSource.src ){
                                        var $source = $j('<source />')
                                                .attr( 'src', customSource.src 
);       
-                                       
+                                       // xxx todo pull list of valid source 
attributes from mediaSource prototype
                                        if( customSource.type ){
                                                $source.attr('type', 
customSource.type )
                                        }
+                                       if( customSource.title ){
+                                               $source.attr('title', 
customSource.title );
+                                       }
                                        this.mediaElement.tryAddSource( 
$source.get(0) );
                                }
                        }

Added: branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoClipBegin.html
===================================================================
--- branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoClipBegin.html     
                        (rev 0)
+++ branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoClipBegin.html     
2010-07-04 23:44:43 UTC (rev 69038)
@@ -0,0 +1,72 @@
+<!doctype html>
+<html>
+<head>
+    <title>Video ClipBegin Example</title>
+        <script type="text/javascript" 
src="../../../mwEmbed.js?debug=true"></script> 
+       <!--  <script type="text/javascript" 
src="../../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script> 
-->
+       <script type="text/javascript">
+               mw.setConfig( 'EmbedPlayer.OverlayControls', false );
+               mw.ready(function(){
+                       $j( "#seekInputTime" ).blur( function(){ 
+                               var smilVid = $j('#videoClipBegin').get(0);
+                               $j('#seekInProgress').show();
+                               smilVid.setCurrentTime( parseFloat( 
$j(this).val() ), function() {
+                                       $j('#seekInProgress').hide();
+                               });
+                       });
+                       $j('#startBuffer').click( function(){
+                               $j('#videoClipBegin').get(0).load();
+                               return false;
+                       });
+                       $j('#renderToFile').click(function(){                   
        
+                               $j(this).empty().unbind().after(
+                                       $j('<span />').text( ' ' ),
+                                       $j('<span />').attr('id', 
'targetFoggStatus' )
+                               );
+                               
+                               // xxx for local rendering 'AddMedia.firefogg' 
is overkill 
+                               // but will have to clean up modularity later
+                               
+                               mw.load( 
['AddMedia.firefogg','mw.FirefoggRender'],function(){
+                                       var foggRender = 
$j('#videoClipBegin').firefoggRender({
+                                               'statusTarget': 
'#targetFoggStatus'
+                                       });
+                                       foggRender.doRender();
+
+                                       $j('#renderToFile').text('Stop 
Render').click(function(){
+                                               foggRender.stopRender();        
                                        
+                                       }); 
+                               })
+                               return false;
+                       });
+               });
+       </script>
+</head>
+<body>
+<h3>Sample Video ClipBegin</h3>
+<table>
+<tr>
+<td>
+
+<video id="videoClipBegin" type="application/smil" 
src="VideoClipBeginSmil.xml" width="400" height="300"></video>
+<p></p>seek to <input id="seekInputTime" size="4" value = "6"></input><span 
id="seekInProgress" style="display: none"> Seeking<blink>...</blink></span>
+<br/>
+<a id="startBuffer" href="#">Start buffering</a> <br>
+<a id="renderToFile" href="#">Render to file</a>
+</td>
+<td valign="top">
+Sample playlist code: 
+<div style="clear:both"></div>
+<textarea style="width:500px;">
+<video id="videoClipBegin" type="application/smil" 
src="VideoClipBeginSmil.xml" width="400" height="300"></video>
+</textarea>
+<div style="clear:both"></div>
+
+SMIL Source: 
+<div style="clear:both"></div>
+<iframe  style="width:500px;height:300px" 
src="VideoClipBeginSmil.xml"></iframe>
+</td>
+</tr>
+</table>
+</body>
+</html>

Added: 
branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoClipBeginSmil.xml
===================================================================
--- branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoClipBeginSmil.xml  
                        (rev 0)
+++ branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoClipBeginSmil.xml  
2010-07-04 23:44:43 UTC (rev 69038)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<smil baseProfile="Language" version="3.0" xmlns="http://www.w3.org/ns/SMIL";>
+  <head>
+    <meta name="title" content="Simple Crossfading Example"/>
+    
+    <transition id="fromBlack"
+       type="fade" 
+       subtype="fadeFromColor" 
+       fadeColor="#000" 
+       dur="4s"/>      
+       
+  </head>
+  <body>
+    <seq>
+    
+    <video 
src="http://upload.wikimedia.org/wikipedia/commons/1/14/Independence_Day%2C_1940_Promotion.ogv";
+       transIn="fromBlack"                                     
+               dur="5"         
+       />
+       
+    <video 
src="http://upload.wikimedia.org/wikipedia/commons/9/94/Folgers.ogv";        
+       transIn="fromBlack"             
+               dur="2"
+               clipBegin = "16"
+       />
+       
+       <video 
src="http://upload.wikimedia.org/wikipedia/commons/1/14/Independence_Day%2C_1940_Promotion.ogv";
+       transIn="fromBlack"                                     
+               dur="2"         
+               clipBegin = "16"
+       />
+       
+       <video 
src="http://upload.wikimedia.org/wikipedia/commons/9/94/Folgers.ogv";            
                 
+               dur="3"
+               clipBegin = "16"
+       />
+       
+       <video 
src="http://upload.wikimedia.org/wikipedia/commons/1/14/Independence_Day%2C_1940_Promotion.ogv";
                          
+               dur="2"
+               clipBegin = "18"
+       />      
+       
+    <!-- where does quality come from -->
+       <video 
src="http://upload.wikimedia.org/wikipedia/commons/8/8b/Yochai_Benkler_-_On_Autonomy%2C_Control_and_Cultural_Experience.ogg";
             
+               transIn="fromBlack"
+               dur="27"
+               clipBegin = "0:3:43"
+       />      
+       
+    </seq>
+    
+  </body>
+</smil>
+
+

Modified: branches/MwEmbedStandAlone/mwEmbed.js
===================================================================
--- branches/MwEmbedStandAlone/mwEmbed.js       2010-07-04 23:40:20 UTC (rev 
69037)
+++ branches/MwEmbedStandAlone/mwEmbed.js       2010-07-04 23:44:43 UTC (rev 
69038)
@@ -2154,6 +2154,32 @@
                  */
                                return this;
                        }
+                       /**
+                        * Add an absolute overlay spinner useful for cases 
where the element 
+                        * does not display child elements, ( images, video ) 
+                        */
+                       $.fn.getAbsoluteOverlaySpinner = function(){
+                               var pos = $j( this ).offset();                  
        
+                               var posLeft = (  $j( this ).width() ) ? 
+                                       parseInt( pos.left + ( .4 * $j( this 
).width() ) ) : 
+                                       pos.left + 30;
+                                       
+                               var posTop = (  $j( this ).height() ) ? 
+                                       parseInt( pos.top + ( .4 * $j( this 
).height() ) ) : 
+                                       pos.top + 30;
+                               
+                               var $spinner = $j('<div />')
+                                       .loadingSpinner()                       
        
+                                       .css({
+                                               'width' : 32,
+                                               'height' : 32,
+                                               'position': 'absolute',
+                                               'top' : posTop + 'px',
+                                               'left' : posLeft + 'px'
+                                       });
+                               $j('body').append( $spinner     );
+                               return $spinner;
+                       }
                        
                        /**
                        * dragDrop file loader 



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

Reply via email to