r45429 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45428‎ | r45429 | r45430 >
Date:00:34, 6 January 2009
Author:dale
Status:deferred
Tags:
Comment:
updates to add_external_media wizard
* improved video import from commons
* improved detection of timed url support
* style updates improved tab display

added supportsURLTimeEncoding() to mv_embed for timed url detect

updates mv_playlist.js to support xspf playlists
Modified paths:
  • /trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_playlists.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_xspf.xml (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/libRemoteMediaSearch/mv_remote_media_search.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_clipedit.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_playlist.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/styles.css (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_xspf.xml
@@ -11,24 +11,24 @@
1212 knobs in there, you've got sand. in. and try to. do a picture. on. etch-a-sketch
1313 gone gone to. china. I mean, they're all gone
1414 </annotation>
15 - <location>http://metavid.ucsc.edu/media/senate_11-14-05.ogg.anx?t=0:42:14/0:42:56</location>
16 - <image>http://metavid.ucsc.edu/image_media/senate_11-14-05?t=0:42:14&amp;size=320x240</image>
 15+ <location>http://128.114.20.64/media/senate_11-14-05.ogg?t=0:42:14/0:42:56</location>
 16+ <image>http://metavid.org/w/index.php?action=ajax&amp;rs=mv_frame_server&amp;stream_id=14&amp;t=0:42:00&amp;size=400x300</image>
1717 <info>http://metavid.ucsc.edu/overlay/video_player/webview?stream_name=senate_11-14-05&amp;t=0:42:14/0:42:56</info>
1818 </track>
1919 <track>
2020 <title>we know better</title>
2121 <annotation>&lt;b&gt;Byran Dorgan:&lt;/b&gt;that 1.4 trillion in combined debut we know better than that we know what to do
2222 </annotation>
23 - <location>http://metavid.ucsc.edu/media/senate_proceeding_02-10-06.ogg.HQ.anx?t=01:30:59/01:31:24</location>
24 - <image>http://metavid.ucsc.edu/image_media/senate_proceeding_02-10-06?t=01:30:59&amp;size=320x240</image>
 23+ <location>http://128.114.20.64/media/senate_proceeding_02-10-06.ogg?t=01:30:59/01:31:24</location>
 24+ <image>http://metavid.org/w/index.php?action=ajax&amp;rs=mv_frame_server&amp;stream_name=senate_proceeding_02-10-06&amp;t=1:30:59&amp;size=400x300</image>
2525 <info>http://metavid.ucsc.edu/overlay/video_player/webview?stream_name=senate_proceeding_02-10-06&amp;t=01:30:59/01:31:24</info>
2626 </track>
2727 <track>
2828 <title>random clip</title>
2929 <annotation>example annotation
3030 </annotation>
31 - <location>http://metavid.ucsc.edu/media/senate_11-14-05.ogg.anx?t=0:44:14/0:45:56</location>
32 - <image>http://metavid.ucsc.edu/image_media/senate_proceeding_06-08-06?t=0:44:14&amp;size=320x240</image>
 31+ <location>http://128.114.20.64/media/senate_11-14-05.ogg?t=0:44:14/0:45:56</location>
 32+ <image>http://metavid.org/w/index.php?action=ajax&amp;rs=mv_frame_server&amp;stream_name=senate_proceeding_06-08-06&amp;t=0:44:14&amp;size=400x300</image>
3333 <info>http://metavid.ucsc.edu/overlay/video_player/webview?stream_name=senate_proceeding_06-08-06&amp;t=0:44:14/0:45:56</info>
3434 </track>
3535 </trackList>
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_playlists.php
@@ -8,7 +8,7 @@
99 <html>
1010 <head>
1111 <title>sample playlist usage</title>
12 - <script type="text/javascript" src="<?php echo htmlspecialchars( $mv_path ) ?>mv_embed.js"></script>
 12+ <script type="text/javascript" src="<?php echo htmlspecialchars( $mv_path ) ?>mv_embed.js?<?php echo time()?>"></script>
1313 </head>
1414 <body>
1515 <h3> Sample Playlists</h3>
@@ -59,7 +59,7 @@
6060 ?>
6161 <table border="1" cellpadding="6" width="600">
6262 <? foreach ( $sample_embed as $key => $aval ) {
63 - // $key!=8
 63+ // &&
6464 if ( $key != 9 && $key != 8)continue;
6565 ?>
6666 <tr>
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_clipedit.js
@@ -52,10 +52,10 @@
5353 var eb = $j('#embed_vid').get(0);
5454 //turn on preview to avoid onDone actions
5555 eb.preview_mode = true;
56 -
57 - $j('#'+this.control_ct).html(
58 - '<h3>Edit Video Tools:</h3>' +
59 - '<strong>Set in-out points</strong>'+
 56+ $j('#'+this.control_ct).html('<h3>Edit Video Tools:</h3>');
 57+ if( eb.supportsURLTimeEncoding() ){
 58+ js_log("SUPPORTS supports_url_time_encoding do start end");
 59+ $j('#'+this.control_ct).append('<strong>Set in-out points</strong>'+
6060 '<table border="0" style="background: transparent; width:94%;height:50px;">'+
6161 '<tr>' +
6262 '<td style="width:50px">'+
@@ -89,22 +89,22 @@
9090 '<input name="mv_end_hr_rsd" id="mv_end_hr_rsd" value="' + eb.end_ntp + '" maxlength="8" size="8" class="mv_adj_hr"/>'+
9191 '</span>'+
9292 '<div style="clear: both;"/>'+
93 - '<input id="mv_preview_clip" type="button" value="Preview/Play In-out points">'+
94 - this.getInsertControl()
95 - );
96 - //setup bindings:
97 - add_adjust_hooks('rsd');
 93+ '<input id="mv_preview_clip" type="button" value="Preview/Play In-out points">');
 94+
 95+ //setup bindings for adjust / preview:
 96+ add_adjust_hooks('rsd');
 97+ $j('#mv_preview_clip').click(function(){
 98+ $j('#embed_vid').get(0).stop();
 99+ $j('#embed_vid').get(0).play();
 100+ });
 101+ }
 102+ $j('#'+this.control_ct).append( this.getInsertControl() );
98103
99 - $j('#mv_preview_clip').click(function(){
100 - $j('#embed_vid').get(0).stop();
101 - $j('#embed_vid').get(0).play();
102 - });
103 -
104104 this.applyInsertControlBindings();
105105 },
106106 getInsertControl:function(){
107107 return '<h3>Inline Description</h3>' +
108 - '(you can copy and paste from the transcript by clicking on the cc button below the video)'+
 108+ '(you can copy and paste from the transcript by clicking on the cc button below the video)<br>'+
109109 '<textarea style="width:300px;" id="mv_inline_img_desc" rows="4" cols="30"></textarea><br>'+
110110 '<h3>Actions</h3>'+
111111 '<input type="button" class="mv_insert_image_page" value="' + getMsg('mv_insert_image_page') + '"> '+
@@ -123,7 +123,7 @@
124124 $j('.mv_insert_image_page').click(function(){
125125 _this.applyEdit();
126126 //copy over the desc text to the resource object
127 - rObj['inlineDesc']= $j('#mv_inline_img_desc').val();
 127+ _this.rObj['inlineDesc']= $j('#mv_inline_img_desc').val();
128128 _this.p_rsdObj.insertResource( _this.rObj );
129129 });
130130 $j('.mv_preview_insert').click(function(){
@@ -150,10 +150,10 @@
151151 '<div class="mv_edit_button mv_scale_button_base" id="mv_scale_button" alt="crop" title="'+getMsg('mv_scale')+'"></div>'+
152152 '<a href="#" class="mv_scale_msg">' + getMsg('mv_scale') + '</a><br>'+
153153 '<a href="#" style="display:none" class="mv_apply_scale">' + getMsg('mv_apply_scale') + '</a> '+
154 - '<a href="#" style="display:none" class="mv_rest_scale">' + getMsg('mv_reset_scale') + '</a> '+
 154+ '<a href="#" style="display:none" class="mv_rest_scale">' + getMsg('mv_reset_scale') + '</a><br> '+
155155 _this.getInsertControl()
156156 );
157 - //add bidings:
 157+ //add bindings:
158158 $j('#mv_crop_button,.mv_crop_msg,.mv_apply_crop').click(function(){
159159 js_log('click:mv_crop_button: base width: ' + _this.rObj.width + ' bh: ' + _this.rObj.height);
160160 if($j('#mv_crop_button').hasClass('mv_crop_button_selected')){
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_playlist.js
@@ -1191,7 +1191,7 @@
11921192 //js_log('do xsfp parse: '+ this.data.innerHTML);
11931193 var properties = { title:'title', linkback:'info',
11941194 author:'creator',desc:'annotation',
1195 - img:'image', date:'date' };
 1195+ poster:'image', date:'date' };
11961196 var tmpElm = null;
11971197 //get the first instance of any of the meta tags (ok that may be the meta on the first clip)
11981198 //js_log('do loop on properties:' + properties);
@@ -1210,7 +1210,7 @@
12111211 //add any clip specific properties
12121212 properties.src = 'location';
12131213 for (var i=0;i<clips.length;i++){
1214 - var cur_clip = new mvClip({type:'srcClip',id:'p_'+this.id+'_c_'+i,pp:this,order:i});
 1214+ var cur_clip = new mvClip({id:'p_'+this.id+'_c_'+i,pp:this,order:i});
12151215 //js_log('cur clip:'+ cur_clip.id);
12161216 for(var j in properties){
12171217 tmpElm = clips[i].getElementsByTagName( properties[j] )[0];
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/styles.css
@@ -386,8 +386,8 @@
387387 margin: 10px 0;
388388 padding: 0 20px;
389389 }
390 -.videoOptionsBox div.block ul a {text-decoration: none;}
391 -.videoOptionsBox div.block ul li {margin: 7px 0;}
 390+.videoOptionsBox div.block ul a { text-decoration: none;}
 391+.videoOptionsBox div.block ul li { margin: 7px 0;}
392392 .videoOptionsBox div.block ul li ul {margin: 0;}
393393 .videoOptionsBox div.block ul li ul li a {color: #df5c01;}
394394 .videoOptionsBox div.block ul li ul li a:hover {color: #ffa02f;}
@@ -507,9 +507,8 @@
508508 ul.rsd_cp_tabs li.rsd_selected {
509509 background:#FFFFFF none repeat scroll 0 0;
510510 border-bottom:0;
511 - padding-bottom:7px;
512 - padding-top:12px;
513 - top:40px;
 511+ padding-bottom:11px;
 512+ padding-top:12px;
514513 }
515514 ul.rsd_cp_tabs li {
516515 display:inline;
@@ -517,7 +516,7 @@
518517 padding:10px 0 0;
519518 background:#F7F7F7 url(remote_search/tab-bg.png) repeat-x scroll left bottom;
520519 border:1px solid #777;
521 - padding-bottom:6px;
 520+ padding-bottom:10px;
522521 margin-left:7px;
523522 cursor:pointer;
524523 }
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -1236,13 +1236,18 @@
12371237 init : function(element)
12381238 {
12391239 //js_log('adding mediaSource: ' + element);
1240 - this.src = $j(element).attr('src');
 1240+ this.src = $j(element).attr('src');
12411241 this.marked_default = false;
12421242 if ( element.tagName.toLowerCase() == 'video')
12431243 this.marked_default = true;
12441244
1245 - //set default timeFormat:
1246 - this['timeFormat']='anx';
 1245+ //set default timeFormat if we have a time url:
 1246+ //not ideal way to discover if content is on an oggz_chop server.
 1247+ //should check some other way.
 1248+ var pUrl = parseUri ( this.src );
 1249+ if(typeof pUrl['queryKey']['t'] != 'undefined'){
 1250+ this['timeFormat']='anx';
 1251+ }
12471252
12481253 for(var i=0; i < mv_default_source_attr.length; i++){ //for in loop oky on object
12491254 var attr = mv_default_source_attr[ i ];
@@ -1261,10 +1266,7 @@
12621267
12631268 //set the title if unset:
12641269 if( !this.title ){
1265 - var parts = this.mime_type.split("/",2);
1266 - parts[0]=parts[0].replace('video', 'stream');
1267 - parts[1]=parts[1].replace('x-flv', 'flash');
1268 - this.title = parts[1] + ' ' + parts[0];
 1270+ this.title = this.mime_type;
12691271 }
12701272 this.parseURLDuration();
12711273 },
@@ -1406,10 +1408,12 @@
14071409 //we can issue a HEAD request and read the mime type of the media...
14081410 // (this will detect media mime type independently of the url name)
14091411 //http://www.jibbering.com/2002/4/httprequest.html (this should be done by extending jquery's ajax objects)
1410 - switch(uri.substr(uri.lastIndexOf('.'),4)){
 1412+ var end_inx = (uri.indexOf('?')!=-1)? uri.indexOf('?') : uri.length;
 1413+ var no_param_uri = uri.substr(0, end_inx);
 1414+ switch( no_param_uri.substr(no_param_uri.lastIndexOf('.'),4) ){
14111415 case '.flv':return 'video/x-flv';break;
14121416 case '.ogg':return 'video/ogg';break;
1413 - case '.anx':return 'video/annodex';break;
 1417+ case '.anx':return 'video/ogg';break;
14141418 }
14151419 }
14161420 };
@@ -1921,14 +1925,14 @@
19221926 // first check if seek can be done on locally downloaded content.
19231927 doSeek : function( perc ){
19241928 js_log('f:mv_embed:doSeek:'+perc);
1925 - if( this.media_element.selected_source.supports_url_time_encoding ){
 1929+ if( this.supportsURLTimeEncoding() ){
19261930 js_log('Seeking to ' + this.seek_time_sec + ' (local copy of clip not loaded at' + perc + '%)');
19271931 this.stop();
19281932 //this.seek_time_sec = 0;
19291933 }
19301934 //do play in 100ms (give things time to clear)
19311935 setTimeout('$j(\'#' + this.id + '\').get(0).play()',100);
1932 - },
 1936+ },
19331937 doEmbedHTML:function()
19341938 {
19351939 js_log('f:doEmbedHTML');
@@ -2769,13 +2773,17 @@
27702774 return document.embeds[this.pid];
27712775 }
27722776 return null;
2773 - },
 2777+ },
 2778+ //HELPER Functions for selected source
27742779 /*
27752780 * returns the selected source url for players to play
27762781 */
27772782 getURI : function(seek_time_sec){
27782783 return this.media_element.selected_source.getURI( this.seek_time_sec );
27792784 },
 2785+ supportsURLTimeEncoding: function(){
 2786+ return this.media_element.selected_source.supports_url_time_encoding;
 2787+ },
27802788 setSliderValue: function(perc, hide_progress){
27812789
27822790 //js_log('setSliderValue:'+perc+' ct:'+ this.currentTime);
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_flashEmbed.js
@@ -1720,7 +1720,7 @@
17211721 $f().getPlugin('screen').css({'opacity':'1.0'});
17221722 }
17231723 /* to support local seeks */
1724 - if(this.currentTime > 1 && this.seek_time_sec != 0 && !this.media_element.selected_source.supports_url_time_encoding)
 1724+ if(this.currentTime > 1 && this.seek_time_sec != 0 && !this.supportsURLTimeEncoding() )
17251725 {
17261726 js_log('flashEmbed: _local_ Seeking to ' + this.seek_time_sec);
17271727 this.fla.seek( this.seek_time_sec );
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_vlcEmbed.js
@@ -182,7 +182,7 @@
183183 },
184184 liveFeedRoll: 0,
185185 onPlaying: function(){
186 - if(this.seek_time_sec != 0 && !this.media_element.selected_source.supports_url_time_encoding)
 186+ if(this.seek_time_sec != 0 && !this.supportsURLTimeEncoding() )
187187 {
188188 // VLC seems to have a problem seeking into the future this way
189189 var ms_difference = this.seek_time_sec * 1000 - this.vlc.input.time;
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libRemoteMediaSearch/mv_remote_media_search.js
@@ -280,7 +280,7 @@
281281 drawTabs: function(){
282282 var _this = this;
283283 //add the tabs to the rsd_results container:
284 - var o='<div class="rsd_tabs_container" style="position:absolute;top:53px;width:100%;left:12px;">';
 284+ var o='<div class="rsd_tabs_container" style="position:absolute;top:49px;width:100%;left:12px;height:25px;">';
285285 o+= '<ul class="rsd_cp_tabs" style="margin: 0 0 0 0;position:absolute;top:0px;padding:0;">'; //no idea why margin does not overwrite from the css
286286 o+='<li id="rsd_tab_combined" ><img src="' + mv_embed_path + 'skins/'+mv_skin_name+ '/remote_search/combined_tab.png"></li>';
287287 for(var cp_id in this.content_providers){
@@ -366,7 +366,6 @@
367367 var rObj = _this.getResourceFromId( this.id );
368368 //remove any existing resource edit interface:
369369 $j('#rsd_resource_edit').remove();
370 -
371370 //set the media type:
372371 if(rObj.mime.indexOf('image')!=-1){
373372 //set width to default image_edit_width
@@ -418,6 +417,7 @@
419418 'width': maxWidth + 'px',
420419 'height': parseInt( tRatio * maxWidth) + 'px'
421420 }, "slow"); // do it slow to give it a chance to finish loading the HQ version
 421+
422422 _this.loadHQImg(rObj, {'width':maxWidth}, 'rsd_edit_img', function(){
423423 $j('.mv_img_loader').remove();
424424 });
@@ -487,7 +487,7 @@
488488 });
489489 }
490490 if( mediaType == 'video'){
491 -
 491+ js_log('append html: ' + rObj.pSobj.getEmbedHTML( rObj, {id:'embed_vid'}) );
492492 $j('#clip_edit_disp').append(
493493 rObj.pSobj.getEmbedHTML( rObj, {id:'embed_vid'})
494494 );
@@ -495,7 +495,7 @@
496496 rewrite_by_id('embed_vid',function(){
497497 //grab any information that we got from the ROE xml or parsed from the media file
498498 rObj = rObj.pSobj.getEmbedObjParsedInfo(rObj, 'embed_vid');
499 - //add the resizable to the doLoad request:
 499+ //add the re-sizable to the doLoad request:
500500 loadLibs['$j.ui.resizable'] = 'jquery/jquery.ui-1.5.2/ui/minified/ui.resizable.min.js',
501501 loadLibs['$j.fn.hoverIntent'] = 'jquery/plugins/jquery.hoverIntent.js';
502502 mvJsLoader.doLoad( loadLibs,function(){
@@ -724,14 +724,10 @@
725725 '<input type="button" id="preview_do_insert" value="Do Insert">' +
726726 '<a href="#" id="preview_close">Do More Modification</a>' +
727727 '</div>' +
728 - '</div>');
729 - //do a page preview given the original page text, insert point
730 - js_log('insert at: ' + _this.caret_pos.s + "\n" + rObj.pSobj.getEmbedWikiText( rObj ) );
 728+ '</div>');
 729+ //update the preview_wtext
 730+ _this.updatePreviewText( rObj );
731731
732 - //update the preview_wtext
733 - _this.preview_wtext = _this.caret_pos.text.substring(0, _this.caret_pos.s) +
734 - rObj.pSobj.getEmbedWikiText( rObj ) +
735 - _this.caret_pos.text.substring( _this.caret_pos.s );
736732
737733 _this.getParsedWikiText(_this.preview_wtext, _this.target_title,
738734 function(phtml){
@@ -747,6 +743,15 @@
748744 });
749745 });
750746 },
 747+ updatePreviewText:function( rObj ){
 748+ var _this = this;
 749+ //insert at start if textInput cursor has not been set (ie == length)
 750+ if( _this.caret_pos.text.length == _this.caret_pos.s)
 751+ _this.caret_pos.s=0;
 752+ _this.preview_wtext = _this.caret_pos.text.substring(0, _this.caret_pos.s) +
 753+ rObj.pSobj.getEmbedWikiText( rObj ) +
 754+ _this.caret_pos.text.substring( _this.caret_pos.s );
 755+ },
751756 getParsedWikiText:function( wikitext, title, callback ){
752757 var reqObj = {
753758 'action':'parse',
@@ -757,6 +762,7 @@
758763 });
759764 },
760765 insertResource:function( rObj){
 766+ this.updatePreviewText( rObj );
761767 $j('#'+this.target_textbox).val( this.preview_wtext );
762768 this.closeAll();
763769 },
@@ -925,6 +931,9 @@
926932 getImageObj:function( rObj, size, callback){
927933 callback( {'url':rObj.poster} );
928934 },
 935+ getEmbedObjParsedInfo:function(rObj, eb_id){
 936+ return rObj;
 937+ },
929938 getEmbedWikiText:function(rObj){
930939 var layout = ( rObj.layout)? rObj.layout:"right"
931940 var o= '[[' + this.rsd.cFileNS + ':' + rObj.target_resource_title + '|thumb|'+layout;
@@ -1116,7 +1125,7 @@
11171126 'thumbwidth':page.imageinfo[0].thumbwidth,
11181127 'thumbheight':page.imageinfo[0].thumbheight,
11191128 'mime':page.imageinfo[0].mime,
1120 - 'src':page.imageinfo.url,
 1129+ 'src':page.imageinfo[0].url,
11211130 'desc':page.revisions[0]['*'],
11221131 //add pointer to parent serach obj:
11231132 'pSobj':_this,
@@ -1124,9 +1133,9 @@
11251134 'categories':page.categories
11261135 }
11271136 }
1128 - for(var i in this.resultsObj[page_id]){
1129 - //js_log('added '+ i +' '+ this.resultsObj[page_id][i]);
1130 - }
 1137+ //for(var i in this.resultsObj[page_id]){
 1138+ // js_log('added '+ i +' '+ this.resultsObj[page_id][i]);
 1139+ //}
11311140 }
11321141 }else{
11331142 js_log('no results:' + data);
@@ -1141,6 +1150,9 @@
11421151 }
11431152 },
11441153 getImageObj:function( rObj, size, callback ){
 1154+ if( rObj.mime=='application/ogg' )
 1155+ return callback( {'url':rObj.src, 'poster' : rObj.url } );
 1156+
11451157 //build the query to get the req size image:
11461158 var reqObj = {
11471159 'action':'query',
@@ -1155,7 +1167,7 @@
11561168 do_api_req( reqObj, this.cp.api_url , function(data){
11571169 var imObj = {};
11581170 for(var page_id in data.query.pages){
1159 - var iminfo = data.query.pages[ page_id ].imageinfo[0];
 1171+ var iminfo = data.query.pages[ page_id ].imageinfo[0];
11601172 //check if thumb size > than image size and is jpeg or png (it will not scale well above its max res)
11611173 if( ( iminfo.mime=='image/jpeg' || iminfo=='image/png' ) &&
11621174 iminfo.thumbwidth > iminfo.width ){
@@ -1163,7 +1175,7 @@
11641176 imObj['width'] = iminfo.width;
11651177 imObj['height'] = iminfo.height;
11661178 }else{
1167 - imObj['url'] = iminfo.thumburl;
 1179+ imObj['url'] = iminfo.thumburl;
11681180 imObj['width'] = iminfo.thumbwidth;
11691181 imObj['height'] = iminfo.thumbheight;
11701182 }
@@ -1179,14 +1191,25 @@
11801192 },
11811193 getEmbedHTML: function( rObj , options) {
11821194 //set up the output var with the default values:
1183 - var outOpt = { 'width': rObj.width, 'height': rObj.height, 'src' : rObj.url};
1184 - if( options.max_height ){
 1195+ var outOpt = { 'width': rObj.width, 'height': rObj.height};
 1196+ if( options['max_height'] ){
11851197 outOpt.height = (options.max_height > rObj.height) ? rObj.height : options.max_height;
1186 - outOpt.width = (rObj.width / rObj.height) *outOpt.height;
1187 - }
 1198+ outOpt.width = (rObj.width / rObj.height) *outOpt.height;
 1199+ }
 1200+ var style_attr = 'style="width:' + outOpt.width + 'px;height:' + outOpt.height +'px"';
 1201+ var id_attr = (options['id'])?' id = "' + options['id'] +'" ': '';
 1202+
 1203+ //return the html type:
11881204 if(rObj.mime.indexOf('image')!=-1){
1189 - return '<img src="' + outOpt.src + '" style="width:' + outOpt.width + 'px;height:' + outOpt.height +'px">';
 1205+ return '<img ' + id_attr + ' src="' + rObj.url + '"' + style_attr + ' >';
11901206 }
 1207+ if(rObj.mime.indexOf('application/ogg')!=-1){
 1208+ return '<video ' + id_attr +
 1209+ ' src="' + rObj.src + '" ' +
 1210+ style_attr +
 1211+ ' poster="'+ outOpt.url + '" '+
 1212+ ' ></video>';
 1213+ }
11911214 js_log('ERROR:unsupored mime type: ' + rObj.mime);
11921215 },
11931216 //returns the inline wikitext for insertion (template based crops for now)
@@ -1195,8 +1218,7 @@
11961219 var layout = ( rObj.layout)? rObj.layout:"right"
11971220 //if crop is null do base output:
11981221 if( rObj.crop == null)
1199 - return this.parent_getEmbedWikiText( rObj );
1200 -
 1222+ return this.parent_getEmbedWikiText( rObj );
12011223 //using the preview crop template: http://en.wikipedia.org/wiki/Template:Preview_Crop
12021224 //@@todo should be replaced with server side cropping
12031225 return '{{Preview Crop ' + "\n" +

Status & tagging log