1 $("#list_nav_parent").after('<a id="TLE_html5_player" class="page_list" href="#" title="HTML5播放">'
2 +'<span>HTML5播放器</span>'
3 +'<span class="p_r"></span>'
5 $("#TLE_html5_player").click(function() {
6 document
.cookie
= "html5_player=1";
10 function html5player() {
12 url
= url
.replace(/&n=\w+/, "&n=08586C0FD0F6390000").replace(/&p=\d+/, "")+"&p=1&xplaybackid=0";
13 $("#xl_vod_fx_flash_box").attr("src", url
);
14 $("#original_url").html('mplayer播放:'+'<input value="'+play_with_mplayer(url
)+'" />');
15 $("#original_url input").attr("style", "background:#777;border:0;width:400px;");
18 $.getJSON('http://i.vod.xunlei.com/req_get_method_vod?jsonp=?', {
19 url
: XL_CLOUD_FX_INSTANCE
.curUrl
,
20 video_name
: XL_CLOUD_FX_INSTANCE
.curName
,
23 userid
: XL_CLOUD_FX_INSTANCE
.user
.u
,
24 sessionid
: XL_CLOUD_FX_INSTANCE
.user
.s
,
27 var list
= data
.resp
.vodinfo_list
28 $("#XL_CLOUD_VOD_PLAYER").empty();
29 if (list
.length
== 0) {
30 $("#XL_CLOUD_VOD_PLAYER").append('<img src="http://vod.xunlei.com/img/play_bg.jpg" width="100%" height="100%"><div style="position:absolute;left:0;top:46%;text-align:center;font-size:14px;color:#FFF;margin: 0;width:100%;height:22px;">云点播尚未转码完成。</div>');
33 $("#mycopyer").hide();
34 $("#XL_CLOUD_VOD_PLAYER").append('<video id="xl_vod_fx_flash_box" width="100%" height="94%" style="z-index: 100;" controls="controls" autoplay="true"></video>'
35 +'<div id="xl_button_box" style="width: 100%; height: 6%; line-height: 22px; text-align: right; ">'
37 list
.forEach(function(n
, i
) {
57 $('<button style="margin-right:5px;">'+str
+'</button>').appendTo("#xl_button_box").click(function() {
58 $("#xl_button_box button").each(function(n
, e
) {
60 e
.text(e
.text().replace("• ", ""));
63 _this
.text("• "+_this
.text());
68 var tmp
= $("#xl_button_box button:last");
69 tmp
.text("• "+tmp
.text());
70 play(list
[list
.length
-1].vod_url
);
74 function play_with_mplayer(url
) {
75 var ismac
= (navigator
.platform
.indexOf("Mac") == 0);
76 var userid
= url
.match(/&ui=(\d+)/)[1];
78 return "open -a 'MPlayerX.app' --args -ExtraOptions --http-header-fields 'cookie: user="+userid
+"' -url '"+url
+"'";
80 return "mplayer -http-header-fields 'cookie: userid="+userid
+"' '"+url
+"'\n";