r77318 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77317‎ | r77318 | r77319 >
Date:03:16, 26 November 2010
Author:dale
Status:deferred
Tags:
Comment:
* moved panzoom control to on-top of video player
* stubs to support panzoom on videos ( instead of just images )
Modified paths:
  • /branches/MwEmbedStandAlone/libraries/jquery/plugins/jquery.menu/jquery.menu.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.Sequencer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/remotes/mw.MediaWikiRemoteSequencer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/tools/mw.SequencerTools.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBuffer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js (modified) (history)
  • /branches/MwEmbedStandAlone/mwEmbedFrame.php (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/mwEmbedFrame.php
@@ -9,12 +9,25 @@
1010 * <iframe src="mwEmbedFrame.php?src={SRC URL}&poster={POSTER URL}&width={WIDTH}etc"> </iframe>
1111 */
1212
 13+
1314 // Setup the mwEmbedFrame
1415 $myMwEmbedFrame = new mwEmbedFrame();
1516
 17+// @@TODO temporary HACK to override to kalturaIframe
 18+// ( need to refactor embedFrame into a more abstract class )
 19+// @@TODO Need a php based configuration system for modules so they
 20+// can extend / override entry points
 21+if( isset( $myMwEmbedFrame->kwidgetid ) ){
 22+ require( dirname( __FILE__ ) . '/modules/KalturaSupport/kalturaIframe.php');
 23+ exit(1);
 24+}
 25+
1626 // Do mwEmbedFrame video output:
1727 $myMwEmbedFrame->outputIFrame();
1828
 29+// Direct link list
 30+
 31+
1932 /**
2033 * mwEmbed iFrame class
2134 */
@@ -35,7 +48,7 @@
3649 );
3750 var $playerIframeId = 'iframeVid';
3851 var $debug = false;
39 -
 52+
4053 // When used in direct source mode the source asset.
4154 // NOTE: can be an array of sources in cases of "many" sources set
4255 var $sources = array();
@@ -44,29 +57,30 @@
4558 //parse input:
4659 $this->parseRequest();
4760 }
48 -
 61+
