r39985 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39984‎ | r39985 | r39986 >
Date:23:38, 25 August 2008
Author:stipe
Status:old
Tags:
Comment:
made player.load(callback) behavior consistent when player is already loaded and when it is not, fixed vlc bug for opera
Modified paths:
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_flashEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_vlcEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_flashEmbed.js
@@ -1,3 +1,4 @@
 2+js_log('**** flashEmbed processing');
23 /**
34 * flashembed 0.25. Adobe Flash embedding script
45 *
@@ -369,6 +370,8 @@
370371 monitor : function()
371372 {
372373 this.getFLA();
 374+ if(!this.fla['getTime'])
 375+ return;
373376 var time = this.fla.getTime();
374377 //flash is giving bogus duration get from this
375378 var end_ntp = (this.media_element.selected_source.end_ntp)?
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_vlcEmbed.js
@@ -1,3 +1,4 @@
 2+js_log('**** vlcEmbed processing');
23 /*
34 * vlc embed based on: http://people.videolan.org/~damienf/plugin-0.8.6.html
45 * javascript api: http://www.videolan.org/doc/play-howto/en/ch04.html
@@ -276,6 +277,6 @@
277278 // get the embed vlc object
278279 getVLC : function getVLC(){
279280 this.vlc = this.getPluginEmbed();
280 - },
 281+ }
281282 }
282283
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -157,7 +157,8 @@
158158 lib_plugins:{
159159 '$j.fn.offsetParent':'jquery/plugins/jquery.dimensions.js',
160160 '$j.ui.mouseInteraction':'jquery/plugins/ui.mouse.js',
161 - '$j.ui.slider':'jquery/plugins/ui.slider.js'
 161+ '$j.ui.slider':'jquery/plugins/ui.slider.js',
 162+ '$j.timer.global':'jquery/plugins/jquery.timers.js'
162163 },
163164 pc:null, //used to store pointer to parent clip (when in playlist mode)
164165 load_libs:function(callback){
@@ -262,8 +263,8 @@
263264 {
264265 if(this.loaded)
265266 {
266 - js_log('plugin loaded, processing immediately');
267 - callback();
 267+ js_log('plugin loaded, scheduling immediate processing');
 268+ $j(document).oneTime(1, callback);
268269 }
269270 else
270271 {
@@ -279,14 +280,14 @@
280281
281282 //I am getting vlEmebed is not defined like 1/5 or 1/20th the time
282283 //the load order should be more defined and ordered via callbacks
283 - /*$j.getScript(plugin_path, function(){
 284+ $j.getScript(plugin_path, function(){
284285 js_log(_this.id + ' plugin loaded');
285286 _this.loaded = true;
286287 for(var i in _this.loading_callbacks)
287288 _this.loading_callbacks[i]();
288289 _this.loading_callbacks = null;
289 - }); */
290 - eval('var lib = {"'+this.library+'Embed":\'embedLibs/mv_'+this.library+'Embed.js\'}');
 290+ });
 291+/* eval('var lib = {"'+this.library+'Embed":\'embedLibs/mv_'+this.library+'Embed.js\'}');
291292 mvJsLoader.doLoad(lib,function(){
292293 js_log(_this.id + ' plugin loaded');
293294 _this.loaded = true;
@@ -294,7 +295,7 @@
295296 for(var i in _this.loading_callbacks)
296297 _this.loading_callbacks[i]();
297298 _this.loading_callbacks = null;
298 - });
 299+ });*/
299300 }
300301 }
301302 }
@@ -877,12 +878,9 @@
878879 $j(video_element).after(embed_video).remove();
879880 js_log('did swap');
880881 $j('#'+embed_video.id).get(0).onDOMswap();
881 - // now that "embed_video" is stable, do more initialization (if we are ready)
882 - if($j('#'+embed_video.id).get(0).loading_external_data==false){
 882+ // now that "embed_video" is stable, do more initialization (if we are ready)
 883+ if($j('#'+embed_video.id).get(0).loading_external_data==false)
883884 $j('#'+embed_video.id).get(0).more_init();
884 - //update HTML
885 - $j('#'+embed_video.id).get(0).getHTML();
886 - }
887885
888886 //js_log('vid elm:'+ $j(video_element).html() );
889887
@@ -1615,6 +1613,7 @@
16161614 js_log('f:onDOMswap');
16171615 // Process the provided ROE file... if we don't yet have sources
16181616 if(this.roe && this.media_element.sources.length==0 ){
 1617+ js_log('loading external data');
16191618 this.loading_external_data=true;
16201619 var _this = this;
16211620 do_request(this.roe, function(data)
@@ -1622,10 +1621,7 @@
16231622 //continue
16241623 _this.media_element.addROE(data);
16251624 js_log('added_roe::' + _this.media_element.sources);
1626 - _this.more_init(function(){
1627 - js_log('getting html for: '+ _this.id);
1628 - _this.getHTML()
1629 - });
 1625+ _this.more_init();
16301626 js_log('done loading ROE '+_this.thumbnail_disp )
16311627 _this.loading_external_data=false;
16321628 });
@@ -1658,6 +1654,9 @@
16591655 */
16601656 this.inheritEmbedObj(ready_callback);
16611657
 1658+ //update HTML
 1659+ $j('#'+embed_video.id).get(0).getHTML();
 1660+
16621661 //js_log('HTML FROM IN OBJECT' + this.getHTML());
16631662 //return this object:
16641663 //return this;
@@ -1712,6 +1711,7 @@
17131712 getMsg('loading_plugin') +
17141713 '</div>'
17151714 );
 1715+ // schedule embedding
17161716 this.selected_player.load(function()
17171717 {
17181718 js_log('performing embed for ' + _this.id);
@@ -1722,7 +1722,7 @@
17231723 _this.paused = false;
17241724 _this.thumbnail_disp=false;
17251725 $j("#mv_play_pause_button_"+_this.id).attr('class', 'pause_button');
1726 - });
 1726+ });
17271727 },
17281728 doThumbnailHTML:function()
17291729 {
@@ -1742,8 +1742,12 @@
17431743 },
17441744 refreshControlsHTML:function()
17451745 {
 1746+ js_log('refreshing controls HTML');
17461747 if($j('#mv_embedded_controls_'+this.id).length==0)
 1748+ {
 1749+ js_log('#mv_embedded_controls_'+this.id + ' not present, returning');
17471750 return;
 1751+ }
17481752 var available_width = this.playerPixelWidth();
17491753 var html_code='';
17501754 // borders
@@ -1858,6 +1862,7 @@
18591863
18601864 if(ready_callback)
18611865 ready_callback();
 1866+ js_log('plugin load callback complete');
18621867 });
18631868 },
18641869 getHTML : function (){
@@ -2454,6 +2459,7 @@
24552460 if (document.embeds && document.embeds[this.pid])
24562461 return document.embeds[this.pid];
24572462 }
 2463+ return null;
24582464 },
24592465 activateSlider : function(slider_id){
24602466 var id = (this.pc)?this.pc.pp.id:this.id;
@@ -2793,7 +2799,7 @@
27942800 /*
27952801 * IE and non-firebug debug:
27962802 */
2797 - /*var log_elm = document.getElementById('mv_js_log');
 2803+/* var log_elm = document.getElementById('mv_js_log');
27982804 if(!log_elm){
27992805 document.write('<div style="position:absolute;z-index:500;top:0px;left:0px;right:0px;height:150px;"><textarea id="mv_js_log" cols="80" rows="6"></textarea></div>');
28002806 var log_elm = document.getElementById('mv_js_log');

Status & tagging log