Skip to content

Instantly share code, notes, and snippets.

@shuding
Last active August 29, 2015 14:06
Show Gist options
  • Save shuding/21ca7f604e314841011b to your computer and use it in GitHub Desktop.
Save shuding/21ca7f604e314841011b to your computer and use it in GitHub Desktop.
ChannelV fix script
<script>
// append this script to the end of <body> tag
(function() {
var playlist = $("#playlist ul li a");
for(var i = 0; i < playlist.length; ++i) {
var id = playlist[i].id.split("_")[1];
var u = "http://stu.fudan.edu.cn/wcfservice/channelvservice2.svc/GetVideoById?key=5d8538932ab14b95ba89a655d0e19ce3&id=" + id;
var load = function(i, u) {
var pl = playlist[i];
pl.style.color = "#EEE";
$.ajax(u).done(function(data){
pl.style.color = "#000";
pl.onclick = function() {
$("#player_content video").attr("src", data.Uri);
};
});
};
load(i, u);
}
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment