Compare commits

...

3 Commits

Author SHA1 Message Date
dependabot[bot] 28acef8fdb
Merge 65d62b6c82 into adc0ea27a9 2024-06-29 01:41:46 +02:00
Honore Doktorr adc0ea27a9 Add player integration code removed from the dailymotion js sdk
Restores https://github.com/dailymotion/dailymotion-sdk-js commit 75b4102
2024-05-26 17:30:11 -07:00
Calvin Montgomery 4c437efb5d Fix #981 2024-04-18 20:08:59 -07:00
2 changed files with 17 additions and 6 deletions

View File

@ -18,7 +18,12 @@ window.DailymotionPlayer = class DailymotionPlayer extends Player
if quality != 'auto'
params.quality = quality
@dm = DM.player('ytapiplayer',
@element = DM.$('ytapiplayer')
if not @element or @element.nodeType != Node.ELEMENT_NODE
throw new Error("Invalid player element in DailymotionPlayer(), requires an existing HTML element: " + @element)
if DM.Player._INSTANCES[@element.id] != undefined
@element = DM.Player.destroy(@element.id)
@dm = DM.Player.create(@element,
video: data.id
width: parseInt(VWIDTH, 10)
height: parseInt(VHEIGHT, 10)

View File

@ -2702,8 +2702,7 @@ function execEmotes(msg) {
}
CHANNEL.emotes.forEach(function (e) {
msg = msg.replace(e.regex, '$1<img class="channel-emote" src="' +
e.image + '" title="' + e.name + '">');
msg = msg.replace(e.regex, '$1' + emoteToImg(e).outerHTML);
});
return msg;
@ -2711,13 +2710,12 @@ function execEmotes(msg) {
function execEmotesEfficient(msg) {
CHANNEL.badEmotes.forEach(function (e) {
msg = msg.replace(e.regex, '$1<img class="channel-emote" src="' +
e.image + '" title="' + e.name + '">');
msg = msg.replace(e.regex, '$1' + emoteToImg(e).outerHTML);
});
msg = msg.replace(/[^\s]+/g, function (m) {
if (CHANNEL.emoteMap.hasOwnProperty(m)) {
var e = CHANNEL.emoteMap[m];
return '<img class="channel-emote" src="' + e.image + '" title="' + e.name + '">';
return emoteToImg(e).outerHTML;
} else {
return m;
}
@ -2725,6 +2723,14 @@ function execEmotesEfficient(msg) {
return msg;
}
function emoteToImg(e) {
var img = document.createElement('img');
img.className = 'channel-emote';
img.title = e.name;
img.src = e.image;
return img;
}
function initPm(user) {
if ($("#pm-" + user).length > 0) {
return $("#pm-" + user);