r44180 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44179‎ | r44180 | r44181 >
Date:18:54, 3 December 2008
Author:dale
Status:deferred
Tags:
Comment:
* fixed vlc seeking bug
* moved full screen to the left with fixed position

updates to SMIL sequencer
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/MV_DefaultSettings.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_Hooks.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_SequenceTools.php (modified) (history)
  • /trunk/extensions/MetavidWiki/languages/MV_Messages.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_flashEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_htmlEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_vlcEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_page.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_clip_edit.js (added) (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_sequencer.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_sequence.js (deleted) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_sequence.off.js (added) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/MV_DefaultSettings.php
@@ -132,7 +132,7 @@
133133 $mvDispROEicon=false;
134134
135135 //The text Embed a metavid Stream inline in the wiki
136 -$mvEmbedKey = 'EmbedStream';
 136+$mvEmbedKey = 'Embed';
137137
138138 //wars people of archive inacuracys (given its a wiki and the source is close caption feed)
139139 $mvEnableStreamNotice=true;
Index: trunk/extensions/MetavidWiki/includes/MV_Hooks.php
@@ -78,15 +78,14 @@
7979 */
8080 function mvLinkEnd($skin, $title, $options, &$text, &$attribs, &$ret){
8181 global $mvDefaultAspectRatio, $mvDefaultVideoPlaybackRes, $mvEmbedKey;
82 - //only do link rewrites for STREAM and SEQUENCE name space when on an article page
83 - if( ( substr( $title->getText(), 0, strlen( $mvEmbedKey ) ) != $mvEmbedKey ) &&
84 - $title->getNamespace() != MV_NS_SEQUENCE ){
 82+ //only do link rewrites for $mvEmbedKey
 83+ if( substr( $title->getText(), 0, strlen( $mvEmbedKey ) ) != $mvEmbedKey ){
8584 return true;
86 - }
 85+ }
8786 //parse text for extra parameters
88 - //@@todo integrate with image params / maybe file handle )
 87+ //@@todo integrate with image params / maybe file handle )
8988 $params = explode('|', $text);
90 - //setup defaults:
 89+ //setup defaults:
9190 $size = $mvDefaultVideoPlaybackRes;
9291 $start_ntp=$end_ntp=null;
9392 foreach($params as $param){
@@ -235,7 +234,7 @@
236235 return false;
237236 break;
238237 default:
239 - // continue proccessing (use default editor)
 238+ // continue processing (use default editor)
240239 return true;
241240 break;
242241 }
@@ -328,7 +327,7 @@
329328 $MV_Overlay = new MV_Overlay();
330329 return $MV_Overlay->get_edit_disp( $titleKey, $mvd_id );
331330 }
332 -/* genneral autocomplete */
 331+/* general autocomplete */
333332 function mv_helpers_auto_complete( $val = null ) {
334333 global $mvMetaDataHelpers, $wgRequest;
335334 $property = $wgRequest->getVal( 'prop_name' );
Index: trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_SequenceTools.php
@@ -87,17 +87,23 @@
8888 }
8989 //handles copy / paste clip board data actions
9090 function do_clipboard( $action ){
91 - global $wgRequest;
 91+ global $wgRequest, $wgUser;
9292 //validate the user-edit token (for both copy and paste)
93 - $token = $wgRequest->getVal( 'clipboardEditToken');
 93+ $token = $wgRequest->getVal( 'clipboardEditToken');
 94+
9495 //store the clipboard
9596 if( $action == 'copy' ){
96 - return '';
 97+ return '1';
9798 }
9899 //get the clipboard
99100 if( $action == 'paste'){
100101 return '';
101102 }
 103+ //error out:
 104+ return php2jsObj( array( 'status' => 'error',
 105+ 'error_txt' => wfMsg('mv_unknown_clipboard_action')
 106+ )
 107+ );
102108 }
103109 function add_embed_search() {
104110 global $wgOut;
Index: trunk/extensions/MetavidWiki/languages/MV_Messages.php
@@ -251,6 +251,7 @@
252252 'mv_welcome_to_sequencer' => '<h3>Welcome to the sequencer demo</h3>
253253 very <b>limited</b> functionality right now. Click on a Clip to edit that resource',
254254 'mv_resource_locator' => 'Resource Locator',
 255+ 'mv_unknown_clipboard_action' => 'Unknown Clipboard Action',
255256
256257 'mv_media_search' => 'Media search',
257258
Index: trunk/extensions/MetavidWiki/skins/mv_sequence.js
@@ -1,292 +0,0 @@
2 -/*sequencer helper code */
3 -
4 -mv_addLoadEvent(setup_sequencer);
5 -mvSeq=null;
6 -function setup_sequencer(){
7 - mv_do_sequence({
8 - mv_pl_url_id:'mv_pl_url',
9 - video_container_id:'mv_video_container',
10 - sequence_tools_id:'MV_SequenceTools',
11 - timeline_id:'MV_SequenceTimeline'
12 - });
13 -}
14 -
15 -/*
16 - * similar to mv_d_ajax_form_submit in mv_stream.js
17 - * @@todo could be merged with mv_do_ajax_form_submit from mv_stream (into mv_common.js or something like that)
18 - * */
19 -function mv_do_ajax_form_submit(mvd_id, edit_action){
20 - if(mvSeq==null){
21 - js_error('sequence is not ready...');
22 - return '';
23 - }
24 - //set sajax to do a post request
25 - sajax_request_type='POST';
26 - var args = new Object();
27 - var post_vars = new Object();
28 -
29 - var form = document.getElementById('mvd_form_'+mvd_id);
30 - var buttonList = {'wpSave':true, 'wpPreview':true, 'wpLivePreview':true, 'wpDiff':true};
31 - for(i=0;i<form.elements.length;i++){
32 - if(buttonList[ form.elements[i].name ]){
33 - //don't include button unless its the edit action
34 - if(form.elements[i].name.toLowerCase().indexOf( edit_action.toLowerCase() )!=-1){
35 - post_vars[ form.elements[i].name ]=form.elements[i].value;
36 - }
37 - }else{
38 - post_vars[ form.elements[i].name ]=form.elements[i].value;
39 - }
40 - //js_log(form.elements[i].name + ' = ' + form.elements[i].value);
41 - }
42 - post_vars['inline_seq'] = mvSeq.getSeqText('inline');
43 -
44 - js_log("sending: edit action:"+ edit_action + ' url:'+ post_vars.toSource());
45 -
46 - $j('#mv_seq_edit_preview').html( global_loading_txt);
47 - uri = wgServer +
48 - ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript) +
49 - "?action=ajax";
50 - //add in mediaWiki ajax hook req
51 - uri+='&rs=mv_edit_sequence_submit';
52 - $j.post(uri, post_vars, function(data){
53 - switch(edit_action){
54 - case 'save':
55 - eval(data);
56 - if(mv_result['status']=='ok'){
57 - //wait 1 seconds to give time for defered updates
58 - setTimeout(function(){
59 - window.location.href = wgServer+
60 - ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript) +
61 - '/' + wgPageName + '?action=purge';
62 - }, 1000);
63 - }else if(mv_result['status']=='error'){
64 - $j('#mv_seq_edit_preview').html( mv_result['error_txt'] );
65 - }
66 - break;
67 - case 'preview':
68 - $j('#mv_seq_edit_preview').html(data);
69 - break;
70 - }
71 - })
72 - //do not actually submit
73 - return false;
74 -}
75 -function mv_seqtool_disp(tool_key){
76 - //hide all not part of the key
77 - $j('.mv_seq_tool').each(function(i){
78 - if(this.id!='mvseq_'+tool_key)$j(this).fadeOut("fast");
79 - });
80 - if($j('#mvseq_'+tool_key).length==0){
81 - $j('#mv_seqtool_cont').append('<div class="mv_seq_tool" id="mvseq_'+tool_key+'">' +
82 - global_loading_txt + '</div>');
83 - //do the request load the added tool
84 - uri = wgServer +
85 - ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript) +
86 - "?action=ajax";
87 - uri+='&rs=mv_seqtool_disp&rsargs[]='+tool_key;
88 - $j('#mvseq_'+tool_key).load(uri, function(){
89 - //add post hooks based on key:
90 - switch(tool_key){
91 - case 'add_clips_manual':
92 - mv_manual_hooks();
93 - break;
94 - case 'add_clips_search':
95 - mvJsLoader.doLoad({'mv_setup_search':'../mv_search.js'},function(){
96 - mv_setup_search('ajax');
97 - });
98 - break;
99 - }
100 - });
101 - }else{
102 - $j('#mvseq_'+tool_key).fadeIn("fast");
103 - }
104 -
105 -}
106 -function mv_ajax_search_callback(){
107 - js_log('mv_ajax_search_callback');
108 - //rewrite pagging with ajax
109 - $j('#mv_search_pagging a').each(function(){
110 - $j(this).attr('href', 'javascript:mv_do_ajax_search_request(\''+$j(this).attr('href')+'&seq_inline=true\')');
111 - });
112 - //$j('.mv_rtdesc').each(function(){
113 - // $j(this).prepend('<img onClick=" title="'+getMsg('add_to_end_of_sequence')+'" src="'+mv_embed_path + 'images/application_side_expand.png">');
114 - //});
115 -}
116 -//applies mv_seq manual javascript bindings
117 -function mv_manual_hooks(){
118 - js_log('mv_manual_hooks');
119 - //load empty mv_embed in #mv_seq_manual_embed
120 - //will be updated based on autocomplete and selected range of selectors
121 - //add autocomplete hook to stream_name #mv_add_stream_name
122 - uri = wgServer +
123 - ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript);
124 - $j('#mv_add_stream_name').autocomplete(
125 - uri,
126 - {
127 - autoFill:true,
128 - onItemSelect:function(v){
129 - js_log('selected:' + v.innerHTML );
130 - //unhide adjustment & add hooks (with duration) :
131 - $j('#mv_add_adj_cnt').fadeIn('fast');
132 - add_adjust_hooks('seq', $j(v).children('.mv_stream_duration').html() );
133 - //add embed video clip:
134 - var embedCode = $j(v).children('.mv_vid_embed').html();
135 - $j('#mv_seq_manual_embed').fadeIn('fast');
136 - $j('#mv_seq_manual_embed').html( embedCode );
137 -
138 - js_log("embed code:"+ $j('#mv_seq_manual_embed').html() );
139 -
140 - //base height:
141 - var mv_seq_base_height = $j('#mv_seq_manual_embed').height();
142 -
143 - //run mv_embed rewrite for the video tag:
144 - rewrite_by_id('vid_seq');
145 - var vid_seq = $j('#vid_seq').get(0);
146 - //override play action:
147 - vid_seq['old_play']= vid_seq['play'];
148 - vid_seq['old_stop']= vid_seq['stop'];
149 - vid_seq['play'] = function(){
150 - vid_seq.old_play();
151 - $j('#mv_seq_manual_embed').css('height', (mv_seq_base_height+70) +'px');
152 - js_log('height is: ' + $j('#mv_seq_manual_embed').css('height')); }
153 - vid_seq['stop']=function(){
154 - $j('#mv_seq_manual_embed').css('height',mv_seq_base_height +'px');
155 - vid_seq.old_stop();
156 - }
157 - //@@todo add_drag_drop_hook();
158 -
159 - //add a title output:
160 - $j('#mv_seq_manual_embed').append('<span id="mv_seq_player_time" class="mv_video_time_hr">0:00:00 to 0:00:30</span>');
161 - //'mv_edit_im_'+mvd_id
162 - //$j('#mv_edit_im_'+mvd_id).attr('src', $j(v).children('img').attr('src'));
163 - },
164 - formatItem:function(row){
165 - //hide the duration and embed video in there:
166 - var out = '<div style="display:none;" class="mv_stream_duration">'+row[3]+'</div>' +
167 - '<div style="display:none;" class="mv_vid_embed">'+row[4]+'</div>' +
168 - '<img width="80" height="60" src="'+ row[2] + '">'+row[1];
169 - js_log('OUT:'+ out);
170 - return out;
171 - },
172 - matchSubset:0,
173 - extraParams:{action:'ajax',rs:'mv_auto_complete_stream_name'},
174 - paramName:'rsargs[]',
175 - resultElem:'#mv_add_stream_name_choices'
176 - });
177 -
178 - //add clip adjustment hooks
179 -}
180 -function mv_add_to_seq(target){
181 - js_log('mv_add_to_seq');
182 - //add to the seq:
183 - if(mvSeq){
184 - if(target){
185 - mvSeq.addClip({
186 - track_id:0,
187 - type:'mvClip',
188 - mvclip:target.mvclip,
189 - src: target.src,
190 - img:target.img_url
191 - });
192 - }else{
193 - //do a preloaded mvSeq clip (get the src)
194 - var spos = $j('#vid_seq').get(0).thumbnail.indexOf('size=');
195 - var sepos = $j('#vid_seq').get(0).thumbnail.indexOf('&', spos);
196 - var end_img_url = (sepos!=-1)? $j('#vid_seq').get(0).thumbnail.substring(sepos):'';
197 -
198 - var img_url = (spos!=-1)?
199 - $j('#vid_seq').get(0).thumbnail.substring(0, spos) + 'size=320x240'+end_img_url:
200 - $j('#vid_seq').get(0).thumbnail;
201 - mvSeq.addClip({
202 - track_id:0,
203 - type:'mvClip',
204 - mvclip:$j('#mv_add_stream_name').val() +'?t='+ $j('#mv_start_hr_seq').val() + '/'+
205 - $j('#mv_end_hr_seq').val(),
206 - src: $j('#vid_seq').get(0).src,
207 - img:img_url
208 - });
209 - }
210 - }else{
211 - js_error("error: sequence is not present");
212 - }
213 -}
214 -//currently disabled:
215 -function add_drag_drop_hook(){
216 - /* helper: function(){
217 - $j('body').append($j(this).clone().attr({
218 - id:'img_thum_vid_seq_drag',
219 - style:'position:absolute',
220 - zindex:99
221 - }).get(0));
222 - return $j('#img_thum_vid_seq_drag').get(0);
223 - },
224 - */
225 - $j('#img_thumb_vid_seq').draggable({
226 - opacity:50,
227 - scroll:true,
228 - zindex:99,
229 - drag:function(e, ui){
230 - js_log('left: '+ui.position.left);
231 - }
232 - });
233 - //add drop targets on clips if sequence
234 - if(mvSeq){
235 - for(i in mvSeq.tracks){
236 - for(j in mvSeq.tracks[i]){
237 - clip = mvSeq.tracks[i].clips[j];
238 - $j('#track_'+i+'_clip_'+j).droppable({
239 - over:function(e, ui){
240 - $j(this).css('border-left', 'solid thick red');
241 - },
242 - out:function(e, ui){
243 - $j(this).css('border-left', 'solid thin white');
244 - },
245 - drop:function(e, ui){
246 - js_log('drop');
247 - }
248 - });
249 - }
250 - }
251 - }
252 -}
253 -function do_video_time_update(start_time, end_time){
254 - $j('#mv_seq_player_time').html( start_time + ' to ' + end_time );
255 - if(typeof embed_id=='undefined')embed_id='vid_seq';
256 - js_log('embed_id:' + embed_id + ' src:'+$j('#'+embed_id).get(0).src );
257 - if(typeof org_vid_src=='undefined')org_vid_src=$j('#'+embed_id).get(0).src;
258 - if(typeof org_thum_src=='undefined')org_thum_src=$j('#'+embed_id).get(0).thumbnail;
259 -
260 - if(org_vid_src.indexOf('?')!=-1){
261 - var url = org_vid_src.split('?');
262 - var new_vid_url = url[0] + '?t=' + start_time+'/'+end_time;
263 - //js_log("new vid url:" +new_vid_url);
264 - if(new_vid_url!=$j('#'+embed_id).attr('src'))
265 - $j('#'+embed_id).get(0).updateVideoSrc(new_vid_url);
266 - }
267 - if(org_thum_src.indexOf('?')!=-1){
268 - var url = org_thum_src.split('?');
269 - var sloc = org_thum_src.indexOf('size=');
270 - if( sloc !=-1 ){
271 - var size = '&'+ org_thum_src.substr(org_thum_src.indexOf('size=')) ;
272 - //strip additional arguments if they past size=
273 - if(size.indexOf('&')!=-1){
274 - size = size.substr(0, size.indexOf('&'));
275 - }
276 - }else{
277 - var size ='';
278 - }
279 - var new_thumb = url[0] +'?t='+ start_time +size;
280 - //js_log("new thumb:" + new_thumb);
281 - if(new_thumb!=$j('#'+embed_id).get(0).thumbnail)
282 - $j('#'+embed_id).get(0).updateThumbnail(new_thumb);
283 - }
284 - //make sure the drag hook is applied to the new thumb:
285 - //add_drag_drop_hook();
286 -}
287 -/* build_sequence_from_playlist_state()
288 - *
289 - * gets sequence tag code from the current playlist object
290 - */
291 -function build_sequence_from_playlist_state(){
292 -
293 -}
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_page.php
@@ -47,7 +47,7 @@
4848 $sample_embed[2]['desc'] = 'simple video with controls and thumbnail';
4949
5050
51 -$sample_embed[3]['tag'] = '<video roe="http://metavid.org/w/index.php?title=Special:MvExportStream&feed_format=roe&stream_name=Senate_proceeding_08-01-07&t=0:11:40/0:12:20" ></video>';
 51+$sample_embed[3]['tag'] = '<video style="width:320px;height:240px" roe="http://metavid.org/w/index.php?title=Special:MvExportStream&feed_format=roe&stream_name=Senate_proceeding_08-01-07&t=0:11:40/0:12:20" ></video>';
