Index: branches/MetavidWiki-exp/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -241,13 +241,13 @@ |
242 | 242 | |
243 | 243 | var vlcMozillaPlayer = new mediaPlayer( |
244 | 244 | 'vlc-mozilla', |
245 | | - ['video/ogg'], |
| 245 | + ['video/ogg', 'video/x-flv'], |
246 | 246 | 'vlc' |
247 | 247 | ); |
248 | 248 | |
249 | 249 | var vlcActiveXPlayer = new mediaPlayer( |
250 | 250 | 'vlc-activex', |
251 | | - ['video/ogg'], |
| 251 | + ['video/ogg', 'video/x-flv'], |
252 | 252 | 'vlc' |
253 | 253 | ); |
254 | 254 | |
— | — | @@ -309,16 +309,26 @@ |
310 | 310 | |
311 | 311 | return mime_players; |
312 | 312 | }, |
313 | | - autoSelectPlayer : function(mime_type) |
| 313 | + defaultPlayer : function(mime_type) |
314 | 314 | { |
315 | | - js_log('autoselecting player for ' + mime_type); |
316 | 315 | var mime_players = this.getMIMETypePlayers(mime_type); |
| 316 | + var to_return = null; |
317 | 317 | if(mime_players.length) |
318 | 318 | { |
319 | | - this.selected_player = mime_players[0]; |
| 319 | + to_return = mime_players[0]; |
320 | 320 | for(var i in mime_players) |
321 | 321 | if(mime_players[i].id==this.preference[mime_type]) |
322 | | - this.selected_player = mime_players[i]; |
| 322 | + to_return = mime_players[i]; |
| 323 | + } |
| 324 | + return to_return; |
| 325 | + }, |
| 326 | + autoSelectPlayer : function(mime_type) |
| 327 | + { |
| 328 | + js_log('autoselecting player for ' + mime_type); |
| 329 | + var player = this.defaultPlayer(mime_type); |
| 330 | + if(player) |
| 331 | + { |
| 332 | + this.selected_player = player; |
323 | 333 | js_log('selected ' + this.selected_player.getName()); |
324 | 334 | } |
325 | 335 | else |
— | — | @@ -426,10 +436,10 @@ |
427 | 437 | for (var i in this.players.players) |
428 | 438 | mvEmbed.lib_plugins[this.players.players[i].getLibraryObject()]=this.players.players[i].getLibraryFile(); |
429 | 439 | }, |
430 | | - getPlayerSelectList:function(mime_type, file_select_code){ |
| 440 | + getPlayerSelectList:function(mime_type, index, file_select_code){ |
431 | 441 | var supporting_players = this.players.getMIMETypePlayers(mime_type); |
432 | 442 | |
433 | | - var select_html='<ul style="color:white">'; |
| 443 | + var select_html='<div id="player_select_list_' + index + '" class="player_select_list"><ul>'; |
434 | 444 | for(i in supporting_players){ |
435 | 445 | /* //list if its the current put a colored plugin icon than name |
436 | 446 | if(this.playerType==this.players[i]){ |
— | — | @@ -440,14 +450,14 @@ |
441 | 451 | }else{*/ |
442 | 452 | //else gray plugin and the plugin with link to select |
443 | 453 | select_html+='<li>'+ |
444 | | - '<a style="color:white" href="#" onClick="'+ file_select_code + 'embedTypes.players.selectPlayer(\''+supporting_players[i].id+'\',\''+mime_type+'\');return false;">'+ |
| 454 | + '<a href="#" onClick="'+ file_select_code + 'embedTypes.players.selectPlayer(\''+supporting_players[i].id+'\',\''+mime_type+'\');return false;">'+ |
445 | 455 | '<img border="0" width="16" height="16" src="'+mv_embed_path+'images/plugin_disabled.png">'+ |
446 | 456 | supporting_players[i].getName() + |
447 | 457 | '</a>'+ |
448 | 458 | '</li>'; |
449 | 459 | // } |
450 | 460 | } |
451 | | - select_html+='</ul>'; |
| 461 | + select_html+='</ul></div>'; |
452 | 462 | js_log(select_html); |
453 | 463 | return select_html; |
454 | 464 | }, |
— | — | @@ -1704,13 +1714,17 @@ |
1705 | 1715 | if(height<240)height=240; |
1706 | 1716 | |
1707 | 1717 | var sel_id = (this.pc!=null)?this.pc.pp.id:this.id; |
| 1718 | + var close_link ='<a href="#" style="color:white" onClick="document.getElementById(\''+this.id+'\').closeDisplayedHTML();return false;">close</a>'; |
| 1719 | + |
1708 | 1720 | //fade in a black bg div ontop of everything |
1709 | 1721 | var div_code = '<div id="blackbg_'+sel_id+'" ' + |
1710 | 1722 | 'style="overflow:auto;position:absolute;display:none;z-index:2;background:black;top:0px;left:0px;' + |
1711 | 1723 | 'height:'+parseInt(height)+'px;width:'+parseInt(width)+'px;">'+ |
| 1724 | + '<span id="close_vl'+this.id+'" style="position:absolute:top:2px;left:2px;color:white;">'+close_link+'</span>'+ |
| 1725 | + '<span class="displayHTML" id="con_vl_'+this.id+'" style="position:absolute;top:20px;left:20px;color:white;">' + |
1712 | 1726 | html_code + |
| 1727 | + close_link+'</span>' |
1713 | 1728 | '</div>'; |
1714 | | - |
1715 | 1729 | $j('#'+sel_id).append(div_code); |
1716 | 1730 | $j('#blackbg_'+sel_id).fadeIn("slow"); |
1717 | 1731 | return false; //onclick action return false |
— | — | @@ -1726,33 +1740,24 @@ |
1727 | 1741 | return false;//onclick action return false |
1728 | 1742 | }, |
1729 | 1743 | selectPlaybackMethod:function(){ |
1730 | | - var close_link ='<a href="#" style="color:white" onClick="document.getElementById(\''+this.id+'\').closeDisplayedHTML();return false;">close</a>'; |
1731 | | - var select_code = |
1732 | | - '<span id="close_vl'+this.id+'" style="position:absolute:top:2px;left:2px;color:white;">'+close_link+'</span>'+ |
1733 | | - '<span id="con_vl_'+this.id+'" style="position:absolute;top:20px;left:20px;color:white;">'; |
1734 | | - var dl_list=''; |
1735 | 1744 | var _this=this; |
1736 | | - select_code+=this.getDLlist(function(index, source) |
| 1745 | + var select_code=this.getDLlist(function(index, source) |
1737 | 1746 | { |
1738 | | - var player_code = embedTypes.getPlayerSelectList(source.getMIMEType(), 'document.getElementById(\''+_this.id+'\').closeDisplayedHTML(); document.getElementById(\''+_this.id+'\').media_element.selectSource(\''+index+'\');'); |
1739 | | - return '<a href="#" style="color:white" onClick="document.getElementById(\''+_this.id+'\').closeDisplayedHTML(); document.getElementById(\''+_this.id+'\').media_element.selectSource(\''+index+'\'); return false;">' |
1740 | | - + source.getTitle()+'</a>' + player_code; |
| 1747 | + var default_player = embedTypes.players.defaultPlayer(source.getMIMEType()); |
| 1748 | + var source_select_code = 'document.getElementById(\''+_this.id+'\').closeDisplayedHTML(); document.getElementById(\''+_this.id+'\').media_element.selectSource(\''+index+'\');'; |
| 1749 | + var player_code = embedTypes.getPlayerSelectList(source.getMIMEType(), index, source_select_code); |
| 1750 | + return '<a href="#" onClick="' + source_select_code + 'embedTypes.players.selectPlayer(\''+default_player.id+'\',\''+source.getMIMEType()+'\'); return false;">' |
| 1751 | + + source.getTitle()+' - ' + default_player.getName() + '</a> ' |
| 1752 | + + '(<a href="#" onClick=\'$j("#player_select_list_'+index+'").fadeIn("slow");\'>choose player</a>)' + player_code; |
1741 | 1753 | }); |
1742 | | - select_code+=close_link+'</span>'; |
1743 | 1754 | this.displayHTML(select_code); |
1744 | 1755 | }, |
1745 | 1756 | showVideoDownload:function(){ |
1746 | | - var close_link ='<a href="#" style="color:white" onClick="document.getElementById(\''+this.id+'\').closeDisplayedHTML();return false;">close</a>'; |
1747 | | - var select_code = |
1748 | | - '<span id="close_vl'+this.id+'" style="position:absolute:top:2px;left:2px;color:white;">'+close_link+'</span>'+ |
1749 | | - '<span id="con_vl_'+this.id+'" style="position:absolute;top:20px;left:20px;color:white;">'; |
1750 | | - var dl_list=''; |
1751 | | - select_code+=this.getDLlist(function(index, source) |
| 1757 | + var select_code=this.getDLlist(function(index, source) |
1752 | 1758 | { |
1753 | 1759 | return '<a style="color:white" href="' + source.getURI() +'"> ' |
1754 | 1760 | + source.getTitle()+'</a>'; |
1755 | 1761 | }); |
1756 | | - select_code+=close_link+'</span>'; |
1757 | 1762 | this.displayHTML(select_code); |
1758 | 1763 | }, |
1759 | 1764 | getDLlist:function(transform_function){ |
Index: branches/MetavidWiki-exp/MetavidWiki/skins/mv_embed/mv_embed.css |
— | — | @@ -2,6 +2,17 @@ |
3 | 3 | margin-bottom:20px; |
4 | 4 | position:relative; |
5 | 5 | } |
| 6 | +.player_select_list { |
| 7 | + color:white; |
| 8 | + font-size:10pt; |
| 9 | + display:none; |
| 10 | +} |
| 11 | +.player_select_list a:visited { |
| 12 | + color:white; |
| 13 | +} |
| 14 | +.displayHTML a:visited { |
| 15 | + color:white; |
| 16 | +} |
6 | 17 | .mv_playhead { |
7 | 18 | position:absolute; |
8 | 19 | top:0; |