* fixed bug where drag and drop of clips did not work where you re-arranged clips while not displaying the add-media-wizard tab
* fixed display of sequence playhead on clip click
* added deselect of clips on escape
* Other minor code cleanup
init:function(){
var _this = this;
//@@todo check for new version of toolbar and via toolbar api:
- if(typeof $j.fn.toolbar == 'undefined'){
- //add the add-media-wizard button for old toolbar:
- $j('#toolbar').append('<img style="cursor:pointer" id="btn-add-media-wiz" src="' + mv_skin_img_path + 'Button_add_media.png">');
- $j('#btn-add-media-wiz').addMediaWiz(
- mwAddMediaConfig
- );
- }
+
+ //add the add-media-wizard button for old toolbar:
+ $j('#toolbar').append('<img style="cursor:pointer" id="btn-add-media-wiz" src="' + mv_skin_img_path + 'Button_add_media.png">');
+ $j('#btn-add-media-wiz').addMediaWiz(
+ mwAddMediaConfig
+ );
+
+ //add to new toolbar (need to use api)
+ //$j('[rel=insert] .tool-file').addMediaWiz(
+ // mwAddMediaConfig
+ //);
}
}
js_log("seqRemoteSearchDriver::" + _this.pSeq.disp_menu_item);
//call the parent
_this.pSeq.parent_do_refresh_timeline();
- //add our local bindings if our window is 'active'
- if(_this.pSeq.disp_menu_item == 'cliplib'){
- _this.addResultBindings();
- }
+ //add our local bindings
+ _this.addResultBindings();
return true;
}
}
}
//create the media element (target order+1 (since we insert (after)
- _this.pSeq.plObj.tryAddMediaObj( clipConfig, (parseInt(target_order) + 1) );
+ _this.pSeq.plObj.tryAddMediaObj( clipConfig, (parseInt(target_order) + 1) );
//refresh the timeline:
_this.pSeq.do_refresh_timeline();
js_log("run close all: ");
}
///js_log('did vI style');
//now swap out the video element for the embed_video obj:
- $j(video_element).after(embed_video).remove();
- //js_log('did swap');
- $j('#'+embed_video.id).get(0).on_dom_swap();
+ $j(video_element).after(embed_video).remove();
+ //js_log('did swap');
+ $j('#'+embed_video.id).get(0).on_dom_swap();
+
// now that "embed_video" is stable, do more initialization (if we are ready)
if($j('#'+embed_video.id).get(0).loading_external_data==false &&
$j('#'+embed_video.id).get(0).init_with_sources_loadedDone==false){
//load and set ready state since source are available:
$j('#'+embed_video.id).get(0).init_with_sources_loaded();
- }
+ }
+
js_log('done with child: ' + embed_video.id + ' len:' + global_player_list.length);
return true;
},
js_log('set loading_external_data=false');
_this.loading_external_data=false;
- _this.init_with_sources_loaded();
+ _this.init_with_sources_loaded();
});
}
},
var missing_type ='';
var or ='';
for( var i=0; i < this.media_element.sources.length; i++){
- missing_type+=or + this.media_element.sources[i].mime_type;
+ missing_type+= or + this.media_element.sources[i].mime_type;
or=' or ';
}
if( this.pc )
this.load_error= this.getPluginMissingHTML(missing_type);
}
},
- inheritEmbedObj:function(){
+ inheritEmbedObj:function(){
js_log("inheritEmbedObj:duration is: " + this.duration);
//@@note: tricky cuz direct overwrite is not so ideal.. since the extended object is already tied to the dom
//clear out any non-base embedObj stuff:
},
getHTML : function (){
//@@todo check if we have sources avaliable
- js_log('embedVideo:getHTML : ' + this.id );
+ js_log('embedVideo:getHTML : ' + this.id + ' resource type: ' + this.type);
var _this = this;
var html_code = '';
html_code = '<div id="videoPlayer_'+this.id+'" style="width:'+this.width+'px;" class="videoPlayer">';
- html_code += '<div style="width:'+parseInt(this.width)+'px;height:'+parseInt(this.height)+'px;" id="mv_embedded_player_'+this.id+'">' +
- this.getThumbnailHTML() +
- '</div>';
- //js_log("mvEmbed:controls "+ typeof this.controls);
- if(this.controls)
- {
- js_log("f:getHTML:AddControls");
- html_code +='<div id="mv_embedded_controls_' + this.id + '" class="ui-widget ui-corner-bottom ui-state-default controls" >';
- html_code += this.getControlsHTML();
- html_code +='</div>';
- //block out some space by encapulating the top level div
- $j(this).wrap('<div style="width:'+parseInt(this.width)+'px;height:'
- +(parseInt(this.height)+ctrlBuilder.height)+'px"></div>');
- }
+ html_code += '<div style="width:'+parseInt(this.width)+'px;height:'+parseInt(this.height)+'px;" id="mv_embedded_player_'+this.id+'">' +
+ this.getThumbnailHTML() +
+ '</div>';
+ //js_log("mvEmbed:controls "+ typeof this.controls);
+ if(this.controls)
+ {
+ js_log("f:getHTML:AddControls");
+ html_code +='<div id="mv_embedded_controls_' + this.id + '" class="ui-widget ui-corner-bottom ui-state-default controls" >';
+ html_code += this.getControlsHTML();
+ html_code +='</div>';
+ //block out some space by encapulating the top level div
+ $j(this).wrap('<div style="width:'+parseInt(this.width)+'px;height:'
+ +(parseInt(this.height)+ctrlBuilder.height)+'px"></div>');
+ }
html_code += '</div>'; //videoPlayer div close
//js_log('should set: '+this.id);
$j(this).html( html_code );
+ source.getTitle()+'</a> '+ '</li>'+"\n";
if( source.getURI().indexOf('?t=')!==-1){
out+=dl_line;
- }else if(this.getMIMEType()=="text/cmml" || this.getMIMEType()=="text/x-srt"){
+ }else if( this.getMIMEType()=="text/cmml" || this.getMIMEType()=="text/x-srt" ){
dl_txt_list+=dl_line;
}else{
dl_list+=dl_line;
},
/*
* base embed pause
- * there is no general way to pause the video
+ * there is no general way to pause the video
* must be overwritten by embed object to support this functionality.
*/
pause: function(){
setStatus:function(value){
$j('#mv_time_'+this.id).html( value );
},
- setSliderValue:function(value){
- if( this.controls ){
- //slider is on 1000 scale:
- var val = parseInt( value *1000 );
- $j('#mv_play_head_' + this.id).slider('value', val);
- }
+ setSliderValue:function(value){
+ //slider is on 1000 scale:
+ var val = parseInt( value *1000 );
+ $j('#mv_play_head_' + this.id).slider('value', val);
},
getPlayHeadPos: function(prec_done){
var _this = this;
this.cur_clip.embed.stop();
},
updateCurrentClip:function( new_clip ){
- js_log('f:updateCurrentClip:'+new_clip.id);
+ js_log('f:updateCurrentClip:'+new_clip.id);
//make sure we are not switching to the current
- if( this.cur_clip.id == new_clip.id )
- return js_log('trying to updateCurrentClip to same clip');
+ if( this.cur_clip.id == new_clip.id ){
+ js_log('trying to updateCurrentClip to same clip');
+ return false;
+ }
//keep the active play clip in sync (stop the other clip)
if( this.cur_clip ){
//setup the embed object:
setUpEmbedObj:function(){
js_log('mvClip:setUpEmbedObj()');
- //init:
- //debugger;
+ //init:
this.embed=null;
src:this.src
};
- this.setBaseEmbedDim(init_pl_embed);
- //always display controls for playlists:
+ this.setBaseEmbedDim( init_pl_embed );
+
//if in sequence mode hide controls / embed links
// init_pl_embed.play_button=false;
if(this.poster)init_pl_embed['thumbnail']=this.poster;
if( this.type )init_pl_embed['type'] = this.type;
-
- this.embed = new PlMvEmbed( init_pl_embed );
+ this.embed = new PlMvEmbed( init_pl_embed );
+
//js_log('media Duration:' + this.embed.getDuration() );
//js_log('media element:'+ this.embed.media_element.length);
//js_log('type of embed:' + typeof(this.embed) + ' seq:' + this.pp.sequencer+' pb:'+ this.embed.play_button);
var th=Math.round( _this.pl_layout.clip_desc * _this.height );
var tw=Math.round( th * _this.pl_layout.clip_aspect );
+
//run the parent stop:
this.pe_stop();
var pl_height = (_this.sequencer=='true')?_this.height+27:_this.height;
this.getHTML();
-
},
play:function(){
//js_log('pl eb play');
//setup hover images (for playhead and next/prev buttons)
this.pc.pp.setUpHover();
//call the parent postEmbedJS
- this.pe_postEmbedJS();
- mv_lock_vid_updates=false;
+ this.pe_postEmbedJS();
+ mv_lock_vid_updates=false;
},
getPlayButton:function(){
return this.pe_getPlayButton(this.pc.pp.id);
//status updates handled by playlist obj
},
setSliderValue:function(value){
+ js_log('PlMvEmbed:setSliderValue:' + value);
//setSlider value handled by playlist obj
}
}
//js_log('data:'+ this.data.toString());
$j.each(this.data.split("\n"), function(i,n){
//js_log('on line '+i+' val:'+n+' len:'+n.length);
- if(n.charAt(0)!='#'){
- if(n.length>3){
+ if( n.charAt(0) != '#' ){
+ if( n.length > 3 ){
//@@todo make sure its a valid url
//js_log('add url: '+i + ' '+ n);
var cur_clip = new mvClip({type:'srcClip',id:'p_'+this_pl.id+'_c_'+inx,pp:this_pl,src:n,order:inx});
'title':'',
'interface_url':"",
'linkback':"",
- 'mTitle':"",
- 'mTalk':"",
- 'mTouchedTime':""
+ 'mTitle':"",
+ 'mTalk':"",
+ 'mTouchedTime':""
};
$j.each(meta_tags, function(i,meta_elm){
//js_log( "on META tag: "+ $j(meta_elm).attr('name') );
js_log("done proc seq tags");
return true;
},
- tryAddMediaObj:function(mConfig, order, track_id){
- var mediaElement = document.createElement('ref');
+ tryAddMediaObj:function(mConfig, order, track_id){
+ js_log('tryAddMediaObj::');
+ var mediaElement = document.createElement('div');
for(var i =0; i < mv_smil_ref_supported_attributes.length;i++){
var attr = mv_smil_ref_supported_attributes[i];
if(mConfig[attr])
- $j(mediaElement).attr(attr, mConfig[attr]);
- }
+ $j(mediaElement).attr( attr, mConfig[attr] );
+ }
this.tryAddMedia(mediaElement, order, track_id);
},
tryAddMedia:function(mediaElement, order, track_id){
"id":'p_' + _this.id + '_c_' + order,
"pp":this, //set the parent playlist object pointer
"order": order
- };
+ };
var clipObj = new mvSMILClip(mediaElement, cConfig );
//set optional params track
if( typeof track_id != 'undefined')
clipObj["track_id"] = track_id;
- //debugger;
+
if ( clipObj ){
//set up embed:
- clipObj.setUpEmbedObj();
+ clipObj.setUpEmbedObj();
+ //inhreit embedObject (only called on "new media"
+ clipObj.embed.init_with_sources_loaded();
//add clip to track:
this.addCliptoTrack( clipObj , order);
+
return true;
- }
+ }
//@@todo we could throw error details here once we integrate try catches everywhere :P
return false;
}
_this = this;
this.params = {};
//make new mvCLip with ClipInit vals
- var myMvClip = new mvClip( mvClipInit );
-
+ var myMvClip = new mvClip( mvClipInit );
//inherit mvClip
for(var method in myMvClip){
if(typeof this[method] != 'undefined' ){
* http://www.w3.org/TR/SMIL3/smil-timing.html#Timing-ClockValueSyntax
* (probably have to use a Time object to fully support the smil spec
*/
-function smilParseTime(time_str){
+function smilParseTime( time_str ){
+ time_str = time_str + '';
//first check for hh:mm:ss time:
if(time_str.split(':').length == 3){
return npt2seconds(time_str);
if( e.which == 16 )
_this.key_shift_down = false;
- if( e.which == 17)
+ if( e.which == 17 )
_this.key_ctrl_down = false;
+ //escape key (for now deselect)
+ if( e.which == 27 )
+ _this.deselectClip();
+
+
//backspace or delete key while not focused on a text area:
if( (e.which == 8 || e.which == 46) && !_this.inputFocus)
_this.removeSelectedClips();
return insert_key;
},
deselectClip:function( clipElm ){
- $j(clipElm).removeClass("mv_selected_clip");
- //make sure the transition sibling is removed:
- $j(clipElm).siblings('.clip_trans_box').removeClass( 'mv_selected_transition' );
- $j('#' + $j(clipElm).parent().attr("id") + '_adj').fadeOut("fast");
+ if(!clipElm){
+ $j('.mv_selected_clip').removeClass("mv_selected_clip");
+ }else{
+ $j(clipElm).removeClass("mv_selected_clip");
+ //make sure the transition sibling is removed:
+ $j(clipElm).siblings('.clip_trans_box').removeClass( 'mv_selected_transition' );
+ $j('#' + $j(clipElm).parent().attr("id") + '_adj').fadeOut("fast");
+ }
},
getClipFromSeqID:function( clip_seq_id ){
js_log('get id from: ' + clip_seq_id);
mvSeqPlayList.prototype = {
init:function(element){
var myPlObj = new mvPlayList(element);
+
//inherit mvClip
for(var method in myPlObj){
if(typeof this[method] != 'undefined' ){
- this['parent_'+method]=myPlObj[method];
+ this[ 'parent_' + method ]=myPlObj[method];
}else{
this[method] = myPlObj[method];
}
}
+
this.org_control_height = this.pl_layout.control_height;
//do specific mods:(controls and title are managed by the sequencer)
this.pl_layout.title_bar_height=0;
this.pl_layout.control_height=0;
},
setSliderValue:function( perc ){
+ js_log('setSliderValue::'+ perc);
//get the track_clipThumb_height from parent mvSequencer
var frame_width = Math.round( this.pSeq.track_clipThumb_height * 1.3333333 );
var container_width = frame_width+60;