Index: branches/new-upload/phase3/js2/mwEmbed/example_usage/Sequence_Editor.html |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | <html> |
5 | 5 | <head> |
6 | 6 | <title>Simple SMIL example</title> |
7 | | - <script type="text/javascript" src="../mv_embed.js"></script> |
| 7 | + <script type="text/javascript" src="../mv_embed.js?debug=true"></script> |
8 | 8 | <script type="text/javascript"> |
9 | 9 | mwAddOnloadHook(function(){ |
10 | 10 | $j('#seqcontainer').sequencer({ |
— | — | @@ -11,10 +11,23 @@ |
12 | 12 | }); |
13 | 13 | }); |
14 | 14 | </script> |
| 15 | +<style> |
| 16 | + body { |
| 17 | + font: x-small sans-serif; |
| 18 | + background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat; |
| 19 | + color: black; |
| 20 | + margin: 0; |
| 21 | + padding: 0; |
| 22 | + } |
| 23 | + img { |
| 24 | + border:medium none; |
| 25 | + } |
| 26 | +</style> |
| 27 | + |
15 | 28 | </head> |
16 | 29 | <body> |
17 | 30 | <h3> Simple SMIL example</h3> |
18 | | - <div id="seqcontainer" style="position:absolute;top:50px;bottom:10px;left:10px;right:10px;border:solid thin black"> |
| 31 | + <div id="seqcontainer" style="position:absolute;top:50px;bottom:10px;left:10px;right:10px;"> |
19 | 32 | Loading sequence editor <blink>...</blink> |
20 | 33 | </div> |
21 | 34 | |
Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/seqRemoteSearchDriver.js |
— | — | @@ -6,13 +6,14 @@ |
7 | 7 | } |
8 | 8 | seqRemoteSearchDriver.prototype = { |
9 | 9 | init:function( this_seq ){ |
| 10 | + js_log("init:seqRemoteSearchDriver"); |
10 | 11 | //setup remote search driver with a seq parent: |
11 | 12 | this.pSeq = this_seq; |
12 | 13 | var iObj = { |
13 | | - 'target_container':'#tab-ic-cliplib', |
14 | | - 'local_wiki_api_url': this_seq.getLocalApiUrl(), |
15 | | - 'instance_name': this_seq.instance_name + '.mySearch' |
16 | | - } |
| 14 | + 'target_container' : '#cliplib_ic', |
| 15 | + 'local_wiki_api_url': this_seq.getLocalApiUrl(), |
| 16 | + 'instance_name' : this_seq.instance_name + '.mySearch' |
| 17 | + } |
17 | 18 | //inherit the remoteSearchDriver properties:n |
18 | 19 | var tmpRSD = new remoteSearchDriver( iObj ); |
19 | 20 | for(var i in tmpRSD){ |
Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | 'caret_pos':null, |
44 | 44 | 'local_wiki_api_url':null, |
45 | 45 | |
46 | | - //can be 'api', 'form', 'autodetect', 'remote_html_embed' |
| 46 | + //can be 'api', 'form', 'autodetect', 'remote_link' |
47 | 47 | 'import_url_mode': 'autodetect', |
48 | 48 | |
49 | 49 | 'target_title':null, |
— | — | @@ -388,6 +388,7 @@ |
389 | 389 | $j(this.target_textbox).val(this.caret_pos.text); |
390 | 390 | }, |
391 | 391 | init_modal:function(){ |
| 392 | + js_log("init_modal"); |
392 | 393 | var _this = this; |
393 | 394 | //add the parent target_container if not provided or missing |
394 | 395 | if(!_this.target_container || $j(_this.target_container).length==0){ |
— | — | @@ -440,39 +441,24 @@ |
441 | 442 | }, |
442 | 443 | //sets up the initial html interface |
443 | 444 | init_interface_html:function(){ |
| 445 | + js_log('init_interface_html'); |
444 | 446 | var _this = this; |
445 | 447 | var dq = (this.default_query)? this.default_query : ''; |
446 | 448 | js_log('f::init_interface_html'); |
447 | 449 | |
448 | | - var out = '<div class="rsd_control_container" style="width:100%">' + |
| 450 | + var o = '<div class="rsd_control_container" style="width:100%">' + |
449 | 451 | '<form id="rsd_form" action="javascript:return false;" method="GET">'+ |
450 | 452 | '<input class="ui-widget-content ui-corner-all" type="text" tabindex="1" value="' + dq + '" maxlength="512" id="rsd_q" name="rsd_q" '+ |
451 | 453 | 'size="20" autocomplete="off"/> '+ |
452 | 454 | $j.btnHtml( gM('mv_media_search'), 'rms_search_button', 'search') + |
453 | | - '</form>'; |
454 | | - |
455 | | - /*out+='<div id="rsd_options_bar" style="display:none;width:100%;height:0px;background:#BBB">'; |
456 | | - //set up the content provider selection div (do this first to get the default cp) |
457 | | - out+= '<div id="cps_options">'; |
458 | | - for( var cp_id in this.content_providers ){ |
459 | | - var cp = this.content_providers[cp_id]; |
460 | | - var checked_attr = ( cp.checked ) ? 'checked':''; |
461 | | - out+='<div title="' + cp.title + '" '+ |
462 | | - ' style="float:left;cursor:pointer;">'+ |
463 | | - '<input class="mv_cps_input" type="checkbox" name="mv_cps" '+ checked_attr+'>'; |
464 | | - out+= '<img alt="'+cp.title+'" src="' + mv_skin_img_path + 'remote_cp/' + cp_id + '_tab.png">'; |
465 | | - out+='</div>'; |
466 | | - } |
467 | | - out+='<div style="clear:both"/><a id="mso_selprovider_close" href="#">'+gM('close')+'</a></div>'; |
468 | | - out+='</div>';*/ |
469 | | - |
| 455 | + '</form>'; |
470 | 456 | //close up the control container: |
471 | | - out+='</div>'; |
| 457 | + o+='</div>'; |
472 | 458 | |
473 | 459 | //search provider tabs based on "checked" and "enabled" and "combined tab" |
474 | | - out+='<div id="rsd_results_container"></div>'; |
475 | | - |
476 | | - $j(this.target_container).html( out ); |
| 460 | + o+='<div id="rsd_results_container"></div>'; |
| 461 | + js_log('should set: ' + this.target_container + ' to: ' + o); |
| 462 | + $j(this.target_container).html( o ); |
477 | 463 | //add simple styles: |
478 | 464 | $j(this.target_container + ' .rms_search_button').btnBind().click(function(){ |
479 | 465 | _this.runSearch(); |
— | — | @@ -573,6 +559,17 @@ |
574 | 560 | checkForCopyURLSupport:function ( callback ){ |
575 | 561 | var _this = this; |
576 | 562 | js_log('checkForCopyURLSupport:: '); |
| 563 | + //see if we already have the import mode: |
| 564 | + if( this.import_url_mode != 'autodetect'){ |
| 565 | + js_log('import mode: ' + _this.import_url_mode); |
| 566 | + callback(); |
| 567 | + } |
| 568 | + //if we don't have the local wiki api defined we can't auto-detect use "link" |
| 569 | + if(!_this.local_wiki_api_url){ |
| 570 | + js_log('import mode: remote link (no import_wiki_api_url)'); |
| 571 | + _this.import_url_mode = 'remote_link'; |
| 572 | + callback(); |
| 573 | + } |
577 | 574 | if( this.import_url_mode == 'autodetect' ){ |
578 | 575 | do_api_req( { |
579 | 576 | 'data': { 'action':'paraminfo', 'modules':'upload' }, |
— | — | @@ -626,9 +623,6 @@ |
627 | 624 | } |
628 | 625 | } |
629 | 626 | }); |
630 | | - }else{ |
631 | | - js_log('import mode: ' + _this.import_url_mode); |
632 | | - callback(); |
633 | 627 | } |
634 | 628 | }, |
635 | 629 | /* |
— | — | @@ -1094,7 +1088,7 @@ |
1095 | 1089 | |
1096 | 1090 | //check if local repository |
1097 | 1091 | //or if import mode if just "linking" |
1098 | | - if( this.checkRepoLocal( cp ) || this.import_url_mode == 'remote_html_embed'){ |
| 1092 | + if( this.checkRepoLocal( cp ) || this.import_url_mode == 'remote_link'){ |
1099 | 1093 | //local repo jump directly to check Import Resource callback: |
1100 | 1094 | cir_callback( rObj ); |
1101 | 1095 | }else{ |
— | — | @@ -1369,7 +1363,7 @@ |
1370 | 1364 | updatePreviewText:function( rObj ){ |
1371 | 1365 | var _this = this; |
1372 | 1366 | |
1373 | | - if(_this.import_url_mode=='remote_html_embed'){ |
| 1367 | + if(_this.import_url_mode=='remote_link'){ |
1374 | 1368 | _this.cur_embed_code = rObj.pSobj.getEmbedHTML(rObj); |
1375 | 1369 | }else{ |
1376 | 1370 | _this.cur_embed_code = rObj.pSobj.getEmbedWikiCode( rObj ); |
Index: branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvSequencer.js |
— | — | @@ -125,7 +125,10 @@ |
126 | 126 | menu_items : { |
127 | 127 | 'clipedit':{ |
128 | 128 | 'd':0, |
129 | | - 'html':' ', |
| 129 | + 'html':'', |
| 130 | + 'js': function(this_seq){ |
| 131 | + this_seq.doEditSelectedClip(); |
| 132 | + }, |
130 | 133 | 'click_js':function( this_seq ){ |
131 | 134 | this_seq.doEditSelectedClip(); |
132 | 135 | } |
— | — | @@ -139,8 +142,8 @@ |
140 | 143 | 'remoteSearchDriver', |
141 | 144 | 'seqRemoteSearchDriver' |
142 | 145 | ], function(){ |
143 | | - this_seq.mySearch = new seqRemoteSearchDriver(this_seq); |
144 | | - this_seq.mySearch.doInitDisplay(); |
| 146 | + this_seq.mySearch = new seqRemoteSearchDriver(this_seq); |
| 147 | + this_seq.mySearch.doInitDisplay(); |
145 | 148 | }); |
146 | 149 | } |
147 | 150 | }, |
— | — | @@ -228,9 +231,9 @@ |
229 | 232 | '</div>' |
230 | 233 | ); |
231 | 234 | |
232 | | - js_log('set: '+this.target_sequence_container + ' html to:'+ "\n"+ |
| 235 | + /*js_log('set: '+this.target_sequence_container + ' html to:'+ "\n"+ |
233 | 236 | $j(this.target_sequence_container).html() |
234 | | - ); |
| 237 | + );*/ |
235 | 238 | //first check if we got a cloned PL object: |
236 | 239 | //(when the editor is invoked with the plalylist already on the page) |
237 | 240 | //@@NOT WORKING... (need a better "clone" function) |
— | — | @@ -306,11 +309,7 @@ |
307 | 310 | }, |
308 | 311 | //setup the menu items: |
309 | 312 | setupMenuItems:function(){ |
310 | | - js_log('loadInitMenuItems'); |
311 | | - if( !this.plObj.interface_url ){ |
312 | | - js_log( 'Error:missing interface_url, can not load item' ); |
313 | | - return false; |
314 | | - } |
| 313 | + js_log('loadInitMenuItems'); |
315 | 314 | var this_seq = this; |
316 | 315 | //do all the menu_items setup: @@we could defer this to once the menu item is requested |
317 | 316 | for( var i in this.menu_items ){ |
— | — | @@ -542,13 +541,12 @@ |
543 | 542 | selected_tab=inx; |
544 | 543 | |
545 | 544 | o+='<li>' + |
546 | | - '<a id="mv_menu_item_'+tab_id+'" href="#tab-ic-' + tab_id + '">'+gM('menu_' + tab_id )+ |
| 545 | + '<a id="mv_menu_item_'+tab_id+'" href="#' + tab_id + '_ic">'+gM('menu_' + tab_id )+ |
547 | 546 | '</li>'; |
548 | 547 | |
549 | | - tabc += '<div id="tab-ic-' + tab_id + '" style="overflow:auto;" >'; |
| 548 | + tabc += '<div id="' + tab_id + '_ic" style="overflow:auto;height:272px;" >'; |
550 | 549 | tabc += (menu_item.html) ? menu_item.html : '<h3>' + gM('menu_'+tab_id) + '</h3>'; |
551 | | - tabc +='</div>'; |
552 | | - |
| 550 | + tabc +='</div>'; |
553 | 551 | inx++; |
554 | 552 | }); |
555 | 553 | o+='</ul>'; |
— | — | @@ -562,23 +560,16 @@ |
563 | 561 | this_seq.disp( $j(ui.tab).attr('id').replace('mv_menu_item_', '') ); |
564 | 562 | } |
565 | 563 | //add sorting |
566 | | - }).find(".ui-tabs-nav").sortable({axis:'x'}); |
| 564 | + }).find(".ui-tabs-nav").sortable({ axis : 'x' }); |
| 565 | + |
567 | 566 | |
568 | | - //add binding for menu |
569 | | - /*$j('#seq_menu li').click(function(){ |
570 | | - $j('#seq_menu li').removeClass('mv_selected_item'); |
571 | | - $j(this).addClass('mv_selected_item'); |
572 | | - this_seq.disp( $j(this).attr('id').replace('mv_menu_item_','') ); |
573 | | - });*/ |
574 | | - |
575 | | - //load init content into containers |
576 | | - this.setupMenuItems(); |
577 | | - |
578 | 567 | //render the timeline |
579 | 568 | this.renderTimeLine(); |
580 | 569 | this.do_refresh_timeline(); |
581 | | - |
582 | 570 | |
| 571 | + //load init content into containers |
| 572 | + this.setupMenuItems(); |
| 573 | + |
583 | 574 | this.doFocusBindings(); |
584 | 575 | |
585 | 576 | //set up key bidnings |
— | — | @@ -691,22 +682,22 @@ |
692 | 683 | this.doEditClip( cObj ); |
693 | 684 | }, |
694 | 685 | doEditSelectedClip:function(){ |
| 686 | + js_log("f:doEditSelectedClip:"); |
695 | 687 | var this_seq = this; |
696 | | - //and only one clip selected |
697 | | - if(this_seq.menu_items['clipedit'].d ){ |
698 | | - var num_sel = $j('.mv_selected_clip').length |
699 | | - if( num_sel == 1){ |
700 | | - $j('.mv_selected_clip').each(function(){ |
701 | | - this_seq.doEditClip( this_seq.getClipFromSeqID( $j(this).parent().attr('id') ) ); |
702 | | - }); |
703 | | - }else if( num_sel === 0){ |
704 | | - //no clip selected warning: |
705 | | - $j('#clipedit_ic').html( gM('no_selected_resource') ); |
706 | | - }else if( num_sel > 1){ |
707 | | - //multiple clip selected warning: |
708 | | - $j('#clipedit_ic').html( gM('error_edit_multiple') ); |
709 | | - } |
| 688 | + //and only one clip selected |
| 689 | + var num_sel = $j('.mv_selected_clip').length |
| 690 | + if( num_sel == 1){ |
| 691 | + $j('.mv_selected_clip').each(function(){ |
| 692 | + this_seq.doEditClip( this_seq.getClipFromSeqID( $j(this).parent().attr('id') ) ); |
| 693 | + }); |
| 694 | + }else if( num_sel === 0){ |
| 695 | + //no clip selected warning: |
| 696 | + $j('#clipedit_ic').html( gM('no_selected_resource') ); |
| 697 | + }else if( num_sel > 1){ |
| 698 | + //multiple clip selected warning: |
| 699 | + $j('#clipedit_ic').html( gM('error_edit_multiple') ); |
710 | 700 | } |
| 701 | + |
711 | 702 | }, |
712 | 703 | //updates the clip details div if edit resource is set |
713 | 704 | doEditClip:function( cObj){ |
Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/mv_javaEmbed.js |
— | — | @@ -0,0 +1,167 @@ |
| 2 | +window.cortadoDomainLocations = { |
| 3 | + 'upload.wikimedia.org' : 'http://upload.wikimedia.org/jars/cortado.jar', |
| 4 | + 'tinyvid.tv' : 'http://tinyvid.tv/static/cortado.jar' |
| 5 | +} |
| 6 | + |
| 7 | +var javaEmbed = { |
| 8 | + instanceOf:'javaEmbed', |
| 9 | + iframe_src:'', |
| 10 | + logged_domain_error:false, |
| 11 | + supports: { |
| 12 | + 'play_head':true, |
| 13 | + 'pause':true, |
| 14 | + 'stop':true, |
| 15 | + 'fullscreen':false, |
| 16 | + 'time_display':true, |
| 17 | + 'volume_control':false |
| 18 | + }, |
| 19 | + getEmbedHTML : function (){ |
| 20 | + //big delay on embed html cuz its just for status updates and ie6 is crazy. |
| 21 | + if(this.controls) |
| 22 | + setTimeout('document.getElementById(\''+this.id+'\').postEmbedJS()', 500); |
| 23 | + //set a default duration of 30 seconds: cortao should detect duration. |
| 24 | + return this.wrapEmebedContainer( this.getEmbedObj() ); |
| 25 | + }, |
| 26 | + getEmbedObj:function(){ |
| 27 | + js_log("java play url:" + this.getURI( this.seek_time_sec )); |
| 28 | + //get the duration |
| 29 | + this.getDuration(); |
| 30 | + //if still unset set to an arbitrary time 60 seconds: |
| 31 | + if(!this.duration)this.duration=60; |
| 32 | + //@@todo we should have src property in our base embed object |
| 33 | + var mediaSrc = this.media_element.selected_source.getURI( this.seek_time_sec ); |
| 34 | + |
| 35 | + if(mediaSrc.indexOf('://')!=-1 & parseUri(document.URL).host != parseUri(mediaSrc).host){ |
| 36 | + if(window.cortadoDomainLocations[parseUri(mediaSrc).host]){ |
| 37 | + applet_loc = window.cortadoDomainLocations[parseUri(mediaSrc).host]; |
| 38 | + }else{ |
| 39 | + applet_loc = 'http://theora.org/cortado.jar'; |
| 40 | + } |
| 41 | + }else{ |
| 42 | + //should be identical to cortado.jar |
| 43 | + applet_loc = mv_embed_path+'binPlayers/cortado/cortado.jar'; |
| 44 | + } |
| 45 | + //load directly in the page.. |
| 46 | + // (media must be on the same server or applet must be signed) |
| 47 | + var appplet_code = ''+ |
| 48 | + '<applet id="' + this.pid + '" code="com.fluendo.player.Cortado.class" archive="' + applet_loc + '" width="' + this.width + '" height="' + this.height + '"> '+ "\n"+ |
| 49 | + '<param name="url" value="' + mediaSrc + '" /> ' + "\n"+ |
| 50 | + '<param name="local" value="false"/>'+ "\n"+ |
| 51 | + '<param name="keepaspect" value="true" />'+ "\n"+ |
| 52 | + '<param name="video" value="true" />'+"\n"+ |
| 53 | + '<param name="showStatus" value="hide" />' + "\n"+ |
| 54 | + '<param name="audio" value="true" />'+"\n"+ |
| 55 | + '<param name="seekable" value="true" />'+"\n"+ |
| 56 | + '<param name="duration" value="' + this.duration + '" />'+"\n"+ |
| 57 | + '<param name="bufferSize" value="4096" />'+"\n"+ |
| 58 | + '</applet>'; |
| 59 | + |
| 60 | + // Wrap it in an iframe to avoid hanging the event thread in FF 2/3 and similar |
| 61 | + // Doesn't work in MSIE or Safari/Mac or Opera 9.5 |
| 62 | + if ( embedTypes.mozilla ) { |
| 63 | + var iframe = document.createElement( 'iframe' ); |
| 64 | + iframe.setAttribute( 'width', params.width ); |
| 65 | + iframe.setAttribute( 'height', playerHeight ); |
| 66 | + iframe.setAttribute( 'scrolling', 'no' ); |
| 67 | + iframe.setAttribute( 'frameborder', 0 ); |
| 68 | + iframe.setAttribute( 'marginWidth', 0 ); |
| 69 | + iframe.setAttribute( 'marginHeight', 0 ); |
| 70 | + iframe.setAttribute( 'id', 'cframe_' + this.id) |
| 71 | + elt.appendChild( iframe ); |
| 72 | + var newDoc = iframe.contentDocument; |
| 73 | + newDoc.open(); |
| 74 | + newDoc.write( '<html><body>' + appplet_code + '</body></html>' ); |
| 75 | + newDoc.close(); // spurious error in some versions of FF, no workaround known |
| 76 | + } else { |
| 77 | + return appplet_code; |
| 78 | + } |
| 79 | + }, |
| 80 | + postEmbedJS:function(){ |
| 81 | + //reset logged domain error flag: |
| 82 | + this.logged_domain_error = false; |
| 83 | + //start monitor: |
| 84 | + this.monitor(); |
| 85 | + }, |
| 86 | + monitor:function(){ |
| 87 | + this.getJCE() |
| 88 | + if(this.jce && this.jce.getPlayPosition){ |
| 89 | + try{ |
| 90 | + //java reads ogg media time.. so no need to add the start or seek offset: |
| 91 | + //js_log(' ct: ' + this.jce.getPlayPosition() + ' ' + this.supportsURLTimeEncoding()); |
| 92 | + this.currentTime = this.jce.getPlayPosition(); |
| 93 | + if(this.startOffset && ! this.supportsURLTimeEncoding()){ |
| 94 | + this.currentTime = this.currentTime - this.startOffset; |
| 95 | + } |
| 96 | + if( this.jce.getPlayPosition() < 0){ |
| 97 | + js_log('pp:'+this.jce.getPlayPosition()); |
| 98 | + //probably reached clip end |
| 99 | + this.onClipDone(); |
| 100 | + } |
| 101 | + }catch (e){ |
| 102 | + js_log('could not get time from jPlayer: ' + e); |
| 103 | + } |
| 104 | + } |
| 105 | + //once currentTime is updated call parent_monitor |
| 106 | + this.parent_monitor(); |
| 107 | + }, |
| 108 | + /* |
| 109 | + * (local cortado seek does not seem to work very well) |
| 110 | + */ |
| 111 | + doSeek:function(perc){ |
| 112 | + js_log('java:seek:p: ' + perc+ ' : ' + this.supportsURLTimeEncoding() + ' dur: ' + this.getDuration() + ' sts:' + this.seek_time_sec ); |
| 113 | + |
| 114 | + if( this.supportsURLTimeEncoding() ){ |
| 115 | + this.parent_doSeek(perc); |
| 116 | + //this.seek_time_sec = npt2seconds( this.start_ntp ) + parseFloat( perc * this.getDuration() ); |
| 117 | + // this.jce.setParam('url', this.getURI( this.seek_time_sec )) |
| 118 | + //this.jce.restart(); |
| 119 | + }else{ |
| 120 | + this.getJCE(); |
| 121 | + if(this.jce){ |
| 122 | + //do a (genneraly broken) local seek: |
| 123 | + js_log("cortado javascript seems to always fail ... but here we go... doSeek(" + perc * this.getDuration() ); |
| 124 | + this.jce.doSeek( perc * this.getDuration() ); |
| 125 | + } |
| 126 | + } |
| 127 | + }, |
| 128 | + //get java cortado embed object |
| 129 | + getJCE:function(){ |
| 130 | + if ( embedTypes.mozilla ) { |
| 131 | + this.jce = window.frames['cframe_' + this.id ].document.getElementById( this.pid ); |
| 132 | + }else{ |
| 133 | + this.jce = $j('#'+this.pid).get( 0 ); |
| 134 | + } |
| 135 | + /*if( ! mv_java_iframe ){ |
| 136 | + |
| 137 | + }else{ |
| 138 | + if( $j('#iframe_' + this.pid ).length > 0 ) |
| 139 | + try{ |
| 140 | + this.jce = $j('#iframe_' + this.pid ).get(0).contentWindow.jPlayer; |
| 141 | + }catch (e){ |
| 142 | + if(!this.logged_domain_error) |
| 143 | + js_log("failed to grab jce we wont have time updates for java"); |
| 144 | + this.logged_domain_error = true; |
| 145 | + } |
| 146 | + else |
| 147 | + return false; |
| 148 | + } */ |
| 149 | + }, |
| 150 | + doThumbnailHTML:function(){ |
| 151 | + //empty out player html (jquery with java applets does not work) : |
| 152 | + var pelm = document.getElementById('mv_embedded_player_' + this.id ); |
| 153 | + pelm.innerHTML = ''; |
| 154 | + this.parent_doThumbnailHTML(); |
| 155 | + }, |
| 156 | + play:function(){ |
| 157 | + this.getJCE(); |
| 158 | + this.parent_play(); |
| 159 | + if( this.jce ) |
| 160 | + this.jce.doPlay(); |
| 161 | + }, |
| 162 | + pause:function(){ |
| 163 | + this.getJCE(); |
| 164 | + this.parent_pause(); |
| 165 | + if( this.jce ) |
| 166 | + this.jce.doPause(); |
| 167 | + } |
| 168 | +} |
Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js |
— | — | @@ -1027,7 +1027,7 @@ |
1028 | 1028 | for(var attr in default_video_attributes){ //for in loop oky on user object |
1029 | 1029 | if(element.getAttribute(attr)){ |
1030 | 1030 | this[attr]=element.getAttribute(attr); |
1031 | | - js_log('attr:' + attr + ' val: ' + element.getAttribute(attr) +'(set by elm)'); |
| 1031 | + //js_log('attr:' + attr + ' val: ' + element.getAttribute(attr) +'(set by elm)'); |
1032 | 1032 | }else{ |
1033 | 1033 | this[attr]=default_video_attributes[attr]; |
1034 | 1034 | //js_log('attr:' + attr + ' val: ' + video_attributes[attr] +" "+ 'elm_val:' + element.getAttribute(attr) + "\n (set by attr)"); |
— | — | @@ -2360,44 +2360,18 @@ |
2361 | 2361 | { |
2362 | 2362 | return gM('mv_ogg-player-' + this.id); |
2363 | 2363 | }, |
2364 | | - load : function(callback) |
2365 | | - { |
2366 | | - if(this.loaded) |
2367 | | - { |
2368 | | - js_log('plugin loaded, scheduling immediate processing'); |
| 2364 | + load : function(callback){ |
| 2365 | + var libName = this.library+'Embed'; |
| 2366 | + if( mvJsLoader.checkObjPath( libName ) ){ |
| 2367 | + js_log('plugin loaded, do callback:'); |
2369 | 2368 | callback(); |
2370 | | - } |
2371 | | - else |
2372 | | - { |
2373 | | - var _this = this; |
2374 | | - var plugin_path = mv_embed_path + 'libEmbedVideo/mv_'+this.library+'Embed.js'; |
2375 | | - //add the callback: |
2376 | | - this.loading_callbacks.push(callback); |
2377 | | - //jQuery based get script does not work so well. |
2378 | | - /*$j.getScript(plugin_path, function(){ |
2379 | | - js_log(_this.id + ' plugin loaded'); |
2380 | | - _this.loaded = true; |
2381 | | - for(var i in _this.loading_callbacks) |
2382 | | - _this.loading_callbacks[i](); |
2383 | | - _this.loading_callbacks = null; |
2384 | | - });*/ |
2385 | | - |
2386 | | - js_log('DO LOAD: '+this.library); |
| 2369 | + }else{ |
| 2370 | + var _this = this; |
| 2371 | + //jQuery based get script does not work so well. |
2387 | 2372 | mvJsLoader.doLoad([ |
2388 | | - this.library+'Embed' |
| 2373 | + libName |
2389 | 2374 | ],function(){ |
2390 | | - //js_log( 'type of lib: ' + eval( 'typeof ' + this.library + 'Embed' ) ); |
2391 | | - //js_log(_this.id + ' plugin loaded'); |
2392 | | - _this.loaded = true; |
2393 | | - //make sure we have not already cleared the callbacks: |
2394 | | - if( _this.loading_callbacks != null){ |
2395 | | - for(var i=0; i < _this.loading_callbacks.length; i++ ){ |
2396 | | - if(_this.loading_callbacks[i]) |
2397 | | - _this.loading_callbacks[i](); |
2398 | | - } |
2399 | | - } |
2400 | | - _this.loading_callbacks = null; |
2401 | | - |
| 2375 | + callback(); |
2402 | 2376 | }); |
2403 | 2377 | } |
2404 | 2378 | } |
— | — | @@ -2734,11 +2708,10 @@ |
2735 | 2709 | var descArray = flashDescription.split(" "); |
2736 | 2710 | var tempArrayMajor = descArray[2].split("."); |
2737 | 2711 | var versionMajor = tempArrayMajor[0]; |
2738 | | - js_log("version of flash: " + versionMajor); |
| 2712 | + //js_log("version of flash: " + versionMajor); |
2739 | 2713 | if(versionMajor >= 10){ |
2740 | 2714 | this.players.addPlayer( omtkPlayer ); |
2741 | | - } |
2742 | | - |
| 2715 | + } |
2743 | 2716 | continue; |
2744 | 2717 | } |
2745 | 2718 | } |