Index: trunk/phase3/js2/mwEmbed/libAddMedia/seqRemoteSearchDriver.js |
— | — | @@ -34,10 +34,8 @@ |
35 | 35 | js_log("seqRemoteSearchDriver::" + _this.pSeq.disp_menu_item); |
36 | 36 | //call the parent |
37 | 37 | _this.pSeq.parent_do_refresh_timeline(); |
38 | | - //add our local bindings if our window is 'active' |
39 | | - if(_this.pSeq.disp_menu_item == 'cliplib'){ |
40 | | - _this.addResultBindings(); |
41 | | - } |
| 38 | + //add our local bindings |
| 39 | + _this.addResultBindings(); |
42 | 40 | return true; |
43 | 41 | } |
44 | 42 | } |
— | — | @@ -121,7 +119,7 @@ |
122 | 120 | } |
123 | 121 | |
124 | 122 | //create the media element (target order+1 (since we insert (after) |
125 | | - _this.pSeq.plObj.tryAddMediaObj( clipConfig, (parseInt(target_order) + 1) ); |
| 123 | + _this.pSeq.plObj.tryAddMediaObj( clipConfig, (parseInt(target_order) + 1) ); |
126 | 124 | //refresh the timeline: |
127 | 125 | _this.pSeq.do_refresh_timeline(); |
128 | 126 | js_log("run close all: "); |
Index: trunk/phase3/js2/mwEmbed/libSequencer/mvPlayList.js |
— | — | @@ -541,12 +541,10 @@ |
542 | 542 | setStatus:function(value){ |
543 | 543 | $j('#mv_time_'+this.id).html( value ); |
544 | 544 | }, |
545 | | - setSliderValue:function(value){ |
546 | | - if( this.controls ){ |
547 | | - //slider is on 1000 scale: |
548 | | - var val = parseInt( value *1000 ); |
549 | | - $j('#mv_play_head_' + this.id).slider('value', val); |
550 | | - } |
| 545 | + setSliderValue:function(value){ |
| 546 | + //slider is on 1000 scale: |
| 547 | + var val = parseInt( value *1000 ); |
| 548 | + $j('#mv_play_head_' + this.id).slider('value', val); |
551 | 549 | }, |
552 | 550 | getPlayHeadPos: function(prec_done){ |
553 | 551 | var _this = this; |
— | — | @@ -648,10 +646,12 @@ |
649 | 647 | this.cur_clip.embed.stop(); |
650 | 648 | }, |
651 | 649 | updateCurrentClip:function( new_clip ){ |
652 | | - js_log('f:updateCurrentClip:'+new_clip.id); |
| 650 | + js_log('f:updateCurrentClip:'+new_clip.id); |
653 | 651 | //make sure we are not switching to the current |
654 | | - if( this.cur_clip.id == new_clip.id ) |
655 | | - return js_log('trying to updateCurrentClip to same clip'); |
| 652 | + if( this.cur_clip.id == new_clip.id ){ |
| 653 | + js_log('trying to updateCurrentClip to same clip'); |
| 654 | + return false; |
| 655 | + } |
656 | 656 | |
657 | 657 | //keep the active play clip in sync (stop the other clip) |
658 | 658 | if( this.cur_clip ){ |
— | — | @@ -1099,8 +1099,7 @@ |
1100 | 1100 | //setup the embed object: |
1101 | 1101 | setUpEmbedObj:function(){ |
1102 | 1102 | js_log('mvClip:setUpEmbedObj()'); |
1103 | | - //init: |
1104 | | - //debugger; |
| 1103 | + //init: |
1105 | 1104 | |
1106 | 1105 | |
1107 | 1106 | this.embed=null; |
— | — | @@ -1111,8 +1110,8 @@ |
1112 | 1111 | src:this.src |
1113 | 1112 | }; |
1114 | 1113 | |
1115 | | - this.setBaseEmbedDim(init_pl_embed); |
1116 | | - //always display controls for playlists: |
| 1114 | + this.setBaseEmbedDim( init_pl_embed ); |
| 1115 | + |
1117 | 1116 | |
1118 | 1117 | //if in sequence mode hide controls / embed links |
1119 | 1118 | // init_pl_embed.play_button=false; |
— | — | @@ -1124,9 +1123,9 @@ |
1125 | 1124 | if(this.poster)init_pl_embed['thumbnail']=this.poster; |
1126 | 1125 | |
1127 | 1126 | if( this.type )init_pl_embed['type'] = this.type; |
1128 | | - |
1129 | | - this.embed = new PlMvEmbed( init_pl_embed ); |
1130 | 1127 | |
| 1128 | + this.embed = new PlMvEmbed( init_pl_embed ); |
| 1129 | + |
1131 | 1130 | //js_log('media Duration:' + this.embed.getDuration() ); |
1132 | 1131 | //js_log('media element:'+ this.embed.media_element.length); |
1133 | 1132 | //js_log('type of embed:' + typeof(this.embed) + ' seq:' + this.pp.sequencer+' pb:'+ this.embed.play_button); |
— | — | @@ -1299,12 +1298,12 @@ |
1300 | 1299 | |
1301 | 1300 | var th=Math.round( _this.pl_layout.clip_desc * _this.height ); |
1302 | 1301 | var tw=Math.round( th * _this.pl_layout.clip_aspect ); |
| 1302 | + |
1303 | 1303 | //run the parent stop: |
1304 | 1304 | this.pe_stop(); |
1305 | 1305 | var pl_height = (_this.sequencer=='true')?_this.height+27:_this.height; |
1306 | 1306 | |
1307 | 1307 | this.getHTML(); |
1308 | | - |
1309 | 1308 | }, |
1310 | 1309 | play:function(){ |
1311 | 1310 | //js_log('pl eb play'); |
— | — | @@ -1328,8 +1327,8 @@ |
1329 | 1328 | //setup hover images (for playhead and next/prev buttons) |
1330 | 1329 | this.pc.pp.setUpHover(); |
1331 | 1330 | //call the parent postEmbedJS |
1332 | | - this.pe_postEmbedJS(); |
1333 | | - mv_lock_vid_updates=false; |
| 1331 | + this.pe_postEmbedJS(); |
| 1332 | + mv_lock_vid_updates=false; |
1334 | 1333 | }, |
1335 | 1334 | getPlayButton:function(){ |
1336 | 1335 | return this.pe_getPlayButton(this.pc.pp.id); |
— | — | @@ -1338,6 +1337,7 @@ |
1339 | 1338 | //status updates handled by playlist obj |
1340 | 1339 | }, |
1341 | 1340 | setSliderValue:function(value){ |
| 1341 | + js_log('PlMvEmbed:setSliderValue:' + value); |
1342 | 1342 | //setSlider value handled by playlist obj |
1343 | 1343 | } |
1344 | 1344 | } |
— | — | @@ -1353,8 +1353,8 @@ |
1354 | 1354 | //js_log('data:'+ this.data.toString()); |
1355 | 1355 | $j.each(this.data.split("\n"), function(i,n){ |
1356 | 1356 | //js_log('on line '+i+' val:'+n+' len:'+n.length); |
1357 | | - if(n.charAt(0)!='#'){ |
1358 | | - if(n.length>3){ |
| 1357 | + if( n.charAt(0) != '#' ){ |
| 1358 | + if( n.length > 3 ){ |
1359 | 1359 | //@@todo make sure its a valid url |
1360 | 1360 | //js_log('add url: '+i + ' '+ n); |
1361 | 1361 | var cur_clip = new mvClip({type:'srcClip',id:'p_'+this_pl.id+'_c_'+inx,pp:this_pl,src:n,order:inx}); |
— | — | @@ -1883,9 +1883,9 @@ |
1884 | 1884 | 'title':'', |
1885 | 1885 | 'interface_url':"", |
1886 | 1886 | 'linkback':"", |
1887 | | - 'mTitle':"", |
1888 | | - 'mTalk':"", |
1889 | | - 'mTouchedTime':"" |
| 1887 | + 'mTitle':"", |
| 1888 | + 'mTalk':"", |
| 1889 | + 'mTouchedTime':"" |
1890 | 1890 | }; |
1891 | 1891 | $j.each(meta_tags, function(i,meta_elm){ |
1892 | 1892 | //js_log( "on META tag: "+ $j(meta_elm).attr('name') ); |
— | — | @@ -1926,13 +1926,14 @@ |
1927 | 1927 | js_log("done proc seq tags"); |
1928 | 1928 | return true; |
1929 | 1929 | }, |
1930 | | - tryAddMediaObj:function(mConfig, order, track_id){ |
1931 | | - var mediaElement = document.createElement('ref'); |
| 1930 | + tryAddMediaObj:function(mConfig, order, track_id){ |
| 1931 | + js_log('tryAddMediaObj::'); |
| 1932 | + var mediaElement = document.createElement('div'); |
1932 | 1933 | for(var i =0; i < mv_smil_ref_supported_attributes.length;i++){ |
1933 | 1934 | var attr = mv_smil_ref_supported_attributes[i]; |
1934 | 1935 | if(mConfig[attr]) |
1935 | | - $j(mediaElement).attr(attr, mConfig[attr]); |
1936 | | - } |
| 1936 | + $j(mediaElement).attr( attr, mConfig[attr] ); |
| 1937 | + } |
1937 | 1938 | this.tryAddMedia(mediaElement, order, track_id); |
1938 | 1939 | }, |
1939 | 1940 | tryAddMedia:function(mediaElement, order, track_id){ |
— | — | @@ -1944,21 +1945,24 @@ |
1945 | 1946 | "id":'p_' + _this.id + '_c_' + order, |
1946 | 1947 | "pp":this, //set the parent playlist object pointer |
1947 | 1948 | "order": order |
1948 | | - }; |
| 1949 | + }; |
1949 | 1950 | var clipObj = new mvSMILClip(mediaElement, cConfig ); |
1950 | 1951 | |
1951 | 1952 | //set optional params track |
1952 | 1953 | if( typeof track_id != 'undefined') |
1953 | 1954 | clipObj["track_id"] = track_id; |
1954 | 1955 | |
1955 | | - //debugger; |
| 1956 | + |
1956 | 1957 | if ( clipObj ){ |
1957 | 1958 | //set up embed: |
1958 | | - clipObj.setUpEmbedObj(); |
| 1959 | + clipObj.setUpEmbedObj(); |
| 1960 | + //inhreit embedObject (only called on "new media" |
| 1961 | + clipObj.embed.init_with_sources_loaded(); |
1959 | 1962 | //add clip to track: |
1960 | 1963 | this.addCliptoTrack( clipObj , order); |
| 1964 | + |
1961 | 1965 | return true; |
1962 | | - } |
| 1966 | + } |
1963 | 1967 | //@@todo we could throw error details here once we integrate try catches everywhere :P |
1964 | 1968 | return false; |
1965 | 1969 | } |
— | — | @@ -1992,8 +1996,7 @@ |
1993 | 1997 | _this = this; |
1994 | 1998 | this.params = {}; |
1995 | 1999 | //make new mvCLip with ClipInit vals |
1996 | | - var myMvClip = new mvClip( mvClipInit ); |
1997 | | - |
| 2000 | + var myMvClip = new mvClip( mvClipInit ); |
1998 | 2001 | //inherit mvClip |
1999 | 2002 | for(var method in myMvClip){ |
2000 | 2003 | if(typeof this[method] != 'undefined' ){ |
— | — | @@ -2095,7 +2098,8 @@ |
2096 | 2099 | * http://www.w3.org/TR/SMIL3/smil-timing.html#Timing-ClockValueSyntax |
2097 | 2100 | * (probably have to use a Time object to fully support the smil spec |
2098 | 2101 | */ |
2099 | | -function smilParseTime(time_str){ |
| 2102 | +function smilParseTime( time_str ){ |
| 2103 | + time_str = time_str + ''; |
2100 | 2104 | //first check for hh:mm:ss time: |
2101 | 2105 | if(time_str.split(':').length == 3){ |
2102 | 2106 | return npt2seconds(time_str); |
Index: trunk/phase3/js2/mwEmbed/libSequencer/mvSequencer.js |
— | — | @@ -620,9 +620,14 @@ |
621 | 621 | if( e.which == 16 ) |
622 | 622 | _this.key_shift_down = false; |
623 | 623 | |
624 | | - if( e.which == 17) |
| 624 | + if( e.which == 17 ) |
625 | 625 | _this.key_ctrl_down = false; |
626 | 626 | |
| 627 | + //escape key (for now deselect) |
| 628 | + if( e.which == 27 ) |
| 629 | + _this.deselectClip(); |
| 630 | + |
| 631 | + |
627 | 632 | //backspace or delete key while not focused on a text area: |
628 | 633 | if( (e.which == 8 || e.which == 46) && !_this.inputFocus) |
629 | 634 | _this.removeSelectedClips(); |
— | — | @@ -1331,10 +1336,14 @@ |
1332 | 1337 | return insert_key; |
1333 | 1338 | }, |
1334 | 1339 | deselectClip:function( clipElm ){ |
1335 | | - $j(clipElm).removeClass("mv_selected_clip"); |
1336 | | - //make sure the transition sibling is removed: |
1337 | | - $j(clipElm).siblings('.clip_trans_box').removeClass( 'mv_selected_transition' ); |
1338 | | - $j('#' + $j(clipElm).parent().attr("id") + '_adj').fadeOut("fast"); |
| 1340 | + if(!clipElm){ |
| 1341 | + $j('.mv_selected_clip').removeClass("mv_selected_clip"); |
| 1342 | + }else{ |
| 1343 | + $j(clipElm).removeClass("mv_selected_clip"); |
| 1344 | + //make sure the transition sibling is removed: |
| 1345 | + $j(clipElm).siblings('.clip_trans_box').removeClass( 'mv_selected_transition' ); |
| 1346 | + $j('#' + $j(clipElm).parent().attr("id") + '_adj').fadeOut("fast"); |
| 1347 | + } |
1339 | 1348 | }, |
1340 | 1349 | getClipFromSeqID:function( clip_seq_id ){ |
1341 | 1350 | js_log('get id from: ' + clip_seq_id); |
— | — | @@ -1512,20 +1521,23 @@ |
1513 | 1522 | mvSeqPlayList.prototype = { |
1514 | 1523 | init:function(element){ |
1515 | 1524 | var myPlObj = new mvPlayList(element); |
| 1525 | + |
1516 | 1526 | //inherit mvClip |
1517 | 1527 | for(var method in myPlObj){ |
1518 | 1528 | if(typeof this[method] != 'undefined' ){ |
1519 | | - this['parent_'+method]=myPlObj[method]; |
| 1529 | + this[ 'parent_' + method ]=myPlObj[method]; |
1520 | 1530 | }else{ |
1521 | 1531 | this[method] = myPlObj[method]; |
1522 | 1532 | } |
1523 | 1533 | } |
| 1534 | + |
1524 | 1535 | this.org_control_height = this.pl_layout.control_height; |
1525 | 1536 | //do specific mods:(controls and title are managed by the sequencer) |
1526 | 1537 | this.pl_layout.title_bar_height=0; |
1527 | 1538 | this.pl_layout.control_height=0; |
1528 | 1539 | }, |
1529 | 1540 | setSliderValue:function( perc ){ |
| 1541 | + js_log('setSliderValue::'+ perc); |
1530 | 1542 | //get the track_clipThumb_height from parent mvSequencer |
1531 | 1543 | var frame_width = Math.round( this.pSeq.track_clipThumb_height * 1.3333333 ); |
1532 | 1544 | var container_width = frame_width+60; |
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js |
— | — | @@ -225,15 +225,17 @@ |
226 | 226 | } |
227 | 227 | ///js_log('did vI style'); |
228 | 228 | //now swap out the video element for the embed_video obj: |
229 | | - $j(video_element).after(embed_video).remove(); |
230 | | - //js_log('did swap'); |
231 | | - $j('#'+embed_video.id).get(0).on_dom_swap(); |
| 229 | + $j(video_element).after(embed_video).remove(); |
| 230 | + //js_log('did swap'); |
| 231 | + $j('#'+embed_video.id).get(0).on_dom_swap(); |
| 232 | + |
232 | 233 | // now that "embed_video" is stable, do more initialization (if we are ready) |
233 | 234 | if($j('#'+embed_video.id).get(0).loading_external_data==false && |
234 | 235 | $j('#'+embed_video.id).get(0).init_with_sources_loadedDone==false){ |
235 | 236 | //load and set ready state since source are available: |
236 | 237 | $j('#'+embed_video.id).get(0).init_with_sources_loaded(); |
237 | | - } |
| 238 | + } |
| 239 | + |
238 | 240 | js_log('done with child: ' + embed_video.id + ' len:' + global_player_list.length); |
239 | 241 | return true; |
240 | 242 | }, |
— | — | @@ -1185,7 +1187,7 @@ |
1186 | 1188 | js_log('set loading_external_data=false'); |
1187 | 1189 | _this.loading_external_data=false; |
1188 | 1190 | |
1189 | | - _this.init_with_sources_loaded(); |
| 1191 | + _this.init_with_sources_loaded(); |
1190 | 1192 | }); |
1191 | 1193 | } |
1192 | 1194 | }, |
— | — | @@ -1222,7 +1224,7 @@ |
1223 | 1225 | var missing_type =''; |
1224 | 1226 | var or =''; |
1225 | 1227 | for( var i=0; i < this.media_element.sources.length; i++){ |
1226 | | - missing_type+=or + this.media_element.sources[i].mime_type; |
| 1228 | + missing_type+= or + this.media_element.sources[i].mime_type; |
1227 | 1229 | or=' or '; |
1228 | 1230 | } |
1229 | 1231 | if( this.pc ) |
— | — | @@ -1231,7 +1233,7 @@ |
1232 | 1234 | this.load_error= this.getPluginMissingHTML(missing_type); |
1233 | 1235 | } |
1234 | 1236 | }, |
1235 | | - inheritEmbedObj:function(){ |
| 1237 | + inheritEmbedObj:function(){ |
1236 | 1238 | js_log("inheritEmbedObj:duration is: " + this.duration); |
1237 | 1239 | //@@note: tricky cuz direct overwrite is not so ideal.. since the extended object is already tied to the dom |
1238 | 1240 | //clear out any non-base embedObj stuff: |
— | — | @@ -1651,24 +1653,24 @@ |
1652 | 1654 | }, |
1653 | 1655 | getHTML : function (){ |
1654 | 1656 | //@@todo check if we have sources avaliable |
1655 | | - js_log('embedVideo:getHTML : ' + this.id ); |
| 1657 | + js_log('embedVideo:getHTML : ' + this.id + ' resource type: ' + this.type); |
1656 | 1658 | var _this = this; |
1657 | 1659 | var html_code = ''; |
1658 | 1660 | html_code = '<div id="videoPlayer_'+this.id+'" style="width:'+this.width+'px;" class="videoPlayer">'; |
1659 | | - html_code += '<div style="width:'+parseInt(this.width)+'px;height:'+parseInt(this.height)+'px;" id="mv_embedded_player_'+this.id+'">' + |
1660 | | - this.getThumbnailHTML() + |
1661 | | - '</div>'; |
1662 | | - //js_log("mvEmbed:controls "+ typeof this.controls); |
1663 | | - if(this.controls) |
1664 | | - { |
1665 | | - js_log("f:getHTML:AddControls"); |
1666 | | - html_code +='<div id="mv_embedded_controls_' + this.id + '" class="ui-widget ui-corner-bottom ui-state-default controls" >'; |
1667 | | - html_code += this.getControlsHTML(); |
1668 | | - html_code +='</div>'; |
1669 | | - //block out some space by encapulating the top level div |
1670 | | - $j(this).wrap('<div style="width:'+parseInt(this.width)+'px;height:' |
1671 | | - +(parseInt(this.height)+ctrlBuilder.height)+'px"></div>'); |
1672 | | - } |
| 1661 | + html_code += '<div style="width:'+parseInt(this.width)+'px;height:'+parseInt(this.height)+'px;" id="mv_embedded_player_'+this.id+'">' + |
| 1662 | + this.getThumbnailHTML() + |
| 1663 | + '</div>'; |
| 1664 | + //js_log("mvEmbed:controls "+ typeof this.controls); |
| 1665 | + if(this.controls) |
| 1666 | + { |
| 1667 | + js_log("f:getHTML:AddControls"); |
| 1668 | + html_code +='<div id="mv_embedded_controls_' + this.id + '" class="ui-widget ui-corner-bottom ui-state-default controls" >'; |
| 1669 | + html_code += this.getControlsHTML(); |
| 1670 | + html_code +='</div>'; |
| 1671 | + //block out some space by encapulating the top level div |
| 1672 | + $j(this).wrap('<div style="width:'+parseInt(this.width)+'px;height:' |
| 1673 | + +(parseInt(this.height)+ctrlBuilder.height)+'px"></div>'); |
| 1674 | + } |
1673 | 1675 | html_code += '</div>'; //videoPlayer div close |
1674 | 1676 | //js_log('should set: '+this.id); |
1675 | 1677 | $j(this).html( html_code ); |
— | — | @@ -2129,7 +2131,7 @@ |
2130 | 2132 | + source.getTitle()+'</a> '+ '</li>'+"\n"; |
2131 | 2133 | if( source.getURI().indexOf('?t=')!==-1){ |
2132 | 2134 | out+=dl_line; |
2133 | | - }else if(this.getMIMEType()=="text/cmml" || this.getMIMEType()=="text/x-srt"){ |
| 2135 | + }else if( this.getMIMEType()=="text/cmml" || this.getMIMEType()=="text/x-srt" ){ |
2134 | 2136 | dl_txt_list+=dl_line; |
2135 | 2137 | }else{ |
2136 | 2138 | dl_list+=dl_line; |
— | — | @@ -2186,7 +2188,7 @@ |
2187 | 2189 | }, |
2188 | 2190 | /* |
2189 | 2191 | * base embed pause |
2190 | | - * there is no general way to pause the video |
| 2192 | + * there is no general way to pause the video |
2191 | 2193 | * must be overwritten by embed object to support this functionality. |
2192 | 2194 | */ |
2193 | 2195 | pause: function(){ |
Index: trunk/phase3/js2/editPage.js |
— | — | @@ -24,12 +24,16 @@ |
25 | 25 | init:function(){ |
26 | 26 | var _this = this; |
27 | 27 | //@@todo check for new version of toolbar and via toolbar api: |
28 | | - if(typeof $j.fn.toolbar == 'undefined'){ |
29 | | - //add the add-media-wizard button for old toolbar: |
30 | | - $j('#toolbar').append('<img style="cursor:pointer" id="btn-add-media-wiz" src="' + mv_skin_img_path + 'Button_add_media.png">'); |
31 | | - $j('#btn-add-media-wiz').addMediaWiz( |
32 | | - mwAddMediaConfig |
33 | | - ); |
34 | | - } |
| 28 | + |
| 29 | + //add the add-media-wizard button for old toolbar: |
| 30 | + $j('#toolbar').append('<img style="cursor:pointer" id="btn-add-media-wiz" src="' + mv_skin_img_path + 'Button_add_media.png">'); |
| 31 | + $j('#btn-add-media-wiz').addMediaWiz( |
| 32 | + mwAddMediaConfig |
| 33 | + ); |
| 34 | + |
| 35 | + //add to new toolbar (need to use api) |
| 36 | + //$j('[rel=insert] .tool-file').addMediaWiz( |
| 37 | + // mwAddMediaConfig |
| 38 | + //); |
35 | 39 | } |
36 | 40 | } |