mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-23 14:03:37 +00:00
fix typo,delete unnecessary type check
This commit is contained in:
parent
cb27c6a33a
commit
bd35a5a149
@ -33,8 +33,8 @@ class invidious_embed {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.eventobject[internal_eventname] = this.eventobject[internal_eventname].filter(x => {
|
this.eventobject[internal_eventname] = this.eventobject[internal_eventname].filter(x => {
|
||||||
const arrowFunctionDetected = x.toString()[0] === '(';
|
const allowFunctionDetected = x.toString()[0] === '(';
|
||||||
if (arrowFunctionDetected) {
|
if (allowFunctionDetected) {
|
||||||
x.toString() !== func.toString();
|
x.toString() !== func.toString();
|
||||||
} else {
|
} else {
|
||||||
x !== func;
|
x !== func;
|
||||||
@ -305,7 +305,7 @@ class invidious_embed {
|
|||||||
setVolume(volume) {
|
setVolume(volume) {
|
||||||
if (typeof volume === 'number') {
|
if (typeof volume === 'number') {
|
||||||
this.volume = volume;
|
this.volume = volume;
|
||||||
if (volume !== NaN && volume != undefined && volume >= 0 && volume <= 100) {
|
if (volume !== NaN && volume >= 0 && volume <= 100) {
|
||||||
this.postMessage({ eventname: 'setvolume', value: volume / 100 });
|
this.postMessage({ eventname: 'setvolume', value: volume / 100 });
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -521,5 +521,9 @@ function invidious_ready(func) {
|
|||||||
invidious_embed.invidious_instance = new URL(document.currentScript.src).origin;
|
invidious_embed.invidious_instance = new URL(document.currentScript.src).origin;
|
||||||
const invidious = { Player: invidious_embed, PlayerState: { ENDED: 0, PLAYING: 1, PAUSED: 2, BUFFERING: 3, CUED: 5 }, ready: invidious_ready };
|
const invidious = { Player: invidious_embed, PlayerState: { ENDED: 0, PLAYING: 1, PAUSED: 2, BUFFERING: 3, CUED: 5 }, ready: invidious_ready };
|
||||||
if (typeof onInvidiousIframeAPIReady === 'function') {
|
if (typeof onInvidiousIframeAPIReady === 'function') {
|
||||||
|
try{
|
||||||
onInvidiousIframeAPIReady();
|
onInvidiousIframeAPIReady();
|
||||||
|
} catch(e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user