r43152 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43151‎ | r43152 | r43153 >
Date:21:13, 3 November 2008
Author:dale
Status:old
Tags:
Comment:
updates to smil sequencer (style updates, improved clipEdit view)
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_common.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_nativeEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_playlist.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_remote_media_search.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_sequencer.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/mv_sequence.css (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php
@@ -110,8 +110,9 @@
111111 foreach($seqNodeList as $seqNode){
112112 //import the top seq node:
113113 $topSeqNode = $this->smilDoc->importNode($seqNode, false);
114 - //get all the references
115 - $refNodeList = $seqNode->childNodes;
 114+ //get all the media references
 115+ //@@todo also get the alias tags (video, audio, image ..etc)
 116+ $refNodeList = $seqNode->getElementsByTagName('ref');
116117 foreach($refNodeList as $refNode){
117118 //make sure its a valid ref node:
118119 $refNode = $this->smilDoc->importNode( $this->resolveResourceNode($refNode), true );
@@ -262,14 +263,14 @@
263264 $this->parseInnerWikiText( $node, $thumbnail->toHtml() );
264265 }else{
265266 $node->setAttribute( 'type', $img->getMimeType() );
266 - $node->setAttribute( 'src', $thumbnail->getURL() );
 267+ $node->setAttribute( 'src', $img->getURL() );
267268
268269 //if type is ogg: (set dur and poster)
269270 if( $img->getMimeType()=='application/ogg') {
270271 if( !$node->hasAttribute('dur') )
271272 $node->setAttribute('dur', $thumbnail->file->getLength() );
272273 if( !$node->hasAttribute('poster') ){
273 - $node->setAttribute('poster', $thumbnail->url);
 274+ $node->setAttribute('poster', $thumbnail->getURL() );
274275 }
275276 }
276277 }
Index: trunk/extensions/MetavidWiki/skins/mv_common.js
@@ -1,10 +1,24 @@
22 /*@@TODO should be set by mediaWiki so it uses wfMsg */
33 var global_loading_txt = 'loading<blink>...</blink>';
44
5 -
6 -function add_adjust_hooks(mvd_id, track_dur){
 5+/*
 6+* adds adjustment hooks
 7+* @mvd_id set to the mvd_id
 8+*/
 9+function add_adjust_hooks(mvd_id, track_dur, targets){
710 if(track_dur)track_dur=parseInt(track_dur);
811 js_log('add_adjust_hooks: ' + mvd_id + ' td: '+ track_dur);
 12+
 13+ /*var base_targets = new Array('mv_end_hr', 'mv_start_hr', 'track_target' );
 14+
 15+ if( typeof targets == 'object'){
 16+ for(var i in targets){
 17+
 18+ }
 19+ }else{
 20+
 21+ }*/
 22+
923 //if options are unset populate functions:
1024 //add mouse over end time frame highlight
1125 $j('#mv_end_hr_'+mvd_id).hoverIntent({interval:200,over:function(){
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_nativeEmbed.js
@@ -1,4 +1,4 @@
2 -
 2+//native embed library:
33 var nativeEmbed = {
44 instanceOf:'nativeEmbed',
55 canPlayThrough:false,
@@ -133,7 +133,10 @@
134134 }
135135 },
136136 pause : function(){
137 - this.vid.pause();
 137+ this.getVID();
 138+ if(this.vid){
 139+ this.vid.pause();
 140+ }
138141 //stop updates:
139142 this.stopMonitor();
140143 },
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/mv_sequence.css
@@ -36,12 +36,15 @@
3737 border:solid thin gray;
3838
3939 }
 40+/**************************/
 41+.clip_img{
 42+ }
4043 .clip_edit_button{
4144 width:16px;
4245 height:16px;
4346 position:absolute;
4447 top:0px;
45 - right:60px;
 48+ right:50px;
4649 cursor:pointer;
4750 }
4851 .clip_trans_box{
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -34,20 +34,18 @@
3535 //media_server mv_embed_path (the path on media servers to mv_embed for java iframe with leading and trailing slashes)
3636 var mv_media_iframe_path = '/mv_embed/';
3737
38 -//the default height/width of the vidoe (if no style or width attr provided)
 38+//the default height/width of the video (if no style or width attr provided)
3939 var mv_default_video_size = '400x300';
4040
41 -//this restricts playable sources to ROE xml media without start end time atttribute
 41+//this restricts playable sources to ROE xml media without start end time attribute
4242 var mv_restrict_roe_time_source = true;
4343
44 -
4544 var global_player_list = new Array();
4645 var global_req_cb = new Array();//the global request callback array
4746 var _global = this;
4847 var mv_init_done=false;
4948 var global_cb_count =0;
5049
51 -
5250 /*
5351 * its best if you just require all your external data sources to serve up json data.
5452 * or
@@ -254,13 +252,15 @@
255253 //check if all videos are "ready to play"
256254 var is_ready=true;
257255 for(var i in global_player_list){
258 - var cur_vid = $j('#'+global_player_list[i]).get(0);
259 - is_ready = (cur_vid.ready_to_play ) ? is_ready : false;
260 - if( !is_ready && cur_vid.load_error ){
261 - is_ready=true;
262 - $j(cur_vid).html( cur_vid.load_error );
 256+ if( $j('#'+global_player_list[i]).length !=0){
 257+ var cur_vid = $j('#'+global_player_list[i]).get(0);
 258+ is_ready = (cur_vid.ready_to_play ) ? is_ready : false;
 259+ if( !is_ready && cur_vid.load_error ){
 260+ is_ready=true;
 261+ $j(cur_vid).html( cur_vid.load_error );
 262+ }
263263 }
264 - }
 264+ }
265265 js_log('f:check_init_done '+ is_ready + ' ' + cur_vid.load_error + ' rtp: '+ cur_vid.ready_to_play);
266266 if( !is_ready ){
267267 //js_log('some ' + global_player_list + ' not ready');
@@ -2647,7 +2647,7 @@
26482648 var height = (this.pc)?this.pc.pp.height:this.playerPixelHeight();
26492649
26502650 if(this.pc)
2651 - height+=(plObj.pl_layout.title_bar_height + plObj.pl_layout.control_height);
 2651+ height+=(this.pc.pp.pl_layout.title_bar_height + this.pc.pp.pl_layout.control_height);
26522652
26532653 var fade_in = true;
26542654 if($j('#blackbg_'+sel_id).length!=0)
@@ -2690,9 +2690,10 @@
26912691 var supporting_players = embedTypes.players.getMIMETypePlayers(mime_type);
26922692
26932693 var select_html='<div id="player_select_list_' + index + '" class="player_select_list"><ul>';
2694 - for(i in supporting_players){
2695 - //put colored plugin icon and no link for supported player:
2696 - if(embedTypes.players.defaultPlayer(mime_type).id==supporting_players[i].id ){
 2694+ for(var i in supporting_players){
 2695+ //js_log('checking
 2696+ //put colored (selected) display if selected_player matches current
 2697+ if( this.selected_player.id == supporting_players[i].id ){
26972698 select_html+='<li>'+
26982699 '<img border="0" width="16" height="16" src="'+mv_embed_path+'images/plugin.png">'+
26992700 supporting_players[i].getName() +
@@ -2721,9 +2722,9 @@
27222723 //js_log('selected src'+ _this.media_element.selected_source.url);
27232724 $j.each(this.media_element.getPlayableSources(), function(index, source)
27242725 {
2725 - var default_player = embedTypes.players.defaultPlayer(source.getMIMEType());
 2726+ var default_player = embedTypes.players.defaultPlayer( source.getMIMEType() );
27262727 var source_select_code = '$j(\'#'+this_id+'\').get(0).closeDisplayedHTML(); $j(\'#'+_this.id+'\').get(0).media_element.selectSource(\''+index+'\');';
2727 - var player_code = _this.getPlayerSelectList(source.getMIMEType(), index, source_select_code);
 2728+ var player_code = _this.getPlayerSelectList( source.getMIMEType(), index, source_select_code);
27282729 var is_not_selected = (source != _this.media_element.selected_source);
27292730 var image_src = mv_embed_path+'/images/stream/';
27302731 image_src += (source.mime_type == 'video/x-flv')?'flash_icon_':'fish_xiph_org_';
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_remote_media_search.js
@@ -12,7 +12,7 @@
1313 num_req:0,
1414
1515 result_display_mode:'box', //box or list
16 - api_mode:'mediawiki', //api mode (mediawiki api or metavid enhanced wiki api)
 16+ api_mode:'metavid', //api mode (mediawiki api or metavid enhanced wiki api)
1717 resultsObj:{},
1818 //init the object:
1919 init:function( initObj ){
@@ -38,34 +38,38 @@
3939 //check if we are in metavid Temporal semantic media search mode
4040 //add an "advanced search" button
4141
42 - //add in controls: (find a better place for these / use css )
43 - var box_dark = (this.result_display_mode=='box')?'_dark':'';
44 - var list_dark = (this.result_display_mode=='list')?'_dark':'';
 42+ //add in controls: (find a better place for these / use css
 43+ //this seems highly verbose do do a simple control
 44+ var box_dark_url = mv_embed_path + 'skins/' + mv_skin_name + '/images/box_layout_icon_dark.png';
 45+ var box_light_url = mv_embed_path + 'skins/' + mv_skin_name + '/images/box_layout_icon.png';
 46+ var list_dark_url = mv_embed_path + 'skins/' + mv_skin_name + '/images/list_layout_icon_dark.png';
 47+ var list_light_url = mv_embed_path + 'skins/' + mv_skin_name + '/images/list_layout_icon.png';
 48+
4549 $j('#'+this.target_submit).after('<img id="msc_box_layout" ' +
46 - 'src = "' + mv_embed_path + 'skins/' + mv_skin_name + '/images/box_layout_icon' + box_dark + '.png" ' +
 50+ 'src = "' + ( (_this.result_display_mode=='box')?box_dark_url:box_light_url ) + '" ' +
4751 'style="width:20px;height:20px;cursor:pointer;"> ' +
4852 '<img id="msc_list_layout" '+
49 - 'src = "' + mv_embed_path + 'skins/' + mv_skin_name + '/images/list_layout_icon' + list_dark + '.png" '+
 53+ 'src = "' + ( (_this.result_display_mode=='list')?list_dark_url:list_light_url ) + '" '+
5054 'style="width:20px;height:20px;cursor:pointer;">'
5155 );
52 - js_log('should have set: ' +this.target_submit);
 56+
5357 $j('#msc_box_layout').hover(function(){
54 - $j(this).attr("src", mv_embed_path+'skins/'+mv_skin_name+'/images/box_layout_icon_dark.png');
55 - }, function(){
56 - var box_dark = (_this.result_display_mode=='box')?'_dark':'';
57 - $j(this).attr("src", mv_embed_path+'skins/'+mv_skin_name+'/images/box_layout_icon'+box_dark+'.png');
 58+ $j(this).attr("src", box_dark_url );
 59+ }, function(){
 60+ $j(this).attr("src", ( (_this.result_display_mode=='box')?box_dark_url:box_light_url ) );
5861 }).click(function(){
59 - $j(this).attr("src", mv_embed_path+'skins/'+mv_skin_name+'/images/box_layout_icon_dark.png');
 62+ $j(this).attr("src", box_dark_url);
 63+ $j('#msc_list_layout').attr("src", list_light_url);
6064 _this.setDispMode('box');
6165 });
6266
6367 $j('#msc_list_layout').hover(function(){
64 - $j(this).attr("src", mv_embed_path+'skins/'+mv_skin_name+'/images/list_layout_icon_dark.png');
 68+ $j(this).attr("src", list_dark_url);
6569 }, function(){
66 - var list_dark = (_this.result_display_mode=='list')?'_dark':'';
67 - $j(this).attr("src", mv_embed_path+'skins/'+mv_skin_name+'/images/list_layout_icon'+list_dark+'.png');
 70+ $j(this).attr("src", ( (_this.result_display_mode=='list')?list_dark_url:list_light_url ) );
6871 }).click(function(){
69 - $j(this).attr("src", mv_embed_path+'skins/'+mv_skin_name+'/images/list_layout_icon_dark.png');
 72+ $j(this).attr("src", list_dark_url);
 73+ $j('#msc_box_layout').attr("src", box_light_url);
7074 _this.setDispMode('list');
7175 });
7276
@@ -82,7 +86,8 @@
8387 js_log('f:getSearchResults for:' + $j('#'+this.target_input).val() );
8488 //set results div to "loading"
8589 $j('#'+this.target_results).html( getMsg('loading_txt') );
86 -
 90+ //empty out the current results:
 91+ this.resultsObj={};
8792 //do two queries against the Image / File namespace:
8893 if( this.api_mode=='mediawiki' ){
8994 //construct search request:
@@ -116,7 +121,12 @@
117122 _this.addMediaWikiAPIResults( data);
118123 _this.checkRequestDone();
119124 });
120 - }
 125+ }
 126+ //do unified media search call to metavid toolset:
 127+ if(this.api_mode == 'metavid'){
 128+ //do unified query request:
 129+
 130+ }
121131 },
122132 //check request done used for when we have multiple requests to check before formating results.
123133 checkRequestDone:function(){
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_sequencer.js
@@ -54,9 +54,8 @@
5555 sequence_tools_id:'mv_sequence_tools',
5656 timeline_id:'mv_timeline',
5757 plObj_id:'seq_plobj',
58 - plObj_clone:null,
 58+ plObj_clone:null,
5959
60 -
6160 timeline_scale:.125, //in pixel to second ratio ie 100pixles for every ~30seconds
6261 timeline_duration:500, //default timeline length in seconds
6362 playline_time:0,
@@ -443,7 +442,7 @@
444443 //close the tag
445444 o+='</sequence_hlrd>';
446445
447 - js_log('f:getSeqOutputHLRDXML'+ o);
 446+ alert('f:getSeqOutputHLRDXML'+ o);
448447
449448 return false;
450449 },
@@ -490,10 +489,26 @@
491490 $j('#modal_window').empty().show();
492491 //set to the current clip in "clip mode"
493492 var clip = this.plObj.tracks[track_inx].clips[ clip_inx ];
494 - $j('#modal_window').append('<div style="position:absolute;top:10%left:auto;right:auto;">'+
495 -
496 - '</div>');
497 - $j('#modal_window').append('<div style="position:absolute;bottom:10%;left:50%;">'+
 493+ //@@todo do per clip type edit modes:
 494+ $j('#modal_window').append('<div style="position:absolute;top:10px;left:25%;width:'+this.plObj.width+'px;">'+
 495+ '<h3>' + clip.getTitle() + '</h3>'+
 496+ '<video id="chop_clip_' + track_inx + '_' + clip_inx + '" ' +
 497+ 'style="width:'+this.plObj.width+'px;height:'+this.plObj.height+'px;" '+
 498+ 'poster="'+clip.embed.media_element.getThumbnailURL()+'" ' +
 499+ 'src="' + clip.src + '"></video>'+
 500+ '<div style="padding-top:10px;">'+
 501+ '<span style="position:absolute;left:0px;">'+
 502+ 'start time:<input id="chop_start" type="text" size="10" value="0:0:0">'+
 503+ '</span>'+
 504+ '<span style="position:absolute;right:0px;">'+
 505+ 'end time:<input id="chop_end" type="text" size="10" '+
 506+ 'value="' + seconds2ntp(clip.getDuration()) + '" >' +
 507+ '</span>'+
 508+ '</div>'+
 509+ '</div>'
 510+ //start time end time field display
 511+ );
 512+ $j('#modal_window').append('<div style="position:absolute;bottom:10px;left:50%;">'+
498513 '<a style="border:solid gray;font-size:1.2em;" onClick="window.confirm(\''+getMsg('edit_cancel_confirm')+'\')" '+
499514 'href="javascript:'+this.instance_name+'.closeModWindow()">'+
500515 getMsg('edit_cancel') + '</a> '+
@@ -502,13 +517,18 @@
503518 '</a>'+
504519 '</div>'
505520 );
 521+ rewrite_by_id('chop_clip_' + track_inx + '_' + clip_inx );
 522+ //add in-out setters
 523+
 524+ //add start / end hooks
 525+
506526 },
507527 //save new clip segment
508528 saveClipEdit:function(){
509529 //saves the clip updates
510530 },
511531 closeModEditor:function(){
512 - $j('#modalbox').hide();
 532+ $j('#modalbox,#mv_overlay').remove();
513533 },
514534 closeModWindow:function(){
515535 $j('#modal_window').hide();
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_playlist.js
@@ -996,6 +996,12 @@
997997 '</div>');
998998 }
999999 },
 1000+ getTitle:function(){
 1001+ if(typeof this.title == 'string')
 1002+ return this.title
 1003+
 1004+ return 'untitled clip ' + this.order;
 1005+ },
10001006 getThumb:function(){
10011007 var out='';
10021008 //if we have the parent playlist grab it to get the image scale

Status & tagging log