Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_flashEmbed.js |
— | — | @@ -402,6 +402,14 @@ |
403 | 403 | getFLA : function (){ |
404 | 404 | this.fla = this.getPluginEmbed(); |
405 | 405 | }, |
| 406 | + stop : function(){ |
| 407 | + if (this.monitorTimerId != 0 ) |
| 408 | + { |
| 409 | + clearInterval(this.monitorTimerId); |
| 410 | + this.monitorTimerId = 0; |
| 411 | + } |
| 412 | + this.parent_stop(); |
| 413 | + }, |
406 | 414 | onStop: function(){ |
407 | 415 | //stop updates: |
408 | 416 | if( this.monitorTimerId != 0 ) |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -184,27 +184,7 @@ |
185 | 185 | mvEmbed.init(); |
186 | 186 | }); |
187 | 187 | }); |
188 | | - }, |
189 | | - userSetPlayerType:function(player){ |
190 | | - //callback to the embedType obj to set the cookie/pref: |
191 | | - embedTypes.userSetPlayerType(player); |
192 | | - //fade out all pref windows and remove: |
193 | | - $j('.set_ogg_player_pref').fadeOut('slow',function(){ |
194 | | - $j(this).remove(); |
195 | | - }); |
196 | | - //@@todo temporarily disable playback or set all to loading... |
197 | | - //request the new player library: |
198 | | -/* var plugins={}; |
199 | | - plugins[embedTypes.getPlayerLib()+'Embed']='mv_'+embedTypes.getPlayerLib()+'Embed.js'; |
200 | | - mvJsLoader.doLoad(plugins, function(){ |
201 | | - js_log("done loading: " + embedTypes.getPlayerLib()); |
202 | | - //re-rewrite all the video objects on the page: |
203 | | - for(i in global_ogg_list){ |
204 | | - js_log('selector: '+'#'+global_ogg_list[i]); |
205 | | - $j('#'+global_ogg_list[i]).get(0).inheritEmbedObj(); |
206 | | - } |
207 | | - })*/ |
208 | | - }, |
| 188 | + }, |
209 | 189 | addLoadEvent:function(fn){ |
210 | 190 | this.flist.push(fn); |
211 | 191 | }, |
— | — | @@ -376,8 +356,7 @@ |
377 | 357 | }, |
378 | 358 | getMIMETypePlayers : function(mime_type) |
379 | 359 | { |
380 | | - var mime_players = new Array(); |
381 | | - // @@TODO: optimize this loop |
| 360 | + var mime_players = new Array(); |
382 | 361 | if(this.default_players[mime_type]) |
383 | 362 | for (var d in this.default_players[mime_type]) |
384 | 363 | { |
— | — | @@ -404,6 +383,10 @@ |
405 | 384 | js_log('No default player found for ' + mime_type); |
406 | 385 | return null; |
407 | 386 | }, |
| 387 | + userSelectFormat : function (mime_format){ |
| 388 | + this.preference['format_prefrence'] = mime_format; |
| 389 | + this.savePreferences(); |
| 390 | + }, |
408 | 391 | userSelectPlayer : function(player_id, mime_type) |
409 | 392 | { |
410 | 393 | var selected_player=null; |
— | — | @@ -1418,7 +1401,7 @@ |
1419 | 1402 | * @param {String} start_time in NTP format |
1420 | 1403 | * @param {String} end_time in NTP format |
1421 | 1404 | */ |
1422 | | - updateSrcTime:function(start_ntp, end_ntp){ |
| 1405 | + updateSrcTime:function (start_ntp, end_ntp){ |
1423 | 1406 | js_log("f:updateSrcTime: "+ start_ntp+'/'+ end_ntp); |
1424 | 1407 | //js_log("pre uri:" + this.uri); |
1425 | 1408 | //if we have time we can use: |
— | — | @@ -1590,6 +1573,8 @@ |
1591 | 1574 | for(var i in playable_sources){ |
1592 | 1575 | if(i==index){ |
1593 | 1576 | this.selected_source = playable_sources[i]; |
| 1577 | + //update the user prefrence: |
| 1578 | + embedTypes.players.userSelectFormat(playable_sources[i].mime_type); |
1594 | 1579 | break; |
1595 | 1580 | } |
1596 | 1581 | } |
— | — | @@ -1599,16 +1584,45 @@ |
1600 | 1585 | /** selects the default source via cookie preference, default marked, or by id order |
1601 | 1586 | * */ |
1602 | 1587 | autoSelectSource:function(){ |
| 1588 | + js_log('f:autoSelectSource'); |
1603 | 1589 | //@@todo read user preference for source |
1604 | 1590 | // Select the default source |
1605 | | - var playable_sources = this.getPlayableSources(); |
| 1591 | + var playable_sources = this.getPlayableSources(); |
| 1592 | + var flash_flag=ogg_flag=false; |
1606 | 1593 | for (var source in playable_sources){ |
| 1594 | + var mime_type =playable_sources[source].mime_type; |
1607 | 1595 | if(playable_sources[source].marked_default){ |
1608 | 1596 | this.selected_source = playable_sources[source]; |
1609 | 1597 | return true; |
1610 | 1598 | } |
1611 | | - } |
1612 | | - // select streams that start with 'mv_' first source |
| 1599 | + //set via prefrence |
| 1600 | + if(embedTypes.players.preference['format_prefrence']==mime_type){ |
| 1601 | + js_log('set via prefrence: '+playable_sources[source].mime_type); |
| 1602 | + this.selected_source = playable_sources[source]; |
| 1603 | + } |
| 1604 | + } |
| 1605 | + //set Ogg via player support: |
| 1606 | + for(var source in playable_sources){ |
| 1607 | + var mime_type =playable_sources[source].mime_type; |
| 1608 | + //set source via player |
| 1609 | + if(mime_type=='video/ogg' || mime_type=='ogg/video' || mime_type=='video/annodex'){ |
| 1610 | + for(i in embedTypes.players){ |
| 1611 | + var player = embedTypes.players[i]; |
| 1612 | + if(player.library=='vlc' || player.library=='native'){ |
| 1613 | + js_log('setting ogg via order') |
| 1614 | + this.selected_source = playable_sources[source]; |
| 1615 | + } |
| 1616 | + } |
| 1617 | + } |
| 1618 | + } |
| 1619 | + //set Flash via player support |
| 1620 | + for(var source in playable_sources){ |
| 1621 | + var mime_type =playable_sources[source].mime_type; |
| 1622 | + if(mime_type=='video/x-flv'){ |
| 1623 | + this.selected_source = playable_sources[source]; |
| 1624 | + } |
| 1625 | + } |
| 1626 | + //select first source |
1613 | 1627 | if (!this.selected_source) |
1614 | 1628 | { |
1615 | 1629 | js_log('autoselecting first source:' + playable_sources[0]); |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_playlist.js |
— | — | @@ -490,9 +490,14 @@ |
491 | 491 | //stop current clip |
492 | 492 | this.cur_clip.embed.stop(); |
493 | 493 | //do swap: |
494 | | - $j('#clipDesc_'+this.cur_clip.id).hide(); |
| 494 | + //if transition done (animation_state==2) hide: |
| 495 | + if(this.cur_clip.transOut.animation_state==2) |
| 496 | + $j('#clipDesc_'+this.cur_clip.id).hide(); |
495 | 497 | this.cur_clip=next_clip; |
496 | | - $j('#clipDesc_'+this.cur_clip.id).show(); |
| 498 | + //if not already vissable show |
| 499 | + if(!$j('#clipDesc_'+this.cur_clip.id).is(':visible')) |
| 500 | + $j('#clipDesc_'+this.cur_clip.id).show(); |
| 501 | + |
497 | 502 | this.cur_clip.embed.play(); |
498 | 503 | }else{ |
499 | 504 | js_log('do next'); |