Created
May 7, 2014 18:49
-
-
Save viko16/55e8c69b81d96248f3ad to your computer and use it in GitHub Desktop.
替换新电影网播放器(临时
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//插入播放器的css | |
var c = document.createElement('link'); | |
c.setAttribute('href', 'http://172.16.144.62/video-js/video-js.css'); | |
document.head.appendChild(c); | |
//插入播放器的js(为什么不用jquery的插入呢?因为jquery有防xss的限制...) | |
var j = document.createElement('script'); | |
j.setAttribute('src', 'http://172.16.144.62/video-js/video.js'); | |
document.head.appendChild(j); | |
//提取真实地址 | |
var movieurl = $("object").find("param[name=FlashVars]").val().replace("&play_url=", "").split("&")[0]; | |
//url编码解码 | |
movieurl = unescape(movieurl); | |
//移除旧播放器,关闭一个不知道作用的轮询 | |
$('object').remove(); | |
clearInterval(nw_set_play_list_timer_id); | |
//插入播放器 | |
var v = $("<video id='hehevideo' class='video-js vjs-default-skin' controls preload='none' width='960' height='540' data-setup='{}'></video>"); | |
$('.live_player').append(v); | |
//然后就是插真实地址咯 | |
var r = ("<source src='" + movieurl + "' type='video/mp4' />"); | |
$('#hehevideo').append(r); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
有新版本了,做成了chrome插件
https://github.com/viko16/NavodHTML5