5252 $sample_embed[3]['desc'] = 'Demo of ROE only attribute';
5353
5454
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_flashEmbed.js
@@ -1567,10 +1567,10 @@
15681568 //give the embed element a unique pid (work around for flowplayer persistence)
15691569 if( this.old_pid!=0 ){
15701570 this.pid = this.pid +'_'+ this.old_pid;
1571 - }
 1571+ }
15721572 return '<a '+
15731573 'href="'+this.media_element.selected_source.getURI( this.seek_time_sec ) + '" '+
1574 - 'style="display:block;width:400px;height:300px" '+
 1574+ 'style="display:block;width:' + this.width + ';height:' + this.height + '" '+
15751575 'id="'+this.pid+'">'+
15761576 '</a>';
15771577 },
@@ -1593,11 +1593,11 @@
15941594 backgroundGradient: 'none',
15951595 autoHide:'always',
15961596 top:'95%',
1597 - left:'370'
 1597+ right:'0px'
15981598 }
15991599 }
16001600 };
1601 - //if lightpd
 1601+ //if lightpd
16021602
16031603 $f(this.pid, mv_embed_path + 'flowplayer/flowplayer-3.0.0-rc4.swf', flowConfig);
16041604 //get the this.fla value:
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_htmlEmbed.js
@@ -97,7 +97,7 @@
9898 '</div>'+
9999 '</div>'
100100 );
101 - //scale down the font:
 101+ //scale down the fonts:
