mirror of https://github.com/calzoneman/sync.git
Fix Twitch not working on HTTPS and allow HTTPS channel page
This commit is contained in:
parent
9db35ba811
commit
2f2ed8aaf9
|
@ -68,10 +68,6 @@ function redirectHttp(req, res) {
|
||||||
* Handles a GET request for /r/:channel - serves channel.html
|
* Handles a GET request for /r/:channel - serves channel.html
|
||||||
*/
|
*/
|
||||||
function handleChannel(req, res) {
|
function handleChannel(req, res) {
|
||||||
if (redirectHttp(req, res)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$util.isValidChannelName(req.params.channel)) {
|
if (!$util.isValidChannelName(req.params.channel)) {
|
||||||
res.status(404);
|
res.status(404);
|
||||||
res.send("Invalid channel name '" + req.params.channel + "'");
|
res.send("Invalid channel name '" + req.params.channel + "'");
|
||||||
|
|
|
@ -583,12 +583,12 @@ var TwitchTVPlayer = function (data) {
|
||||||
self.videoId = data.id;
|
self.videoId = data.id;
|
||||||
self.videoLength = data.seconds;
|
self.videoLength = data.seconds;
|
||||||
self.init = function () {
|
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 = {
|
var params = {
|
||||||
allowFullScreen: "true",
|
allowFullScreen: "true",
|
||||||
allowScriptAccess: "always",
|
allowScriptAccess: "always",
|
||||||
allowNetworking: "all",
|
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",
|
id: "live_embed_player_flash",
|
||||||
flashvars: "hostname=www.twitch.tv&channel="+self.videoId+"&auto_play=true&start_volume=" + VOLUME
|
flashvars: "hostname=www.twitch.tv&channel="+self.videoId+"&auto_play=true&start_volume=" + VOLUME
|
||||||
};
|
};
|
||||||
|
|
13
www/js/ui.js
13
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.<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 */
|
/* channel ranks stuff */
|
||||||
function chanrankSubmit(rank) {
|
function chanrankSubmit(rank) {
|
||||||
var name = $("#cs-chanranks-name").val();
|
var name = $("#cs-chanranks-name").val();
|
||||||
|
|
Loading…
Reference in New Issue