From 2f2ed8aaf9db511eaa6b34120186464e41695c6b Mon Sep 17 00:00:00 2001 From: calzoneman Date: Mon, 24 Nov 2014 19:24:47 -0600 Subject: [PATCH] Fix Twitch not working on HTTPS and allow HTTPS channel page --- lib/web/webserver.js | 4 ---- www/js/player.js | 4 ++-- www/js/ui.js | 13 ------------- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/lib/web/webserver.js b/lib/web/webserver.js index 34623db2..e9ad8744 100644 --- a/lib/web/webserver.js +++ b/lib/web/webserver.js @@ -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 + "'"); diff --git a/www/js/player.js b/www/js/player.js index 9992b3ca..ba4fddaf 100644 --- a/www/js/player.js +++ b/www/js/player.js @@ -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 }; diff --git a/www/js/ui.js b/www/js/ui.js index 19026ca8..7eea62c1 100644 --- a/www/js/ui.js +++ b/www/js/ui.js @@ -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.
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();