102102 $j('#' + thumb_render_id + ' *').filter('span,div,p,h,h1,h2,h3,h4,h5,h6').css('font-size',font_perc+'%')
103103
104104 //replace out links:
@@ -122,7 +122,7 @@
123123 return ;
124124 },
125125 getEmbedHTML:function(){
126 - js_log('f:html:getEmbedHTML');
 126+ js_log('f:html:getEmbedHTML: ' + this.id);
127127 //set up the css for our parent div:
128128 $j(this).css({'width':this.pc.pp.width, 'height':this.pc.pp.height, 'overflow':"hidden"});
129129 //@@todo support more smil animation layout stuff:
@@ -138,7 +138,7 @@
139139 }else{
140140 out = this.pc.wholeText;
141141 }
142 - js_log('f:getThumbnailHTML: got thumb: '+out);
 142+ //js_log('f:getThumbnailHTML: got thumb: '+out);
143143 return out;
144144 },
145145 doThumbnailHTML:function(){
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_vlcEmbed.js
@@ -82,6 +82,7 @@
8383 }
8484 }
8585 },
 86+ /* //disable local seeking (while we don't know what we have avaliable)
8687 doSeek : function(value){
8788 if( this.vlc ) {
8889 if( (this.vlc.input.state == 3) && (this.vlc.input.position != value) )
@@ -90,7 +91,7 @@
9192 this.setStatus( 'seeking...' );
9293 }
9394 }
94 - },
 95+ },*/
