Index: branches/MetavidWiki-exp/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -335,6 +335,7 @@ |
336 | 336 | // otherwise just return the first compatible player |
337 | 337 | return mime_players[0]; |
338 | 338 | } |
| 339 | + js_log('No default player found for ' + mime_type); |
339 | 340 | return null; |
340 | 341 | }, |
341 | 342 | userSelectPlayer : function(player_id, mime_type) |
— | — | @@ -865,16 +866,8 @@ |
866 | 867 | this.pe=parentEmbed; |
867 | 868 | //parse roe if not already done: |
868 | 869 | |
869 | | - //if not "live" or under 5 min load all transcript in one request |
870 | | - if(!this.pe.roe_xml){ |
871 | | - js_log("MISSING ROE DATA for text interface"); |
872 | | - var _this = this; |
873 | | - this.pe.getParseROE( function(){ |
874 | | - _this.textInterface.getParseCMML(); |
875 | | - }); |
876 | | - }else{ |
877 | | - this.getParseCMML(); |
878 | | - } |
| 870 | + this.getParseCMML(); |
| 871 | + |
879 | 872 | //start the autoscroll timer: |
880 | 873 | this.setAutoScroll(true); |
881 | 874 | }, |
— | — | @@ -887,20 +880,20 @@ |
888 | 881 | |
889 | 882 | //@@todo use user-language as key to select transcript layer. |
890 | 883 | _this = this; |
891 | | - $j.each(this.pe.roe_xml.getElementsByTagName('mediaSource'), function(inx, n){ |
892 | | - if(n.getAttribute('content-type')=='text/cmml'){ |
893 | | - _this.availableTracks[n.getAttribute('id')] = { |
894 | | - src:n.getAttribute('src'), |
895 | | - title:n.getAttribute('title'), |
| 884 | + $j.each(this.pe.media_element.sources, function(inx, n){ |
| 885 | + if(n.mime_type=='text/cmml'){ |
| 886 | + _this.availableTracks[n.id] = { |
| 887 | + src:n.uri, |
| 888 | + title:n.title, |
896 | 889 | loaded:false, |
897 | 890 | display:false |
898 | 891 | } |
899 | 892 | //load or skip the track based on "default" attribute |
900 | | - if(n.getAttribute('default')!='true'){ |
| 893 | + if(n.marked_default){ |
901 | 894 | return; |
902 | 895 | }else{ |
903 | 896 | //load the track if its default track |
904 | | - _this.load_track(n.getAttribute('id')); |
| 897 | + _this.load_track(n.id); |
905 | 898 | } |
906 | 899 | } |
907 | 900 | }); |
— | — | @@ -1148,6 +1141,8 @@ |
1149 | 1142 | start_offset:null, |
1150 | 1143 | /** Duration of the requested segment (NaN if not known) */ |
1151 | 1144 | duration:NaN, |
| 1145 | + |
| 1146 | + id:null, |
1152 | 1147 | |
1153 | 1148 | start_ntp:null, |
1154 | 1149 | end_ntp:null, |
— | — | @@ -1168,6 +1163,8 @@ |
1169 | 1164 | this.title = element.getAttribute("title"); |
1170 | 1165 | else |
1171 | 1166 | this.title = this.uri; |
| 1167 | + if (element.hasAttribute("id")) |
| 1168 | + this.id = element.getAttribute("id"); |
1172 | 1169 | |
1173 | 1170 | if (element.hasAttribute('type')) |
1174 | 1171 | this.mime_type = element.getAttribute('type'); |
— | — | @@ -1619,7 +1616,7 @@ |
1620 | 1617 | //add direct download link if option: |
1621 | 1618 | if(this.download_link){ |
1622 | 1619 | //check for roe attribute (extened download options) |
1623 | | - var dlLink = (this.roe)?'javascript:document.getElementById(\''+this.id+'\').showVideoDownload();':this.src; |
| 1620 | + var dlLink = (this.media_element.sources.length>1)?'javascript:document.getElementById(\''+this.id+'\').showVideoDownload();':this.media_element.sources[0].uri; |
1624 | 1621 | thumb_html+='<div style="border:none;position:absolute;bottom:2px;left:2px;z-index:1">'+ |
1625 | 1622 | '<a title="'+getMsg('download_clip')+'" href="'+dlLink+'">'; |
1626 | 1623 | thumb_html+=getTransparentPng({id:'lb_'+this.id, width:"27", height:"27", border:"0", |
— | — | @@ -1763,7 +1760,7 @@ |
1764 | 1761 | var select_html='<div id="player_select_list_' + index + '" class="player_select_list"><ul>'; |
1765 | 1762 | for(i in supporting_players){ |
1766 | 1763 | //put colored plugin icon and no link for supported player: |
1767 | | - if(this.selected_player.library==supporting_players[i].library ){ |
| 1764 | + if(embedTypes.players.defaultPlayer(mime_type).id==supporting_players[i].id ){ |
1768 | 1765 | select_html+='<li>'+ |
1769 | 1766 | '<img border="0" width="16" height="16" src="'+mv_embed_path+'images/plugin.png">'+ |
1770 | 1767 | supporting_players[i].getName() + |
— | — | @@ -1789,9 +1786,12 @@ |
1790 | 1787 | var default_player = embedTypes.players.defaultPlayer(source.getMIMEType()); |
1791 | 1788 | var source_select_code = 'document.getElementById(\''+_this.id+'\').closeDisplayedHTML(); document.getElementById(\''+_this.id+'\').media_element.selectSource(\''+index+'\');'; |
1792 | 1789 | var player_code = _this.getPlayerSelectList(source.getMIMEType(), index, source_select_code); |
1793 | | - return '<a href="#" onClick="' + source_select_code + 'embedTypes.players.userSelectPlayer(\''+default_player.id+'\',\''+source.getMIMEType()+'\'); return false;">' |
| 1790 | + if (default_player) |
| 1791 | + return '<a href="#" onClick="' + source_select_code + 'embedTypes.players.userSelectPlayer(\''+default_player.id+'\',\''+source.getMIMEType()+'\'); return false;">' |
1794 | 1792 | + source.getTitle()+' - ' + default_player.getName() + '</a> ' |
1795 | 1793 | + '(<a href="#" onClick=\'$j("#player_select_list_'+index+'").fadeIn("slow");return false;\'>choose player</a>)' + player_code; |
| 1794 | + else |
| 1795 | + return source.getTitle() + ' - no player available'; |
1796 | 1796 | }); |
1797 | 1797 | this.displayHTML(select_code); |
1798 | 1798 | }, |