r44924 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44923‎ | r44924 | r44925 >
Date:06:46, 23 December 2008
Author:dale
Status:deferred
Tags:
Comment:
some cross browser video player fixes, stream interface updates
Modified paths:
  • /trunk/extensions/MetavidWiki/skins/mv_embed/cortado_iframe.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_flashEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_vlcEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_stream.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/skins/mv_stream.js
@@ -108,40 +108,10 @@
109109 //current range or search parameter
110110 stream_current_context =$j('#mv_stream_time').html();
111111 js_log('set org_vid_time_req: ' + org_vid_time_req );
112 -
113 - ebvid = $j('#embed_vid').get(0);
114 - ebvid['inheritEmbedOverride']=function(){
115 - js_log('inheritEmbedOverride');
116 - //overide play button action to interface control:
117 - $j('#big_play_link_embed_vid').attr('href', 'javascript:mv_do_play();');
118 - //extend stop button on mv_embed:
119 - //js_log("pre stop: " +ebvid['stop'].toString() );
120 - /*if(ebvid['stop'].toString()!='function(){mv_do_stop();}'){
121 - ebvid['org_eb_stop'] = ebvid['stop'];
122 - ebvid['stop'] = function(){mv_do_stop();}
123 - }*/
124 - /*if(ebvid['pause'].toString()!='function(){mv_pause();}'){
125 - if(!ebvid['org_eb_pause'])
126 - ebvid['org_eb_pause'] = ebvid['pause'];
127 - ebvid['pause'] = function(){mv_pause();}
128 - }*/
129 - //use mvd images for time updates (avoids lots of arbitrary time hits to server)
130 - if(ebvid['updateThumbPerc'].toString()!='function(){return true;}'){
131 - ebvid['updateThumbPerc']=function(){return true;}
132 - }
133 -
134 - /*if(ebvid['showVideoDownload'].toString!='function(){mv_doShowVideoDownload();}'){
135 - ebvid['org_showVideoDownload'] = ebvid['showVideoDownload'];
136 - ebvid['showVideoDownload'] = function(){mv_doShowVideoDownload();}
137 - }*/
138 - //setup text scroll monitor:
139 - mv_doTextScrollMonitor();
140 - //js_log("post stop: " +ebvid['stop'].toString());
141 - }
142 - //call stop override
143 - ebvid.inheritEmbedOverride();
144 - //js_log('stop: '+ ebvid['stop'].toString() );
145 - //js_log('org_eb_stop: '+ ebvid['org_eb_stop'].toString() );
 112+ ebvid = $j('#embed_vid').get(0);
 113+ //setup text scroll monitor:
 114+ mv_doTextScrollMonitor();
 115+
146116 //add all the hover hooks:
147117 this.addHoverHooks();
148118
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -132,10 +132,10 @@
133133 return '[' + key + ']';
134134 }
135135 }
136 -
137 -function mv_get_loading_img( style , class ){
 136+//gets the loading image:
 137+function mv_get_loading_img( style , class_attr ){
138138 var style_txt = (style)?style:'';
139 - var class_attr = (class)?'class="'+class+'"':'class="mv_loading_img"';
 139+ var class_attr = (class_attr)?'class="'+class_attr+'"':'class="mv_loading_img"';
140140 return '<div '+class_attr+' style="' + style +'"></div>';
141141 }
142142
@@ -2653,8 +2653,7 @@
26542654 }else{
26552655 //the plugin is already being displayed
26562656 this.paused=false; //make sure we are not "paused"
2657 - }
2658 - js_log("should update play controL");
 2657+ }