9596 playMovieAt : function (order){
9697 //@@todo add clips to playlist after (order) and then play
9798 this.play();
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -368,7 +368,7 @@
369369 var quicktimeMozillaPlayer = new mediaPlayer('quicktime-mozilla',['video/ogg'],'quicktime');
370370 var quicktimeActiveXPlayer = new mediaPlayer('quicktime-activex',['video/ogg'],'quicktime');
371371
372 -var htmlPlayer = new mediaPlayer('html',['text/html', 'image/jpeg'],'html');
 372+var htmlPlayer = new mediaPlayer('html',['text/html', 'image/jpeg', 'image/png'],'html');
373373
374374 /**
375375 * mediaPlayers is a collection of mediaPlayer objects supported by the client.
@@ -1692,7 +1692,7 @@
16931693 linkback:null,
16941694
16951695 /** @private */
1696 - init:function(video_element)
 1696+ init:function( video_element )
16971697 {
16981698 var _this = this;
16991699 js_log('Initializing mediaElement...' + video_element);
@@ -1715,7 +1715,7 @@
17161716 //js_log(' on inner source: '+i + ' obj: '+ inner_source);
17171717 _this.tryAddSource(inner_source);
17181718 });
1719 - },
 1719+ },
17201720 /** Updates the time request for all sources that have a standard time request argument (ie &t=start_time/end_time)
17211721 */
17221722 updateSourceTimes:function(start_ntp, end_ntp){
@@ -2093,10 +2093,10 @@
20942094 var _this = this;
20952095 this.selected_player.load( function()
20962096 {
2097 - js_log('inheriting '+_this.selected_player.library +'Embed to ' + _this.id + ' ' + $j('#'+_this.id).length);
 2097+ //js_log('inheriting '+_this.selected_player.library +'Embed to ' + _this.id + ' ' + $j('#'+_this.id).length);
20982098 //var _this = $j('#'+_this.id).get(0);
2099 - js_log( 'type of ' + _this.selected_player.library +'Embed + ' +
2100 - eval('typeof '+_this.selected_player.library +'Embed'));
 2099+ //js_log( 'type of ' + _this.selected_player.library +'Embed + ' +
 2100+ // eval('typeof '+_this.selected_player.library +'Embed'));
21012101 eval('embedObj = ' +_this.selected_player.library +'Embed;');
21022102 for(var method in embedObj){ //for in loop oky for object
21032103 //parent method preservation for local overwritten methods
@@ -2109,11 +2109,9 @@
21102110 }
21112111 //update controls if possible
21122112 if(!_this.loading_external_data)
2113 - _this.refreshControlsHTML();
2114 -
2115 - js_log('plugin load callback complete');
 2113+ _this.refreshControlsHTML();
21162114
2117 - js_log("READY TO PLAY:"+_this.id);
 2115+ //js_log("READY TO PLAY:"+_this.id);
21182116 _this.ready_to_play=true;
21192117 _this.getDuration();
21202118 _this.getHTML();
@@ -2443,16 +2441,14 @@
24442442 },
24452443 getHTML : function (){
24462444 //@@todo check if we have sources avaliable
2447 - js_log('f:getHTML : '+this.id);
 2445+ js_log('f:getHTML : ' + this.id );
24482446 var _this = this;
24492447 var html_code = '';
24502448 html_code = '<div id="videoPlayer_'+this.id+'" style="width:'+this.width+'px;" class="videoPlayer">';
24512449 html_code += '<div style="width:'+parseInt(this.width)+'px;height:'+parseInt(this.height)+'px;" id="mv_embedded_player_'+this.id+'">' +
24522450 this.getThumbnailHTML() +
2453 - '</div>';
2454 -
2455 - js_log("mvEmbed:controls "+ typeof this.controls);
2456 -
 2451+ '</div>';
 2452+ //js_log("mvEmbed:controls "+ typeof this.controls);
24572453 if(this.controls)
24582454 {
24592455 js_log("f:getHTML:AddControls");
@@ -2464,8 +2460,8 @@
24652461 +(parseInt(this.height)+ctrlBuilder.height)+'px"></div>');
24662462 }
24672463 html_code += '</div>'; //videoPlayer div close
2468 - js_log('should set: '+this.id);
2469 - $j(this).html(html_code);
 2464+ //js_log('should set: '+this.id);
 2465+ $j(this).html( html_code );
24702466 //add hooks once Controls are in DOM
24712467 ctrlBuilder.addControlHooks(this);
24722468
@@ -2475,7 +2471,7 @@
24762472 if(this.autoplay)
24772473 {
24782474 js_log('activating autoplay');
2479 - this.doEmbedHTML();
 2475+ this.play();
24802476 }
24812477 },
24822478 /*
@@ -2552,21 +2548,22 @@
25532549 //if we are updating don't re-go to the updating url:
25542550 if(this.thumbnail_updating && $j('#new_img_thumb_'+this.id).attr('src')== src )
25552551 return false;
2556 -
2557 - js_log('set to thumb:'+ src);
 2552+
25582553 if(quick_switch){
25592554 $j('#img_thumb_'+this.id).attr('src', src);
25602555 }else{
25612556 var _this = this;
25622557 //if still animating remove new_img_thumb_
25632558 if(this.thumbnail_updating==true)
2564 - $j('#new_img_thumb_'+this.id).stop().remove();
 2559+ $j('#new_img_thumb_'+this.id).stop().remove();
 2560+
25652561 if(this.thumbnail_disp){
 2562+ js_log('set to thumb:'+ src);
25662563 this.thumbnail_updating=true;
25672564 $j('#dc_'+this.id).append('<img src="'+src+'" ' +
25682565 'style="display:none;position:absolute;zindex:2;top:0px;left:0px;" ' +
25692566 'width="'+this.width+'" height="'+this.height+'" '+
2570 - 'id = "new_img_thumb_'+this.id+'" />');
 2567+ 'id = "new_img_thumb_'+this.id+'" />');
25712568 //js_log('appended: new_img_thumb_');
25722569 $j('#new_img_thumb_'+this.id).fadeIn("slow", function(){
25732570 //once faded in remove org and rename new:
@@ -2856,7 +2853,7 @@
28572854 * base embed controls
28582855 * the play button calls
28592856 */
2860 - play: function(){
 2857+ play:function(){
28612858 var this_id = (this.pc!=null)?this.pc.pp.id:this.id;
28622859 js_log("mv_embed play:"+this.id);
28632860 js_log('thum disp:'+this.thumbnail_disp);
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_sequencer.js
@@ -287,6 +287,9 @@
288288 var menu_item = this.menu_items[item];
289289 //do any menu item post embed js hook processing:
290290 switch(item){
 291+ case 'clipedit':
 292+ //load mv_clip_edit.js
 293+ break;
291294 case 'transition':
292295 //render out the transitions library
293296 this.renderTransitionsSet(target_id);
@@ -727,40 +730,21 @@
728731 //add a single or set of clips
729732 //to a given position and track_inx
730733 addClips:function( clipSet, before_clip_pos, track_inx){
731 - this_seq = this;
732 -
733 - js_log("seq: add clip: at: "+ before_clip_pos + ' in track: ' + track_inx);
734 - //set defaults if missing
735 - if(typeof trac_inx == 'undefined')
736 - var trackObj = this.plObj.default_track;
737 - else
738 - var trackObj= this_seq.plObj.tracks[track_inx];
739 -
 734+ this_seq = this;
 735+ js_log("seq: add clip: at: "+ before_clip_pos + ' in track: ' + track_inx);
740736 var cur_pos = before_clip_pos;
741737 js_log('paste clip before_clip_pos: ' + before_clip_pos);
 738+ //smilXML =
742739 $j.each(clipSet, function(inx, clipInitDom){
743740 var mediaElement = document.createElement('ref');
744741 for(var i in clipInitDom){
745742 if(i!='id')
746743 $j(mediaElement).attr(i, clipInitDom[i]);
747 - }
748 - var clipObj = new mvSMILClip(mediaElement,
749 - {
750 - id:'p_' + this_seq.plObj.id + '_c_'+cur_pos,
751 - pp:this_seq.plObj,
752 - order:cur_pos
753 - }
754 - )
755 - js_log('paste clip order: ' + clipObj.order);
756 - //debugger;
757 - if( clipObj ){
758 - //set up embed:
759 - clipObj.setUpEmbedObj();
760 - trackObj.addClip(clipObj, cur_pos);
 744+ }
 745+ if( this_seq.plObj.tryAddMedia( mediaElement, cur_pos, track_inx ) )
761746 cur_pos++;
762 - }
763747 });
764 - //debugger;
 748+ debugger;
765749 this.do_refresh_timeline();
766750 },
767751 removeClips:function( remove_clip_ary ){
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_clip_edit.js
@@ -0,0 +1,16 @@
 2+/*
 3+hanndles clip edit controls
 4+ 'inoutpoints':0, //should let you set the in and out points of clip
 5+ 'panzoom':0, //should allow setting keyframes and tweening modes
 6+ 'overlays':0, //should allow setting "locked to clip" overlay tracks
 7+ 'audio':0 //should allow controling the audio volume (with keyframes)
 8+*/
 9+
 10+var mvClipEdit = function(initObj) {
 11+ return this.init(initObj);
 12+};
 13+mvClipEdit.prototype = {
 14+ init:function( initObj){
 15+ //setup the clip editor
 16+ }
 17+}
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_playlist.js
@@ -775,14 +775,16 @@
776776 */
777777 addCliptoTrack: function(clipObj, pos){
778778 if( typeof clipObj['track_id'] =='undefined'){
779 - clipObj.track_id = 0;
 779+ var track = this.default_track;
 780+ }else{
 781+ var track = this.tracks[ clipObj.track_id ]
780782 }
781 - js_log('add clip' + clipObj.id +' to track: ');
782 - //set the first clip to current (maybe deprecate)
 783+ js_log('add clip' + clipObj.id +' to track: at:' + pos);
 784+ //set the first clip to current (maybe deprecated )
783785 if(clipObj.order==0){
784786 if(!this.cur_clip)this.cur_clip=clipObj;
785787 }
786 - this.tracks[ clipObj.track_id ].addClip(clipObj, pos);
 788+ track.addClip(clipObj, pos);
787789 },
788790 swapClipDesc: function(req_clipID, callback){
789791 //hide all but the requested
@@ -882,6 +884,7 @@
883885 },
884886 //setup the embed object:
885887 setUpEmbedObj:function(){
 888+ js_log('pl:setUpEmbedObj');
886889 //init:
887890 //debugger;
888891
@@ -1016,7 +1019,7 @@
10171020 },
10181021 getClipImg:function(start_offset, size){
10191022 js_log('f:getClipImg ' + start_offset + ' s:'+size);
1020 - if( !this.img){
 1023+ if( !this.img){
10211024 return mv_default_thumb_url;
10221025 }else{
10231026 if(!size && !start_offset){
@@ -1068,7 +1071,7 @@
10691072 init:function(vid_init){
10701073 //send embed_video a created video element:
10711074 ve = document.createElement('div');
1072 - for(i in vid_init){
 1075+ for(var i in vid_init){
10731076 //set the parent clip pointer:
10741077 if(i=='pc'){
10751078 this['pc']=vid_init['pc'];
@@ -1562,7 +1565,7 @@
15631566 var meta_tags = this.data.getElementsByTagName('meta');
15641567 var metaNames = new Array('title','interface_url', 'linkback', 'mTitle', 'mTalk');
15651568 $j.each(meta_tags, function(i,meta_elm){
1566 - js_log("on META tag: "+ $j(meta_elm).attr('name') );
 1569+ js_log( "on META tag: "+ $j(meta_elm).attr('name') );
15671570 for(var i in metaNames){
15681571 var _name = metaNames[i];
15691572 if( $j(meta_elm).attr('name') && $j(meta_elm).attr('content') ){
@@ -1582,40 +1585,50 @@
15831586 js_log('skipping transition: (missing id) ' + trans_elm );
15841587 }
15851588 });
1586 - js_log('loaded transitions:' + _this.transitions.length);
1587 -
 1589+ js_log('loaded transitions:' + _this.transitions.length);
15881590 //add seq (latter we will have support more than one seq tag) / more than one "track"
15891591 var seq_tags = this.data.getElementsByTagName('seq');
15901592 $j.each(seq_tags, function(i,seq_elm){
15911593 var inx = 0;
15921594 //get all the clips for the given seq:
15931595 $j.each(seq_elm.childNodes, function(i, mediaElement){
1594 - //~complex~ have to handlde a lot like "switch" "region" etc
 1596+ //~complex~ @@todo to handlde a lot like "switch" "region" etc
15951597 //js_log('process: ' + mediaElemnt.tagName);
15961598 if(typeof mediaElement.tagName!='undefined'){
1597 - //set up basic mvSMILClip send it the mediaElemnt & mvClip init:
1598 - var clipObj = new mvSMILClip(mediaElement,
1599 - {
1600 - id:'p_' + _this.id + '_c_'+inx,
1601 - pp:_this,
1602 - order:inx
1603 - }
1604 - );
1605 - if(clipObj){
1606 - //set up embed:
1607 - clipObj.setUpEmbedObj();
1608 - //add clip to track:
1609 - _this.addCliptoTrack( clipObj );
1610 - //valid clip up the order inx:
 1599+ if( _this.tryAddMedia( mediaElement, inx ) ){
16111600 inx++;
1612 - }
 1601+ }
16131602 }
16141603 });
1615 - //var cur_clip = new mvClip({type:'srcClip',id:'p_'+this.id+'_c_'+i,pp:this,order:i});
16161604 });
16171605 js_log("done proc seq tags");
16181606 return true;
1619 - }
 1607+ },
 1608+ tryAddMedia:function(mediaElement, order, track_id){
 1609+ js_log('SMIL:tryAddMedia:' + mediaElement);
 1610+ //set up basic mvSMILClip send it the mediaElemnt & mvClip init:
 1611+ var clipObj = new mvSMILClip(mediaElement,
 1612+ {
 1613+ "id":'p_' + this.id + '_c_' + order,
 1614+ "pp":this, //set the parent playlist object pointer
 1615+ "order": order
 1616+ }
 1617+ );
 1618+ //set optional params track
 1619+ if( typeof track_id != 'undefined')
 1620+ clipObj["track_id"] = track_id;
 1621+
 1622+ //debugger;
 1623+ if (clipObj ){
 1624+ //set up embed:
 1625+ clipObj.setUpEmbedObj();
 1626+ //add clip to track:
 1627+ this.addCliptoTrack( clipObj , order);
 1628+ return true;
 1629+ }
 1630+ //@@todo we could throw error details here once we integrate try catches everywhere :P
 1631+ return false;
 1632+ }
16201633 }
16211634 /* extension to mvClip to support smil properties */
16221635 var mvSMILClip=function(smil_clip_element, mvClipInit){
@@ -1652,13 +1665,15 @@
16531666 this[method] = myMvClip[method];
16541667 }
16551668 }
 1669+
16561670 //get supported media attr init non-set
16571671 $j.each(this.supported_attributes, function(i, attr){
16581672 if( $j(smil_clip_element).attr(attr)){
16591673 _this[attr]=$j(smil_clip_element).attr(attr);
16601674 }
16611675 })
1662 - this['tagName'] =smil_clip_element.tagName;
 1676+ this['tagName'] = smil_clip_element.tagName;
 1677+
16631678 if( smil_clip_element.firstChild ){
16641679 this['wholeText'] = smil_clip_element.firstChild.nodeValue;
16651680 js_log("SET wholeText for: "+this['tagName'] + ' '+ this['wholeText']);
@@ -1674,14 +1689,12 @@
16751690 this.transIn = this.pp.transitions[ this.transIn ].clone();
16761691 this.transIn.pClip = _this;
16771692 this.transIn.transAttrType='transIn';
1678 - //js_log("SET transIn for " + this.id);
16791693 }
16801694
16811695 if(this.transOut && this.pp.transitions[ this.transOut ]){
16821696 this.transOut = this.pp.transitions[ this.transOut ].clone();
16831697 this.transOut.pClip = _this;
1684 - this.transOut.transAttrType = 'transOut';
1685 - //js_log("SET transOut for " + this.id);
 1698+ this.transOut.transAttrType = 'transOut';
16861699 }
16871700 //parse duration / begin times:
16881701 if(this.dur)
@@ -1690,9 +1703,8 @@
16911704 //conform type to video/ogg:
16921705 if(this['type']=='application/ogg'){
16931706 this['type']='video/ogg'; //conform to 'video/ogg' type
1694 - }
1695 - //@@todo check if valid transition id
1696 - //debugger;
 1707+ }
 1708+
16971709 return this;
16981710 },
16991711 //returns the values of supported_attributes:
@@ -1856,8 +1868,8 @@
18571869 }
18581870 var supported_track_attr =
18591871 trackObj.prototype = {
 1872+ //eventualy should be something like "seq" per SMIL spec
18601873 //http://www.w3.org/TR/SMIL3/smil-timing.html#edef-seq
1861 - //(We don't closely mirror the smil spec at this point)
18621874 // but we don't really support anywhere near the full concept of seq containers yet either
18631875 supported_attributes: new Array(
18641876 'title',
Index: trunk/extensions/MetavidWiki/skins/mv_sequence.off.js
@@ -0,0 +1,292 @@
 2+/*sequencer helper code */
 3+
 4+mv_addLoadEvent(setup_sequencer);
 5+mvSeq=null;
 6+function setup_sequencer(){
 7+ mv_do_sequence({
 8+ mv_pl_url_id:'mv_pl_url',
 9+ video_container_id:'mv_video_container',
 10+ sequence_tools_id:'MV_SequenceTools',
 11+ timeline_id:'MV_SequenceTimeline'
 12+ });
 13+}
 14+
 15+/*
 16+ * similar to mv_d_ajax_form_submit in mv_stream.js
 17+ * @@todo could be merged with mv_do_ajax_form_submit from mv_stream (into mv_common.js or something like that)
 18+ * */
 19+function mv_do_ajax_form_submit(mvd_id, edit_action){
 20+ if(mvSeq==null){
 21+ js_error('sequence is not ready...');
 22+ return '';
 23+ }
 24+ //set sajax to do a post request
 25+ sajax_request_type='POST';
 26+ var args = new Object();
 27+ var post_vars = new Object();
 28+
 29+ var form = document.getElementById('mvd_form_'+mvd_id);
 30+ var buttonList = {'wpSave':true, 'wpPreview':true, 'wpLivePreview':true, 'wpDiff':true};
 31+ for(i=0;i<form.elements.length;i++){
 32+ if(buttonList[ form.elements[i].name ]){
 33+ //don't include button unless its the edit action
 34+ if(form.elements[i].name.toLowerCase().indexOf( edit_action.toLowerCase() )!=-1){
 35+ post_vars[ form.elements[i].name ]=form.elements[i].value;
 36+ }
 37+ }else{
 38+ post_vars[ form.elements[i].name ]=form.elements[i].value;
 39+ }
 40+ //js_log(form.elements[i].name + ' = ' + form.elements[i].value);
 41+ }
 42+ post_vars['inline_seq'] = mvSeq.getSeqText('inline');
 43+
 44+ js_log("sending: edit action:"+ edit_action + ' url:'+ post_vars.toSource());
 45+
 46+ $j('#mv_seq_edit_preview').html( global_loading_txt);
 47+ uri = wgServer +
 48+ ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript) +
 49+ "?action=ajax";
 50+ //add in mediaWiki ajax hook req
 51+ uri+='&rs=mv_edit_sequence_submit';
 52+ $j.post(uri, post_vars, function(data){
 53+ switch(edit_action){
 54+ case 'save':
 55+ eval(data);
 56+ if(mv_result['status']=='ok'){
 57+ //wait 1 seconds to give time for defered updates
 58+ setTimeout(function(){
 59+ window.location.href = wgServer+
 60+ ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript) +
 61+ '/' + wgPageName + '?action=purge';
 62+ }, 1000);
 63+ }else if(mv_result['status']=='error'){
 64+ $j('#mv_seq_edit_preview').html( mv_result['error_txt'] );
 65+ }
 66+ break;
 67+ case 'preview':
 68+ $j('#mv_seq_edit_preview').html(data);
 69+ break;
 70+ }
 71+ })
 72+ //do not actually submit
 73+ return false;
 74+}
 75+function mv_seqtool_disp(tool_key){
 76+ //hide all not part of the key
 77+ $j('.mv_seq_tool').each(function(i){
 78+ if(this.id!='mvseq_'+tool_key)$j(this).fadeOut("fast");
 79+ });
 80+ if($j('#mvseq_'+tool_key).length==0){
 81+ $j('#mv_seqtool_cont').append('<div class="mv_seq_tool" id="mvseq_'+tool_key+'">' +
 82+ global_loading_txt + '</div>');
 83+ //do the request load the added tool
 84+ uri = wgServer +
 85+ ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript) +
 86+ "?action=ajax";
 87+ uri+='&rs=mv_seqtool_disp&rsargs[]='+tool_key;
 88+ $j('#mvseq_'+tool_key).load(uri, function(){
 89+ //add post hooks based on key:
 90+ switch(tool_key){
 91+ case 'add_clips_manual':
 92+ mv_manual_hooks();
 93+ break;
 94+ case 'add_clips_search':
 95+ mvJsLoader.doLoad({'mv_setup_search':'../mv_search.js'},function(){
 96+ mv_setup_search('ajax');
 97+ });
 98+ break;
 99+ }
 100+ });
 101+ }else{
 102+ $j('#mvseq_'+tool_key).fadeIn("fast");
 103+ }
 104+
 105+}
 106+function mv_ajax_search_callback(){
 107+ js_log('mv_ajax_search_callback');
 108+ //rewrite pagging with ajax
 109+ $j('#mv_search_pagging a').each(function(){
 110+ $j(this).attr('href', 'javascript:mv_do_ajax_search_request(\''+$j(this).attr('href')+'&seq_inline=true\')');
 111+ });
 112+ //$j('.mv_rtdesc').each(function(){
 113+ // $j(this).prepend('<img onClick=" title="'+getMsg('add_to_end_of_sequence')+'" src="'+mv_embed_path + 'images/application_side_expand.png">');
 114+ //});
 115+}
 116+//applies mv_seq manual javascript bindings
 117+function mv_manual_hooks(){
 118+ js_log('mv_manual_hooks');
 119+ //load empty mv_embed in #mv_seq_manual_embed
 120+ //will be updated based on autocomplete and selected range of selectors
 121+ //add autocomplete hook to stream_name #mv_add_stream_name
 122+ uri = wgServer +
 123+ ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript);
 124+ $j('#mv_add_stream_name').autocomplete(
 125+ uri,
 126+ {
 127+ autoFill:true,
 128+ onItemSelect:function(v){
 129+ js_log('selected:' + v.innerHTML );
 130+ //unhide adjustment & add hooks (with duration) :
 131+ $j('#mv_add_adj_cnt').fadeIn('fast');
 132+ add_adjust_hooks('seq', $j(v).children('.mv_stream_duration').html() );
 133+ //add embed video clip:
 134+ var embedCode = $j(v).children('.mv_vid_embed').html();
 135+ $j('#mv_seq_manual_embed').fadeIn('fast');
 136+ $j('#mv_seq_manual_embed').html( embedCode );
 137+
 138+ js_log("embed code:"+ $j('#mv_seq_manual_embed').html() );
 139+
 140+ //base height:
 141+ var mv_seq_base_height = $j('#mv_seq_manual_embed').height();
 142+
 143+ //run mv_embed rewrite for the video tag:
 144+ rewrite_by_id('vid_seq');
 145+ var vid_seq = $j('#vid_seq').get(0);
 146+ //override play action:
 147+ vid_seq['old_play']= vid_seq['play'];
 148+ vid_seq['old_stop']= vid_seq['stop'];
 149+ vid_seq['play'] = function(){
 150+ vid_seq.old_play();
 151+ $j('#mv_seq_manual_embed').css('height', (mv_seq_base_height+70) +'px');
 152+ js_log('height is: ' + $j('#mv_seq_manual_embed').css('height')); }
 153+ vid_seq['stop']=function(){
 154+ $j('#mv_seq_manual_embed').css('height',mv_seq_base_height +'px');
 155+ vid_seq.old_stop();
 156+ }
 157+ //@@todo add_drag_drop_hook();
 158+
 159+ //add a title output:
 160+ $j('#mv_seq_manual_embed').append('<span id="mv_seq_player_time" class="mv_video_time_hr">0:00:00 to 0:00:30</span>');
 161+ //'mv_edit_im_'+mvd_id
 162+ //$j('#mv_edit_im_'+mvd_id).attr('src', $j(v).children('img').attr('src'));
 163+ },
 164+ formatItem:function(row){
 165+ //hide the duration and embed video in there:
 166+ var out = '<div style="display:none;" class="mv_stream_duration">'+row[3]+'</div>' +
 167+ '<div style="display:none;" class="mv_vid_embed">'+row[4]+'</div>' +
 168+ '<img width="80" height="60" src="'+ row[2] + '">'+row[1];
 169+ js_log('OUT:'+ out);
 170+ return out;
 171+ },
 172+ matchSubset:0,
 173+ extraParams:{action:'ajax',rs:'mv_auto_complete_stream_name'},
 174+ paramName:'rsargs[]',
 175+ resultElem:'#mv_add_stream_name_choices'
 176+ });
 177+
 178+ //add clip adjustment hooks
 179+}
 180+function mv_add_to_seq(target){
 181+ js_log('mv_add_to_seq');
 182+ //add to the seq:
 183+ if(mvSeq){
 184+ if(target){
 185+ mvSeq.addClip({
 186+ track_id:0,
 187+ type:'mvClip',
 188+ mvclip:target.mvclip,
 189+ src: target.src,
 190+ img:target.img_url
 191+ });
 192+ }else{
 193+ //do a preloaded mvSeq clip (get the src)
 194+ var spos = $j('#vid_seq').get(0).thumbnail.indexOf('size=');
 195+ var sepos = $j('#vid_seq').get(0).thumbnail.indexOf('&', spos);
 196+ var end_img_url = (sepos!=-1)? $j('#vid_seq').get(0).thumbnail.substring(sepos):'';
 197+
 198+ var img_url = (spos!=-1)?
 199+ $j('#vid_seq').get(0).thumbnail.substring(0, spos) + 'size=320x240'+end_img_url:
 200+ $j('#vid_seq').get(0).thumbnail;
 201+ mvSeq.addClip({
 202+ track_id:0,
 203+ type:'mvClip',
 204+ mvclip:$j('#mv_add_stream_name').val() +'?t='+ $j('#mv_start_hr_seq').val() + '/'+
 205+ $j('#mv_end_hr_seq').val(),
 206+ src: $j('#vid_seq').get(0).src,
 207+ img:img_url
 208+ });
 209+ }
 210+ }else{
 211+ js_error("error: sequence is not present");
 212+ }
 213+}
 214+//currently disabled:
 215+function add_drag_drop_hook(){
 216+ /* helper: function(){
 217+ $j('body').append($j(this).clone().attr({
 218+ id:'img_thum_vid_seq_drag',
 219+ style:'position:absolute',
 220+ zindex:99
 221+ }).get(0));
 222+ return $j('#img_thum_vid_seq_drag').get(0);
 223+ },
 224+ */
 225+ $j('#img_thumb_vid_seq').draggable({
 226+ opacity:50,
 227+ scroll:true,
 228+ zindex:99,
 229+ drag:function(e, ui){
 230+ js_log('left: '+ui.position.left);
 231+ }
 232+ });
 233+ //add drop targets on clips if sequence
 234+ if(mvSeq){
 235+ for(i in mvSeq.tracks){
 236+ for(j in mvSeq.tracks[i]){
 237+ clip = mvSeq.tracks[i].clips[j];
 238+ $j('#track_'+i+'_clip_'+j).droppable({
 239+ over:function(e, ui){
 240+ $j(this).css('border-left', 'solid thick red');
 241+ },
 242+ out:function(e, ui){
 243+ $j(this).css('border-left', 'solid thin white');
 244+ },
 245+ drop:function(e, ui){
 246+ js_log('drop');
 247+ }
 248+ });
 249+ }
 250+ }
 251+ }
 252+}
 253+function do_video_time_update(start_time, end_time){
 254+ $j('#mv_seq_player_time').html( start_time + ' to ' + end_time );
 255+ if(typeof embed_id=='undefined')embed_id='vid_seq';
 256+ js_log('embed_id:' + embed_id + ' src:'+$j('#'+embed_id).get(0).src );
 257+ if(typeof org_vid_src=='undefined')org_vid_src=$j('#'+embed_id).get(0).src;
 258+ if(typeof org_thum_src=='undefined')org_thum_src=$j('#'+embed_id).get(0).thumbnail;
 259+
 260+ if(org_vid_src.indexOf('?')!=-1){
 261+ var url = org_vid_src.split('?');
 262+ var new_vid_url = url[0] + '?t=' + start_time+'/'+end_time;
 263+ //js_log("new vid url:" +new_vid_url);
 264+ if(new_vid_url!=$j('#'+embed_id).attr('src'))
 265+ $j('#'+embed_id).get(0).updateVideoSrc(new_vid_url);
 266+ }
 267+ if(org_thum_src.indexOf('?')!=-1){
 268+ var url = org_thum_src.split('?');
 269+ var sloc = org_thum_src.indexOf('size=');
 270+ if( sloc !=-1 ){
 271+ var size = '&'+ org_thum_src.substr(org_thum_src.indexOf('size=')) ;
 272+ //strip additional arguments if they past size=
 273+ if(size.indexOf('&')!=-1){
 274+ size = size.substr(0, size.indexOf('&'));
 275+ }
 276+ }else{
 277+ var size ='';
 278+ }
 279+ var new_thumb = url[0] +'?t='+ start_time +size;
 280+ //js_log("new thumb:" + new_thumb);
 281+ if(new_thumb!=$j('#'+embed_id).get(0).thumbnail)
 282+ $j('#'+embed_id).get(0).updateThumbnail(new_thumb);
 283+ }
 284+ //make sure the drag hook is applied to the new thumb:
 285+ //add_drag_drop_hook();
 286+}
 287+/* build_sequence_from_playlist_state()
 288+ *
 289+ * gets sequence tag code from the current playlist object
 290+ */
 291+function build_sequence_from_playlist_state(){
 292+
 293+}
Property changes on: trunk/extensions/MetavidWiki/skins/mv_sequence.off.js
___________________________________________________________________
Added: svn:mergeinfo
Added: svn:eol-style
1294 + native

Status & tagging log