4962 // Parse the embedFrame request and sanitize input
5063 private function parseRequest(){
51 - // Check for / attribute type request and update "REQUEST" global
 64+ // Check for / attribute type request and update "REQUEST" global
5265 // ( uses kaltura standard entry_id/{entryId} request )
5366 // normalize to the REQUEST object
54 - // @@FIXME: this should be moved over to a kaltura specific iframe implementation
55 - if( $_SERVER['REQUEST_URI'] ){
56 - $kalturaUrlMap = Array(
 67+ // @@FIXME: this should be moved over to a kaltura specific iframe implementation
 68+ if( $_SERVER['PATH_INFO'] ){
 69+ $kalturaUrlMap = Array(
5770 'entry_id' => 'kentryid',
5871 'uiconf_id' => 'kuiconfid',
5972 'wid' => 'kwidgetid',
6073 'playlist_id' => 'kplaylistid'
6174 );
62 - $urlParts = explode( '/', $_SERVER['REQUEST_URI'] );
 75+ $urlParts = explode( '/', $_SERVER['PATH_INFO'] );
6376 foreach( $urlParts as $inx => $urlPart ){
6477 foreach( $kalturaUrlMap as $urlKey => $reqeustAttribute ){
65 - if( $urlPart == $reqeustAttribute && isset( $urlParts[$inx+1] ) ){
 78+ if( $urlPart == $urlKey && isset( $urlParts[$inx+1] ) ){
6679 $_REQUEST[ $reqeustAttribute ] = $urlParts[$inx+1];
6780 }
6881 }
6982 }
7083 }
 84+
7185 // Check for attributes
7286 foreach( $this->playerAttributes as $attributeKey){
7387 if( isset( $_REQUEST[ $attributeKey ] ) ){
@@ -78,7 +92,7 @@
7993 if( isset( $_REQUEST['debug'] ) ){
8094 $this->debug = true;
8195 }
82 -
 96+
8397 // Process the special "src" attribute
8498 if( isset( $_REQUEST['src'] ) ){
8599 if( is_array( $_REQUEST['src'] ) ){
@@ -89,10 +103,10 @@
90104 $this->sources = array( htmlspecialchars( $_REQUEST['src'] ) );
91105 }
92106 }
93 -
 107+
94108 }
95109 private function getVideoTag( ){
96 - // Add default video tag with 100% width / height
 110+ // Add default video tag with 100% width / height
97111 // ( parent embed is responsible for setting the iframe size )
98112 $o = '<video id="' . htmlspecialchars( $this->playerIframeId ) . '" style="width:100%;height:100%"';
99113 foreach( $this->playerAttributes as $attributeKey){
@@ -110,12 +124,12 @@
111125 }
112126 $o.= '</video>';
113127 return $o;
114 - }
115 -
 128+ }
 129+
116130 function outputIFrame( ){
117131 // Setup the embed string based on attribute set:
118132 $embedResourceList = 'window.jQuery,mwEmbed,mw.style.mwCommon,$j.fn.menu,mw.style.jquerymenu,mw.EmbedPlayer,mw.EmbedPlayerNative,mw.EmbedPlayerJava,mw.PlayerControlBuilder,$j.fn.hoverIntent,mw.style.EmbedPlayer,$j.cookie,$j.ui,mw.style.ui_redmond,$j.widget,$j.ui.mouse,mw.PlayerSkinKskin,mw.style.PlayerSkinKskin,mw.TimedText,mw.style.TimedText,$j.ui.slider';
119 -
 133+
120134 if( isset( $this->kentryid ) ){
121135 $embedResourceList.= ',' . implode(',', array(
122136 'KalturaClientBase',
@@ -125,7 +139,7 @@
126140 'KalturaAccessControl',
127141 'MD5',
128142 'mw.KWidgetSupport',
129 - 'mw.KAnalytics',
 143+ 'mw.KAnalytics',
130144 'mw.KDPMapping',
131145 'mw.MobileAdTimeline',
132146 'mw.KAds'
@@ -145,18 +159,18 @@
146160 left:0px;
147161 bottom:0px;
148162 right:0px;
149 -
 163+ overflow:hidden;
150164 }
151165 </style>
152 - <script type="text/javascript" src="<?php echo str_replace( 'mwEmbedFrame.php', '', $_SERVER['SCRIPT_NAME'] ); ?>ResourceLoader.php?class=<?php
153 - // @@TODO we should move this over to using the mwEmbedLoader.js so we don't have to mannage the resource list in two places.
154 - // ( this will matter less once we migrate to the new mediaWiki resource loader framework)
 166+ <script type="text/javascript" src="<?php echo str_replace( 'mwEmbedFrame.php', '', $_SERVER['SCRIPT_NAME'] ); ?>ResourceLoader.php?class=<?php
 167+ // @@TODO we should move this over to using the mwEmbedLoader.js so we don't have to mannage the resource list in two places.
 168+ // ( this will matter less once we migrate to the new mediaWiki resource loader framework)
155169 echo $embedResourceList;
156170 if( $this->debug ){
157171 echo '&debug=true';
158 - }
 172+ }
159173 ?>"></script>
160 -
 174+
161175 <script type="text/javascript">
162176 //Set some iframe embed config:
163177 // We can't support full screen in object context since it requires outer page DOM control
@@ -164,21 +178,21 @@
165179
166180 // Enable the iframe player server:
167181 mw.setConfig( 'EmbedPlayer.EnableIFramePlayerServer', true );
168 -
 182+
169183 mw.ready(function(){
170 - // Bind window resize to reize the player:
 184+ // Bind window resize to reize the player:
171185 $j(window).resize(function(){
172186 $j( '#<?php echo htmlspecialchars( $this->playerIframeId )?>' )
173187 .get(0).resizePlayer({
174188 'width' : $j(window).width(),
175189 'height' : $j(window).height()
176 - });
 190+ });
177191 });
178192 });
179193 </script>
180 -
 194+
181195 </head>
182 - <body>
 196+ <body>
183197 <?
184198 // Check if we have a way to get sources:
185199 if( isset( $this->apiTitleKey ) || isset( $this->kentryid ) || count( $this->sources ) != 0 ) {
@@ -186,7 +200,7 @@
187201 } else {
188202 echo "Error: mwEmbedFrame missing required parameter for video sources</body></html>";
189203 exit(1);
190 - }
 204+ }
191205 ?>
192206 </body>
193207 </html>
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js
@@ -416,7 +416,7 @@
417417 this.smil.getBuffer().loadElement( $node );
418418 // xxx check if the type is "video or audio" else nothing to return
419419
420 - var vid = $j( '#' + this.smil.getSmilElementPlayerID( $node ) ).get(0);
 420+ var vid = $j( '#' + this.smil.getSmilElementPlayerID( $node ) ).find('audio,video').get(0);
421421 if( vid.duration ){
422422 callback( vid.duration );
423423 }
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js
@@ -126,33 +126,34 @@
127127 var _this = this;
128128 mw.log('SmilLayout:: drawPlayerSmilElement: ' );
129129 var smilType = this.smil.getRefType( smilElement );
 130+
 131+ // Give the static content a getSmilElementPlayerID for player layer control
 132+ var $target = $j('<div />')
 133+ .attr('id', _this.smil.getSmilElementPlayerID( smilElement ) )
 134+ .css({
 135+ 'width':'100%',
 136+ 'height':'100%',
 137+ 'position' : 'absolute',
 138+ 'top' : '0px',
 139+ 'left' : '0px'
 140+ })
 141+ $regionTarget.append( $target );
 142+
130143 switch( smilType ){
131144 // Static content can use drawSmilElementToTarget function:
132145 case 'mwtemplate':
133146 case 'img':
134147 case 'cdata_html':
135148 case 'smiltext':
136 - // Give the static content a getSmilElementPlayerID for player layer control
137 - var $target = $j('<div />')
138 - .attr('id', _this.smil.getSmilElementPlayerID( smilElement ) )
139 - .css({
140 - 'width':'100%',
141 - 'height':'100%',
142 - 'position' : 'absolute',
143 - 'top' : '0px',
144 - 'left' : '0px'
145 - })
146 - $regionTarget.append( $target );
147149 this.drawSmilElementToTarget( smilElement, $target );
148150 return ;
149151 break;
150152 case 'video':
151 - $regionTarget.append( this.getSmilVideoPlayerHtml( smilElement ) );
 153+ $target.append( this.getSmilVideoPlayerHtml( smilElement ) );
152154 return ;
153155 break;
154 - break;
155156 case 'audio':
156 - $regionTarget.append( this.getSmilAudioPlayerHtml( smilElement ) );
 157+ $target.append( this.getSmilAudioPlayerHtml( smilElement ) );
157158 return ;
158159 break;
159160 }
@@ -356,7 +357,6 @@
357358 getSmilVideoPlayerHtml: function( smilElement ){
358359 return $j('<video />')
359360 .attr( {
360 - 'id' : this.smil.getSmilElementPlayerID( smilElement ),
361361 'src' : this.smil.getAssetUrl( $j( smilElement ).attr( 'src' ) )
362362 } )
363363 .addClass( 'smilFillWindow' )
@@ -368,7 +368,6 @@
369369 getSmilAudioPlayerHtml: function ( smilElement ){
370370 return $j('<audio />')
371371 .attr( {
372 - 'id' : this.smil.getSmilElementPlayerID( smilElement ),
373372 'src' : this.smil.getAssetUrl( $j( smilElement ).attr( 'src' ) )
374373 } )
375374 .css( {
@@ -616,24 +615,30 @@
617616 _this.doAssetLayout( smilElement , naturalSize);
618617 });
619618 },
620 - // xxx should really use a callback instead of failing if the media is not
621 - // loaded
622 - getNaturalSize: function( img , callback){
 619+
 620+ /**
 621+ * Get the natural size of a media asset
 622+ * @param img
 623+ * @param callback
 624+ * @return
 625+ */
 626+ getNaturalSize: function( media , callback){
623627 // note this just works for images atm
624 - if( !img ){
 628+ if( !media ){
625629 mw.log("Error getNaturalSize for null image ");
626630 callback( false );
 631+ return ;
627632 }
628 - if( img.naturalWidth ){
 633+ if( media.naturalWidth ){
629634 callback( {
630 - 'width' : img.naturalWidth,
631 - 'height' : img.naturalHeight
 635+ 'width' : media.naturalWidth,
 636+ 'height' : media.naturalHeight
632637 } )
633638 } else {
634 - $j( img ).load(function(){
 639+ $j( media ).load(function(){
635640 callback( {
636 - 'width' : this.naturalWidth,
637 - 'height' : this.naturalHeight
 641+ 'width' : media.naturalWidth,
 642+ 'height' : media.naturalHeight
638643 } )
639644 });
640645 }
@@ -728,18 +733,18 @@
729734 /**
730735 * layout function
731736 */
732 - panZoomLayout: function( smilElement, $target, img ){
 737+ panZoomLayout: function( smilElement, $target, layoutElement ){
733738 var _this = this;
734739 //mw.log( 'panZoomLayout:' + $j( smilElement).attr('id') );
735740 var panZoom = $j( smilElement).attr('panZoom').split(',');
736 - if( !img ){
737 - var img = $j( '#' + this.smil.getSmilElementPlayerID( smilElement ) ).find('img').get(0);
738 - if( !img){
739 - mw.log('Error getting image for ' + $j( smilElement).attr('id') );
 741+ if( !layoutElement ){
 742+ var layoutElement = $j( '#' + this.smil.getSmilElementPlayerID( smilElement ) ).find('img,video').get(0);
 743+ if( !layoutElement){
 744+ mw.log('Error getting layoutElement for ' + $j( smilElement).attr('id') );
740745 }
741746 }
742747
743 - _this.getNaturalSize( img, function( natrualSize ){
 748+ _this.getNaturalSize( layoutElement, function( natrualSize ){
744749 // Check if the transfrom is needed:
745750 if( parseInt( panZoom.left ) == 0
746751 &&
@@ -758,7 +763,7 @@
759764 var percentValues = _this.smil.getAnimate().getPercentFromPanZoomValues( panZoom, natrualSize );
760765 //mw.log('panZoomLayout::' + 'l:' + percentValues.left + ' t:' + percentValues.top + ' w:' + percentValues.width + ' h:' + percentValues.height );
761766 // Update the layout via the animation engine updateElementLayout method
762 - _this.smil.getAnimate().updateElementLayout( smilElement, percentValues, $target, img );
 767+ _this.smil.getAnimate().updateElementLayout( smilElement, percentValues, $target, layoutElement );
763768 });
764769 },
765770 /**
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js
@@ -28,7 +28,8 @@
2929 switch( this.smil.getRefType( smilElement ) ){
3030 case 'video':
3131 case 'audio':
32 - $j ( '#' + this.smil.getSmilElementPlayerID( smilElement ) ).get( 0 ).pause();
 32+ $j ( '#' + this.smil.getSmilElementPlayerID( smilElement ) )
 33+ .find('audio,video').get( 0 ).pause();
3334 break;
3435 }
3536 // non-video elements just pause by clearing any animation loops
@@ -51,7 +52,8 @@
5253 switch( _this.smil.getRefType( smilElement ) ){
5354 case 'auido':
5455 case 'video':
55 - var media = $j ( '#' + _this.smil.getSmilElementPlayerID( smilElement ) ).get( 0 );
 56+ var media = $j ( '#' + _this.smil.getSmilElementPlayerID( smilElement ) )
 57+ .find('audio,video').get( 0 );
5658 var mediaTime = ( !media || !media.currentTime )? 0 : media.currentTime;
5759 //mw.log( "getPlaybackSyncDelta:: mediaeo time should be: " + relativeTime + ' video time is: ' + vidTime );
5860
@@ -236,7 +238,7 @@
237239 transformMediaForTime: function( smilElement, animateTime, callback ){
238240 // Get the video element
239241 var assetId = this.smil.getSmilElementPlayerID( smilElement );
240 - var media = $j ( '#' + assetId ).get( 0 );
 242+ var media = $j( assetId ).find('audio,video').get( 0 );
241243 if( !media ){
242244 mw.log("Error: transformMediaForTime could not find media asest: " +assetId );
243245 }
@@ -268,7 +270,7 @@
269271 $j( smilElement ).data('activePlayback', true)
270272
271273 // Make the video is being displayed and get a pointer to the video element:
272 - var media = $media.show().get( 0 );
 274+ var media = $media.show().find('audio,video').get( 0 );
273275
274276 // Set volume to master volume
275277 media.volume = this.smil.embedPlayer.volume;
@@ -419,7 +421,7 @@
420422 // NOTE this is dependent on the media being "loaded" and having natural width and height
421423 this.smil.getLayout().getNaturalSize(smilImgElement, function( naturalSize ){
422424 var percentValues = _this.getPercentFromPanZoomValues( targetValue, naturalSize );
423 - // Now we have "hard" layout info try and render it.
 425+ // Now we have naturalSize layout info try and render it.
424426 _this.updateElementLayout( smilImgElement, percentValues );
425427 });
426428 },
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js
@@ -62,6 +62,9 @@
6363 this.setCurrentTime( this.smilPlayTime, function(){
6464 mw.log("EmbedPlayerSmil::doEmbedHTML:: render callback ready " );
6565 });
 66+
 67+ // Be sure the interface does not have black background
 68+ this.$interface.css('background', 'none');
6669 },
6770
6871 /**
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBuffer.js
@@ -15,10 +15,10 @@
1616 assetLoadingCallbacks : [],
1717
1818 // Stores the percentage loaded of active video elements
19 - videoLoadedPercent: {},
 19+ mediaLoadedPercent: {},
2020
2121 // Stores seek listeners for active video elements
22 - videoSeekListeners: {},
 22+ mediaSeekListeners: {},
2323
2424 // Stores the previous percentage buffered ( so we know what elements to check )
2525 prevBufferPercent : 0,
@@ -162,7 +162,8 @@
163163 switch( this.smil.getRefType( smilElement ) ){
164164 case 'audio':
165165 case 'video':
166 - var media = $j( '#' + this.smil.getSmilElementPlayerID( smilElement ) ).get(0);
 166+ var media = $j( '#' + this.smil.getSmilElementPlayerID( smilElement ) )
 167+ .find('audio,video').get(0);
167168 if( !media ){
168169 break;
169170 }
@@ -209,42 +210,41 @@
210211 getMediaPercetLoaded: function ( smilElement ){
211212 var _this = this;
212213 var assetId = this.smil.getSmilElementPlayerID( smilElement );
213 - var $vid = $j( '#' + assetId );
 214+ var $media = $j( '#' + assetId ).find('audio,video');
214215
215216 // if the asset is not in the DOM return zero:
216 - if( $vid.length == 0 ){
 217+ if( $media.length == 0 ){
217218 return 0 ;
218219 }
219220 // check if 100% has already been loaded:
220 - if( _this.videoLoadedPercent[ assetId ] == 1 ){
 221+ if( _this.mediaLoadedPercent[ assetId ] == 1 ){
221222 return 1;
222223 }
223224
224225 // Check if we have a loader registered
225 - if( !this.videoLoadedPercent[ assetId ] ){
 226+ if( !this.mediaLoadedPercent[ assetId ] ){
226227 // firefox loading based progress indicator:
227 - $vid.unbind('progress').bind('progress', function( e ) {
228 - // jQuery does not copy over the eventData .loaded and .total
 228+ $media.unbind('progress').bind('progress', function( e ) {
229229 var eventData = e.originalEvent;
230230 //mw.log("Video loaded progress:" + assetId +' ' + (eventData.loaded / eventData.total ) );
231231 if( eventData.loaded && eventData.total ) {
232 - _this.videoLoadedPercent[assetId] = eventData.loaded / eventData.total;
 232+ _this.mediaLoadedPercent[assetId] = eventData.loaded / eventData.total;
233233 }
234234 })
235235 }
236236
237 - // Set up reference to video object:
238 - var vid = $vid.get(0);
 237+ // Set up reference to media object:
 238+ var media = $media.get(0);
239239 // Check for buffered attribute ( not all browsers support the progress event )
240 - if( vid && vid.buffered && vid.buffered.end && vid.duration ) {
241 - _this.videoLoadedPercent[ assetId ] = ( vid.buffered.end(0) / vid.duration);
 240+ if( media && media.buffered && media.buffered.end && media.duration ) {
 241+ _this.mediaLoadedPercent[ assetId ] = ( media.buffered.end(0) / media.duration);
242242 }
243243
244 - if( !_this.videoLoadedPercent[ assetId ] ){
 244+ if( !_this.mediaLoadedPercent[ assetId ] ){
245245 return 0;
246246 } else {
247 - // Return the updated videoLoadedPercent
248 - return _this.videoLoadedPercent[ assetId ];
 247+ // Return the updated mediaLoadedPercent
 248+ return _this.mediaLoadedPercent[ assetId ];
249249 }
250250 },
251251
@@ -297,12 +297,12 @@
298298 * Clip ready for grabbing a frame such as a canvas thumb
299299 */
300300 bufferedSeekRelativeTime: function( smilElement, relativeTime, callback ){
301 - mw.log("SmilBuffer::bufferedSeekRelativeTime:" + this.smil.getSmilElementPlayerID( smilElement ) + ' time:' + relativeTime );
302 -
303301 var absoluteTime = relativeTime;
304302 if( $j( smilElement ).attr('clipBegin') ){
305303 absoluteTime += this.smil.parseTime( $j( smilElement ).attr('clipBegin') );
306304 }
 305+ mw.log("SmilBuffer::bufferedSeekRelativeTime:" + this.smil.getSmilElementPlayerID( smilElement ) + ' relativeTime: ' + relativeTime + ' absoluteTime:' + absoluteTime );
 306+
307307 $j( smilElement ).data('activeSeek', true);
308308 var instanceCallback = function(){
309309 $j( smilElement ).data('activeSeek', false);
@@ -340,31 +340,31 @@
341341 // by default return true
342342 return true;
343343 },
344 -
 344+
345345 /**
346346 * Register a video loading progress indicator and check the time against the requested time
347347 */
348348 canPlayMediaTime: function( smilVideoElement, time ){
349349 var _this = this;
350350 var assetId = this.smil.getSmilElementPlayerID( smilVideoElement );
351 - var $vid = $j( '#' + assetId );
 351+ var $media = $j( '#' + assetId ).find('audio,video');
352352 var vid = $j( '#' + assetId ).get( 0 );
353353 // if the video element is not in the dom its not ready:
354 - if( $vid.length == 0 || !$vid.get(0) ){
 354+ if( $media.length == 0 || !$media.get(0) ){
355355 return false;
356356 }
357357 /* if we have no metadata return false */
358 - if( $vid.attr('readyState') == 0 ){
 358+ if( $media.attr('readyState') == 0 ){
359359 return false;
360360 }
361361 /* if we are asking about a time close to the current time use ready state */
362 - if( Math.abs( $vid.attr('currentTime') - time ) < 1 ){
 362+ if( Math.abs( $media.attr('currentTime') - time ) < 1 ){
363363 // also see: http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-have_metadata
364 - if( $vid.attr('readyState') > 2 ){
 364+ if( $media.attr('readyState') > 2 ){
365365 return true;
366366 }
367367 }
368 - // Check if _this.videoLoadedPercent is in range of duration
 368+ // Check if _this.mediaLoadedPercent is in range of duration
369369 // xxx might need to take into consideration startOfsset
370370 if( _this.getMediaPercetLoaded( smilVideoElement ) > vid.duration / time ){
371371 return true;
@@ -382,8 +382,8 @@
383383 var vid = $j ( '#' + assetId).get(0);
384384 vid.addEventListener( 'seeked', function(){
385385 // Run the callback
386 - if( _this.videoSeekListeners[ assetId ].callback ) {
387 - _this.videoSeekListeners[ assetId ].callback();
 386+ if( _this.mediaSeekListeners[ assetId ].callback ) {
 387+ _this.mediaSeekListeners[ assetId ].callback();
388388 }
389389 }, false);
390390 },
@@ -419,27 +419,26 @@
420420
421421 // Make sure the target video is in the dom:
422422 this.loadElement( smilElement );
423 -
424 - var $vid = $j ( '#' + assetId);
425 - var vid = $vid.get(0);
 423+ var $media = $j( '#' + assetId ).find('audio,video');
 424+ var media = $media.get(0);
426425 // Add the asset to the loading set (if not there already )
427 - _this.addAssetLoading( $vid.attr('id' ) );
 426+ _this.addAssetLoading( assetId );
428427 var seekCallbackDone = false;
429428 var runSeekCallback = function(){
430429
431430 // Register an object for the current asset seek Listener
432 - if( ! _this.videoSeekListeners[ assetId ] ){
433 - _this.videoSeekListeners[ assetId ]= {};
 431+ if( ! _this.mediaSeekListeners[ assetId ] ){
 432+ _this.mediaSeekListeners[ assetId ]= {};
434433 };
435434
436 - if( ! _this.videoSeekListeners[ assetId ].listen ){
437 - _this.videoSeekListeners[ assetId ].listen = true;
 435+ if( ! _this.mediaSeekListeners[ assetId ].listen ){
 436+ _this.mediaSeekListeners[ assetId ].listen = true;
438437 _this.registerVideoSeekListener( assetId );
439438 }
440439 // Update the current context callback
441 - _this.videoSeekListeners[ assetId ].callback = function(){
 440+ _this.mediaSeekListeners[ assetId ].callback = function(){
442441 // Seek has completed open up seek Listeners for future seeks
443 - _this.videoSeekListeners[ assetId ].listen = false;
 442+ _this.mediaSeekListeners[ assetId ].listen = false;
444443
445444 // Set this asset to ready ( asset ready set )
446445 _this.assetReady( assetId );
@@ -454,16 +453,16 @@
455454
456455 // Issue the seek if the vid still exists
457456 try{
458 - vid.currentTime = seekTime;
 457+ media.currentTime = seekTime;
459458 } catch ( e ){
460459 mw.log( 'Error: in SmilBuffer could not set currentTime' );
461460 }
462461 }
463462
464463 // Read the video state: http://www.w3.org/TR/html5/video.html#dom-media-have_nothing
465 - if( $vid.attr('readyState') == 0 /* HAVE_NOTHING */ ){
 464+ if( $media.attr('readyState') == 0 /* HAVE_NOTHING */ ){
466465 // Check that we have metadata ( so we can issue the seek )
467 - $vid.unbind( 'loadedmetadata' ).bind( 'loadedmetadata', function(){
 466+ $media.unbind( 'loadedmetadata' ).bind( 'loadedmetadata', function(){
468467 runSeekCallback();
469468 } );
470469 }else {
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -362,6 +362,7 @@
363363 return ;
364364 // If we don't have a native player don't wait for metadata
365365 if( !mw.EmbedTypes.players.isSupportedPlayer( 'oggNative') &&
 366+ !mw.EmbedTypes.players.isSupportedPlayer( 'webmNative') &&
366367 !mw.EmbedTypes.players.isSupportedPlayer( 'h264Native' ) )
367368 {
368369 return false;
@@ -1539,6 +1540,7 @@
15401541 } else {
15411542 this.controlBuilder.resizePlayer( size, animate);
15421543 }
 1544+ $j( this ).trigger( 'onResizePlayer', size )
15431545 },
15441546
15451547 /**
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.Sequencer.js
@@ -1,5 +1,4 @@
22 /**
3 - * Main Sequence Editor Driver
43 */
54
65 mw.includeAllModuleMessages();
@@ -12,7 +11,7 @@
1312 $.fn.sequencer = function( options ) {
1413 // Debugger
1514 if( $j( this.selector ).length == 0 ){
16 - mw.log("Sequencer::Error missing target container");
 15+ mw.log("mw.Sequencer::Error missing target container");
1716 return;
1817 }
1918 var seqContainer = $j( this.selector ).get(0);
@@ -47,7 +46,7 @@
4847 };
4948 } )( jQuery );
5049
51 -//Wrap in mw closure to avoid global leakage
 50+// Wrap in mw closure to avoid global variables
5251 ( function( mw ) {
5352
5453 /**
Index: branches/MwEmbedStandAlone/modules/Sequencer/tools/mw.SequencerTools.js
@@ -35,7 +35,7 @@
3636 'panzoom' : {
3737 'editWidgets' : ['panzoom'],
3838 'editableAttributes' : [ 'panZoom' ],
39 - 'contentTypes': [ 'img'], // xxx todo add video support
 39+ 'contentTypes': [ 'img', 'video' ],
4040 'supportsKeyFrames' : 'true'
4141 },
4242 'templateedit' : {
@@ -280,6 +280,7 @@
281281 'editType' : 'hidden'
282282 }
283283 }
 284+ // crossfade presently not supported
284285 /*,
285286 'crossfade' : {
286287 'extends': 'fade',
@@ -334,7 +335,7 @@
335336 getBindedTranstionEdit: function( _this, smilElement, transitionType ){
336337 var _editTransitions = this;
337338 var $editTransitionsSet = $j('<div />');
338 - // return the empty div on empty transtionType
 339+ // Return the empty div on empty transtionType
339340 if( transitionType == '' ){
340341 return $editTransitionsSet
341342 }
@@ -490,7 +491,6 @@
491492 }
492493 }
493494 },
494 -
495495 'onChange': function( _this, smilElement ){
496496 // Update the sequence duration :
497497 _this.sequencer.getEmbedPlayer().getDuration( true );
@@ -674,16 +674,20 @@
675675 )
676676 // Register the change for undo redo
677677 _this.sequencer.getActionsEdit().registerEdit();
678 - },
 678+ },
679679 'draw': function( _this, target, smilElement ){
680680 var orginalHelperCss = {
681681 'position' : 'absolute',
682 - 'width' : 100,
683 - 'height' : 75,
684 - 'top' : 50,
685 - 'left' : 70,
686 - 'font-size' : 'x-small'
 682+ 'width' : 120,
 683+ 'height' : 100,
 684+ 'color' : 'red',
 685+ 'font-size' : 'x-small',
 686+ 'opacity' : .6,
 687+ 'border' : 'dashed',
 688+ 'left' : _this.sequencer.getEmbedPlayer().getPlayerWidth()/2 - 60,
 689+ 'top' : _this.sequencer.getEmbedPlayer().getPlayerHeight()/2 - 50
687690 };
 691+
688692 // Add a input box binding:
689693 $j('#' +_this.getEditToolInputId( 'panzoom', 'panZoom'))
690694 .change(function(){
@@ -694,45 +698,58 @@
695699 $j('<h3 />').html(
696700 gM('mwe-sequencer-tools-panzoomhelper-desc')
697701 )
698 - ,
699 - /*xxx Keep aspect button ?*/
700 - // Rest layout button ( restores default position )
701 - $j.button({
702 - 'icon' : 'arrow-4',
703 - 'text' : gM( 'mwe-sequencer-tools-panzoomhelper-resetlayout' )
704 - })
705 - .attr('id', 'panzoomResetLayout')
706 - .css('float', 'left')
707 - .hide()
708 - .click(function(){
709 - // Restore default SMIL setting
710 - _this.editableTypes['display'].update(
711 - _this,
712 - smilElement,
713 - 'panzoom',
714 - _this.editableAttributes['panzoom'].defaultValue
715 - )
716 - })
717 - ,
 702+ );
 703+ var $playerUI = _this.sequencer.getEmbedPlayer().$interface;
 704+ // Remove any old layout helper:
 705+ $playerUI.find('.panzoomHelper').remove();
 706+
 707+ // Append the resize helper as an overlay on the player:
 708+ $playerUI.append(
718709 $j('<div />')
719 - .css({
720 - 'border' : '1px solid #DDDDDD',
721 - 'float' : 'left',
722 - 'position' : 'relative',
723 - 'width': '240px',
724 - 'height' : '180px',
725 - 'overflow' : 'hidden'
726 - })
727 - .append(
728 - $j('<div />')
729 - .css( orginalHelperCss )
730 - .attr({
731 - 'id': "panzoomHelper"
732 - })
733 - .addClass("ui-widget-content")
734 - .text( gM('mwe-sequencer-tools-panzoomhelper') )
 710+ .css( orginalHelperCss )
 711+ .addClass("ui-widget-content panzoomHelper")
 712+ .text( gM('mwe-sequencer-tools-panzoomhelper') )
 713+ );
 714+
 715+ // Only show when the panzoom tool is selected
 716+ if( _this.getCurrentToolId() != 'panzoom'){
 717+ $playerUI.find('.panzoomHelper').hide()
 718+ }
 719+ $j(_this).bind('toolSelect', function(){
 720+ if( _this.getCurrentToolId() == 'panzoom'){
 721+ $playerUI.find('.panzoomHelper').fadeIn('fast')
 722+ } else {
 723+ $playerUI.find('.panzoomHelper').fadeOut('fast')
 724+ }
 725+ });
 726+ // Bind to resize player events to keep the helper centered
 727+ $j( _this.sequencer.getEmbedPlayer() ).bind('onResizePlayer', function(event, size){
 728+ $playerUI.find('.panzoomHelper').css( {
 729+ 'left' : size.width/2 - 60,
 730+ 'top' : size.height/2 - 50
 731+ });
 732+ });
 733+
 734+
 735+ /*xxx Keep aspect button ?*/
 736+ // Rest layout button ( restores default position )
 737+ /*$j.button({
 738+ 'icon' : 'arrow-4',
 739+ 'text' : gM( 'mwe-sequencer-tools-panzoomhelper-resetlayout' )
 740+ })
 741+ .attr('id', 'panzoomResetLayout')
 742+ .css('float', 'left')
 743+ .hide()
 744+ .click(function(){
 745+ // Restore default SMIL setting
 746+ _this.editableTypes['display'].update(
 747+ _this,
 748+ smilElement,
 749+ 'panzoom',
 750+ _this.editableAttributes['panzoom'].defaultValue
735751 )
736 - );
 752+ })*/
 753+
737754 var startPanZoomVal = '';
738755 var setStartPanZoomVal = function(){
739756 startPanZoomVal = $j( smilElement ).attr( 'panZoom');
@@ -781,7 +798,7 @@
782799 );
783800 }
784801 // Add bindings
785 - $j('#panzoomHelper')
 802+ $playerUI.find('.panzoomHelper')
786803 .draggable({
787804 containment: 'parent',
788805 start: function( event, ui){
@@ -804,8 +821,8 @@
805822 .css('cursor', 'move')
806823 .resizable({
807824 handles : 'all',
808 - maxWidth : 170,
809 - maxHeight: 130,
 825+ maxWidth : 250,
 826+ maxHeight: 180,
810827 aspectRatio: 4/3,
811828 start: function( event, ui){
812829 setStartPanZoomVal();
@@ -986,10 +1003,6 @@
9871004 })
9881005 );
9891006 });
990 - // On resize event
991 -
992 - // Fill in timeline images
993 -
9941007 }
9951008 }
9961009 },
@@ -1134,6 +1147,8 @@
11351148 $toolsContainer.tabs({
11361149 select: function(event, ui) {
11371150 _this.setCurrentToolId( $j( ui.tab ).attr('href').replace('#tooltab_', '') );
 1151+ // trigger select tool event:
 1152+ $j( _this ).trigger( 'toolSelect' );
11381153 },
11391154 selected : toolTabIndex
11401155 });
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js
@@ -224,7 +224,6 @@
225225 trackRendering = true;
226226 thumbRenderStack++;
227227 // Update the timeline clip layout
228 - mw.log("getTrackClipInterface::bufferedSeekRelativeTime for " + smil.getSmilElementPlayerID( smilElement ));
229228 _this.drawClipThumb( smilElement , 0, function(){
230229 // Clip is ready decrement the thum render queue
231230 thumbRenderStack--;
Index: branches/MwEmbedStandAlone/modules/Sequencer/remotes/mw.MediaWikiRemoteSequencer.js
@@ -75,7 +75,7 @@
7676 // pause event should fire
7777 mw.remoteSequencerAddEditOverlay( embedPlayerId );
7878
79 - // show the credits screen after 3 seconds 1/2 seconds
 79+ // show the credits screen after 3.5 seconds
8080 setTimeout(function(){
8181 $j( embedPlayer ).siblings( '.kalturaEditOverlay' ).fadeOut( 'fast' );
8282 embedPlayer.$interface.find('.k-menu').fadeIn('fast');
Index: branches/MwEmbedStandAlone/libraries/jquery/plugins/jquery.menu/jquery.menu.js
@@ -92,7 +92,7 @@
9393 var menu = this;
9494 var caller = $(caller);
9595
96 - mw.log( 'target container: ' + options.targetMenuContainer );
 96+ mw.log( 'jQuery.Menu:: target container: ' + options.targetMenuContainer );
9797
9898 var callerClassList = 'fg-menu-container ui-widget ui-widget-content ui-corner-all';
9999 if( options.targetMenuContainer ) {

Status & tagging log