Made sure the video player button options are ignored on Invidious.

This commit is contained in:
Ajay Ramachandran 2019-12-19 01:03:09 -05:00
parent 5b628ccbf9
commit 9fc846bd7a

View file

@ -59,9 +59,10 @@ var lastSponsorTimeSkippedUUID = null;
var showingStartSponsor = true; var showingStartSponsor = true;
//should the video controls buttons be added //should the video controls buttons be added
var hideVideoPlayerControls = onInvidious ? true : false; //TODO: If invidious gets video controls, change the code where this is set from chrome.sync as well.
var hideInfoButtonPlayerControls = onInvidious ? true : false; var hideVideoPlayerControls = onInvidious;
var hideDeleteButtonPlayerControls = onInvidious ? true : false; var hideInfoButtonPlayerControls = onInvidious;
var hideDeleteButtonPlayerControls = onInvidious;
//the sponsor times being prepared to be submitted //the sponsor times being prepared to be submitted
var sponsorTimesSubmitting = []; var sponsorTimesSubmitting = [];
@ -374,28 +375,29 @@ function videoIDChange(id) {
}); });
//see if video controls buttons should be added //see if video controls buttons should be added
chrome.storage.sync.get(["hideVideoPlayerControls"], function(result) { if (!onInvidious) {
if (result.hideVideoPlayerControls != undefined) { chrome.storage.sync.get(["hideVideoPlayerControls"], function(result) {
hideVideoPlayerControls = result.hideVideoPlayerControls; if (result.hideVideoPlayerControls != undefined) {
} hideVideoPlayerControls = result.hideVideoPlayerControls;
}
updateVisibilityOfPlayerControlsButton();
}); updateVisibilityOfPlayerControlsButton();
chrome.storage.sync.get(["hideInfoButtonPlayerControls"], function(result) { });
if (result.hideInfoButtonPlayerControls != undefined) { chrome.storage.sync.get(["hideInfoButtonPlayerControls"], function(result) {
hideInfoButtonPlayerControls = result.hideInfoButtonPlayerControls; if (result.hideInfoButtonPlayerControls != undefined) {
} hideInfoButtonPlayerControls = result.hideInfoButtonPlayerControls;
}
updateVisibilityOfPlayerControlsButton();
}); updateVisibilityOfPlayerControlsButton();
chrome.storage.sync.get(["hideDeleteButtonPlayerControls"], function(result) { });
if (result.hideDeleteButtonPlayerControls != undefined) { chrome.storage.sync.get(["hideDeleteButtonPlayerControls"], function(result) {
hideDeleteButtonPlayerControls = result.hideDeleteButtonPlayerControls; if (result.hideDeleteButtonPlayerControls != undefined) {
} hideDeleteButtonPlayerControls = result.hideDeleteButtonPlayerControls;
}
updateVisibilityOfPlayerControlsButton(false);
}); updateVisibilityOfPlayerControlsButton(false);
});
}
} }
function sponsorsLookup(id, channelIDPromise) { function sponsorsLookup(id, channelIDPromise) {
@ -842,7 +844,7 @@ async function changeStartSponsorButton(showStartSponsor, uploadButtonVisible) {
document.getElementById("startSponsorImage").src = chrome.extension.getURL("icons/PlayerStartIconSponsorBlocker256px.png"); document.getElementById("startSponsorImage").src = chrome.extension.getURL("icons/PlayerStartIconSponsorBlocker256px.png");
document.getElementById("startSponsorButton").setAttribute("title", chrome.i18n.getMessage("sponsorStart")); document.getElementById("startSponsorButton").setAttribute("title", chrome.i18n.getMessage("sponsorStart"));
if (document.getElementById("startSponsorImage").style.display != "none" && uploadButtonVisible && !hideDeleteButtonPlayerControls) { if (document.getElementById("startSponsorImage").style.display != "none" && uploadButtonVisible && !hideVideoPlayerControls) {
document.getElementById("submitButton").style.display = "unset"; document.getElementById("submitButton").style.display = "unset";
} else if (!uploadButtonVisible) { } else if (!uploadButtonVisible) {
//disable submit button //disable submit button