Last active
August 29, 2015 14:06
-
-
Save shuding/21ca7f604e314841011b to your computer and use it in GitHub Desktop.
ChannelV fix script
This file contains 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
<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