Fix Twitch not working on HTTPS and allow HTTPS channel page

This commit is contained in:
calzoneman 2014-11-24 19:24:47 -06:00
parent 9db35ba811
commit 2f2ed8aaf9
3 changed files with 2 additions and 19 deletions

View File

@ -68,10 +68,6 @@ function redirectHttp(req, res) {
* Handles a GET request for /r/:channel - serves channel.html
*/
function handleChannel(req, res) {
if (redirectHttp(req, res)) {
return;
}
if (!$util.isValidChannelName(req.params.channel)) {
res.status(404);
res.send("Invalid channel name '" + req.params.channel + "'");

View File

@ -583,12 +583,12 @@ var TwitchTVPlayer = function (data) {
self.videoId = data.id;
self.videoLength = data.seconds;
self.init = function () {
var url = "http://www.twitch.tv/widgets/live_embed_player.swf?channel="+self.videoId;
var url = "https://www-cdn.jtvnw.net/swflibs/TwitchPlayer.swf?channel="+self.videoId;
var params = {
allowFullScreen: "true",
allowScriptAccess: "always",
allowNetworking: "all",
movie: "http://www.twitch.tv/widgets/live_embed_player.swf",
movie: "https://www-cdn.jtvnw.net/swflibs/TwitchPlayer.swf",
id: "live_embed_player_flash",
flashvars: "hostname=www.twitch.tv&channel="+self.videoId+"&auto_play=true&start_volume=" + VOLUME
};

View File

@ -520,19 +520,6 @@ if(m) {
}
}
if (location.protocol === "https:") {
var title = "Warning";
var text = "You connected to this page via HTTPS. Due to browser "+
"security policy, certain media players may throw warnings,"+
" while others may not work at all due to only being "+
"available over plain HTTP.<br>To encrypt your websocket "+
"traffic and API calls (logins, account management, etc) "+
"while loading this page over plain HTTP, enable the SSL "+
"option from the Options menu.";
makeAlert(title, text, "alert-warning")
.appendTo($("#announcements"));
}
/* channel ranks stuff */
function chanrankSubmit(rank) {
var name = $("#cs-chanranks-name").val();