Remove some legacy cruft
This commit is contained in:
parent
7214b7c474
commit
394f03ee1c
|
@ -2,7 +2,7 @@
|
|||
"author": "Calvin Montgomery",
|
||||
"name": "CyTube",
|
||||
"description": "Online media synchronizer and chat",
|
||||
"version": "3.81.0",
|
||||
"version": "3.82.0",
|
||||
"repository": {
|
||||
"url": "http://github.com/calzoneman/sync"
|
||||
},
|
||||
|
|
|
@ -24,27 +24,10 @@ window.EmbedPlayer = class EmbedPlayer extends Player
|
|||
console.error('EmbedPlayer::load(): missing meta.embed')
|
||||
return
|
||||
|
||||
if embed.tag == 'object'
|
||||
@player = @loadObject(embed)
|
||||
else
|
||||
@player = @loadIframe(embed)
|
||||
|
||||
removeOld(@player)
|
||||
|
||||
loadObject: (embed) ->
|
||||
object = $('<object/>').attr(
|
||||
type: 'application/x-shockwave-flash'
|
||||
data: embed.src
|
||||
wmode: 'opaque'
|
||||
)
|
||||
genParam('allowfullscreen', 'true').appendTo(object)
|
||||
genParam('allowscriptaccess', 'always').appendTo(object)
|
||||
|
||||
for key, value of embed.params
|
||||
genParam(key, value).appendTo(object)
|
||||
|
||||
return object
|
||||
|
||||
loadIframe: (embed) ->
|
||||
if embed.src.indexOf('http:') == 0 and location.protocol == 'https:'
|
||||
if @__proto__.mixedContentError?
|
||||
|
|
|
@ -6,13 +6,6 @@ window.LivestreamPlayer = class LivestreamPlayer extends EmbedPlayer
|
|||
@load(data)
|
||||
|
||||
load: (data) ->
|
||||
if LIVESTREAM_CHROMELESS
|
||||
data.meta.embed =
|
||||
src: 'https://cdn.livestream.com/chromelessPlayer/v20/playerapi.swf'
|
||||
tag: 'object'
|
||||
params:
|
||||
flashvars: "channel=#{data.id}"
|
||||
else
|
||||
data.meta.embed =
|
||||
src: "https://cdn.livestream.com/embed/#{data.id}?\
|
||||
layout=4&\
|
||||
|
|
|
@ -158,15 +158,19 @@ PlaylistModule.prototype.load = function (data) {
|
|||
}
|
||||
} else if (item.media.type === "gd") {
|
||||
delete item.media.meta.gpdirect;
|
||||
} else if (["vm", "jw", "mx"].includes(item.media.type)) {
|
||||
} else if (["vm", "jw", "mx", "im"].includes(item.media.type)) {
|
||||
// JW has been deprecated for a long time
|
||||
// VM shut down in December 2017
|
||||
// Mixer shut down in July 2020
|
||||
// Dunno when imgur album embeds stopped working but they don't work either
|
||||
LOGGER.warn(
|
||||
"Dropping playlist item with deprecated type %s",
|
||||
item.media.type
|
||||
);
|
||||
return;
|
||||
} else if (item.media.meta.embed && item.media.meta.embed.tag !== 'iframe') {
|
||||
LOGGER.warn("Dropping playlist item with flash embed");
|
||||
return;
|
||||
}
|
||||
|
||||
var m = new Media(item.media.id, item.media.title, item.media.seconds,
|
||||
|
|
|
@ -340,23 +340,6 @@ var Getters = {
|
|||
callback(false, media);
|
||||
},
|
||||
|
||||
/* imgur.com albums */
|
||||
im: function (id, callback) {
|
||||
/**
|
||||
* TODO: Consider deprecating this in favor of custom embeds
|
||||
*/
|
||||
var m = id.match(/([\w-]+)/);
|
||||
if (m) {
|
||||
id = m[1];
|
||||
} else {
|
||||
callback("Invalid ID", null);
|
||||
return;
|
||||
}
|
||||
var title = "Imgur Album - " + id;
|
||||
var media = new Media(id, title, "--:--", "im");
|
||||
callback(false, media);
|
||||
},
|
||||
|
||||
/* custom embed */
|
||||
cu: function (id, callback) {
|
||||
var media;
|
||||
|
|
|
@ -177,7 +177,7 @@
|
|||
};
|
||||
},
|
||||
|
||||
root.formatLink = function (id, type, meta) {
|
||||
root.formatLink = function (id, type, _meta) {
|
||||
switch (type) {
|
||||
case "yt":
|
||||
return "https://youtu.be/" + id;
|
||||
|
@ -193,8 +193,6 @@
|
|||
return "https://twitch.tv/" + id;
|
||||
case "rt":
|
||||
return id;
|
||||
case "im":
|
||||
return "https://imgur.com/a/" + id;
|
||||
case "us":
|
||||
return "https://ustream.tv/channel/" + id;
|
||||
case "gd":
|
||||
|
@ -211,12 +209,6 @@
|
|||
return "https://clips.twitch.tv/" + id;
|
||||
case "cm":
|
||||
return id;
|
||||
case "mx":
|
||||
if (meta !== null) {
|
||||
return `https://mixer.com/${meta.mixer.channelToken}`;
|
||||
} else {
|
||||
return `https://mixer.com/${id}`;
|
||||
}
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
@ -229,10 +221,8 @@
|
|||
case "us":
|
||||
case "rt":
|
||||
case "cu":
|
||||
case "im":
|
||||
case "hb":
|
||||
case "hl":
|
||||
case "mx":
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
|
|
@ -38,8 +38,6 @@ function formatURL(data) {
|
|||
return "https://twitch.tv/" + data.id;
|
||||
case "rt":
|
||||
return data.id;
|
||||
case "im":
|
||||
return "https://imgur.com/a/" + data.id;
|
||||
case "us":
|
||||
return "https://ustream.tv/channel/" + data.id;
|
||||
case "gd":
|
||||
|
@ -56,8 +54,6 @@ function formatURL(data) {
|
|||
return "https://clips.twitch.tv/" + data.id;
|
||||
case "cm":
|
||||
return data.id;
|
||||
case "mx":
|
||||
return "https://mixer.com/" + data.meta.mixer.channelToken;
|
||||
default:
|
||||
return "#";
|
||||
}
|
||||
|
@ -1401,13 +1397,6 @@ function parseMediaLink(url) {
|
|||
};
|
||||
}
|
||||
|
||||
if((m = url.match(/imgur\.com\/a\/([^\?&#]+)/))) {
|
||||
return {
|
||||
id: m[1],
|
||||
type: "im"
|
||||
};
|
||||
}
|
||||
|
||||
if((m = url.match(/soundcloud\.com\/([^\?&#]+)/))) {
|
||||
return {
|
||||
id: url,
|
||||
|
@ -1423,15 +1412,6 @@ function parseMediaLink(url) {
|
|||
};
|
||||
}
|
||||
|
||||
// Deprecated as of December 2017
|
||||
if ((m = url.match(/vid\.me\/embedded\/([\w-]+)/)) ||
|
||||
(m = url.match(/vid\.me\/([\w-]+)/))) {
|
||||
return {
|
||||
id: m[1],
|
||||
type: "vm"
|
||||
};
|
||||
}
|
||||
|
||||
if ((m = url.match(/(.*\.m3u8)/))) {
|
||||
return {
|
||||
id: url,
|
||||
|
@ -1446,14 +1426,6 @@ function parseMediaLink(url) {
|
|||
};
|
||||
}
|
||||
|
||||
// Deprecated as of July 2020
|
||||
if ((m = url.match(/\bmixer\.com\/([\w-]+)/))) {
|
||||
return {
|
||||
id: m[1],
|
||||
type: "mx"
|
||||
};
|
||||
}
|
||||
|
||||
/* Shorthand URIs */
|
||||
// So we still trim DailyMotion URLs
|
||||
if((m = url.match(/^dm:([^\?&#_]+)/))) {
|
||||
|
|
Loading…
Reference in a new issue