26592658 $j("#mv_play_pause_button_"+this.id).attr({
26602659 'class':'pause_button'
26612660 }).unbind( "click" ).click(function(){
@@ -2682,9 +2681,14 @@
26832682 * base embed stop (can be overwritten by the plugin)
26842683 */
26852684 stop: function(){
 2685+ var _this = this;
26862686 js_log('mvEmbed:stop:'+this.id);
2687 - //first issue pause to update interface
2688 - this.pause();
 2687+ //first issue pause to update interface (only call the parent)
 2688+ if(this['parent_pause']){
 2689+ this.parent_pause();
 2690+ }else{
 2691+ this.pause();
 2692+ }
26892693 //check if thumbnail is being displayed in which case do nothing
26902694 if(this.thumbnail_disp){
26912695 //already in stooped state
@@ -2696,6 +2700,11 @@
26972701 this.setSliderValue(0);
26982702 this.setStatus( this.getTimeReq() );
26992703 }
 2704+ //make sure the big playbutton is has click action:
 2705+ $j('#big_play_link_' + _this.id).unbind('click').click(function(){
 2706+ $j('#' +_this.id).get(0).play();
 2707+ });
 2708+
27002709 if(this.update_interval)
27012710 {
27022711 clearInterval(this.update_interval);
@@ -2845,17 +2854,18 @@
28462855 $j('#mv_time_'+id).html(value);
28472856 }
28482857 }
2849 -
28502858 /*
28512859 * utility functions:
28522860 */
28532861 //simple url re-writer for standard temporal and size request urls:
28542862 function getUpdateTimeURL(url, new_time, size){
2855 - var pSrc = parseUri(url);
2856 - //debugger;
2857 - var new_url = pSrc.protocol +'://'+ pSrc.authority + pSrc.path +'?';
 2863+ var pSrc = parseUri(url);
 2864+ if(pSrc.protocol != '' ){
 2865+ var new_url = pSrc.protocol +'://'+ pSrc.authority + pSrc.path +'?';
 2866+ }else{
 2867+ var new_url = pSrc.path +'?';
 2868+ }
28582869 var amp = '';
2859 -
28602870 if(new_time && pSrc.queryKey['t'])
28612871 pSrc.queryKey['t'] = new_time;
28622872
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_flashEmbed.js
@@ -621,7 +621,8 @@
622622 if (clip !== undefined) {
623623 self._api().fp_play(clip);
624624 } else {
625 - self._api().fp_play();
 625+ if(typeof self._api().fp_play == 'function')
 626+ self._api().fp_play();
626627 }
627628 }
628629
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_vlcEmbed.js
@@ -278,9 +278,12 @@
279279 if( this.vlc ){
280280 //plugin is already being present send play call:
281281 // clear the message log and enable error logging
282 - this.vlc.log.verbosity = 1;
283 - this.vlc.log.messages.clear();
284 - this.vlc.playlist.play();
 282+ if( this.vlc.log ){
 283+ this.vlc.log.verbosity = 1;
 284+ this.vlc.log.messages.clear();
 285+ }
 286+ if(this.vlc.playlist)
 287+ this.vlc.playlist.play();
285288 this.monitor();
286289 this.paused=false;
287290 }
Index: trunk/extensions/MetavidWiki/skins/mv_embed/cortado_iframe.php
@@ -68,7 +68,7 @@
6969 /**
7070 * JS escape function copied from MediaWiki's Xml::escapeJsString()
7171 */
72 -function Xml::escapeJsString( $string ) {
 72+function escapeJsString( $string ) {
7373 // See ECMA 262 section 7.8.4 for string literal format
7474 $pairs = array(
7575 "\\" => "\\\\",
@@ -106,11 +106,11 @@
107107 <head>
108108 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
109109 <title>cortado_embed</title>
110 - <?if( !empty( $parent_domain ) ){?>
 110+ <?php if( !empty( $parent_domain ) ){?>
111111 <script type="text/javascript">
112 - window.DOMAIN = '<?= Xml::escapeJsString( $parent_domain ); ?>';
 112+ window.DOMAIN = '<?php echo escapeJsString( $parent_domain ); ?>';
113113 </script>
114 - <?}?>
 114+ <?php }?>
115115 <style type="text/css">
116116 <!--
117117 body {
@@ -122,28 +122,28 @@
123123 -->
124124 </style></head>
125125 <body>
126 - <?if (empty($error)){ ?>
127 - <applet id="<?= htmlspecialchars( $id ) ?>"
 126+ <?php if (empty($error)){ ?>
 127+ <applet id="<?php echo htmlspecialchars( $id ) ?>"
128128 code="com.fluendo.player.Cortado.class"
129129 archive="cortado-ovt-stripped_r34336.jar"
130 - width="<?= htmlspecialchars( $width )?>"
131 - height="<?=htmlspecialchars( $height )?>"
 130+ width="<?php echo htmlspecialchars( $width )?>"
 131+ height="<?php echo htmlspecialchars( $height )?>"
132132 >
133 - <param name="url" value="<?= htmlspecialchars( $media_url )?>" />
 133+ <param name="url" value="<?php echo htmlspecialchars( $media_url )?>" />
134134 <param name="local" value="false"/>
135135 <param name="keepaspect" value="true" />
136 - <param name="video" value="<?= htmlspecialchars( $video )?>" />
137 - <param name="audio" value="<?= htmlspecialchars( $audio )?>" />
 136+ <param name="video" value="<?php echo htmlspecialchars( $video )?>" />
 137+ <param name="audio" value="<?php echo htmlspecialchars( $audio )?>" />
138138 <param name="seekable" value="true" />
139139 <? if($duration!=0){
140140 ?>
141 - <param name="duration" value="<?= htmlspecialchars( $duration )?>" />
 141+ <param name="duration" value="<?php echo htmlspecialchars( $duration )?>" />
142142 <?
143143 } ?>
144144 <param name="bufferSize" value="200" />
145145 </applet>
146146 <? }else{ ?>
147 - <b>Error:</b> <?= htmlspecialchars( $error )?>
 147+ <b>Error:</b> <?php echo htmlspecialchars( $error )?>
148148 <?
149149 }
150150 ?>

Status & tagging log