v1.7.0/remove VRV

This commit is contained in:
2020-09-06 13:26:47 -04:00
parent a5a5e677cd
commit 9194d57e56
5 changed files with 5 additions and 69 deletions
+2 -4
View File
@@ -23,8 +23,7 @@
"https://tv.apple.com/*", "https://tv.apple.com/*",
"https://*.viki.com/*", "https://*.viki.com/*",
"https://*.funimation.com/*", "https://*.funimation.com/*",
"https://roosterteeth.com/*", "https://*.roosterteeth.com/*"
"https://vrv.co/*"
], ],
"content_scripts": [ "content_scripts": [
{ {
@@ -42,8 +41,7 @@
"https://tv.apple.com/*", "https://tv.apple.com/*",
"https://*.viki.com/*", "https://*.viki.com/*",
"https://*.funimation.com/*", "https://*.funimation.com/*",
"https://roosterteeth.com/*", "https://*.roosterteeth.com/*"
"https://vrv.co/*"
], ],
"run_at": "document_idle", "run_at": "document_idle",
"js": ["/static/js/content.js"], "js": ["/static/js/content.js"],
-2
View File
@@ -34,7 +34,6 @@ export const PLAYER_SOURCE = {
VIKI: 'viki.', VIKI: 'viki.',
FUNIMATION: 'funimation.', FUNIMATION: 'funimation.',
ROOSTERTEETH: 'roosterteeth.', ROOSTERTEETH: 'roosterteeth.',
VRV: 'vrv.',
LOCAL: 'localhost', LOCAL: 'localhost',
}; };
@@ -54,7 +53,6 @@ export const getPlayerSource = () => {
if (HREF.includes(PLAYER_SOURCE.VIKI)) return PLAYER_SOURCE.VIKI; if (HREF.includes(PLAYER_SOURCE.VIKI)) return PLAYER_SOURCE.VIKI;
if (HREF.includes(PLAYER_SOURCE.FUNIMATION)) return PLAYER_SOURCE.FUNIMATION; if (HREF.includes(PLAYER_SOURCE.FUNIMATION)) return PLAYER_SOURCE.FUNIMATION;
if (HREF.includes(PLAYER_SOURCE.ROOSTERTEETH)) return PLAYER_SOURCE.ROOSTERTEETH; if (HREF.includes(PLAYER_SOURCE.ROOSTERTEETH)) return PLAYER_SOURCE.ROOSTERTEETH;
if (HREF.includes(PLAYER_SOURCE.VRV)) return PLAYER_SOURCE.VRV;
if (HREF.includes(PLAYER_SOURCE.LOCAL)) return PLAYER_SOURCE.LOCAL; if (HREF.includes(PLAYER_SOURCE.LOCAL)) return PLAYER_SOURCE.LOCAL;
}; };
+3 -56
View File
@@ -9,7 +9,7 @@ ALL CONTENT ON WATCH PARTY'S WEBSITE OR IN WATCH PARTY'S CHROME EXTENSION APP, U
CITED ARE THE SOLE INTELECTUAL PROPERTY OF AYUSHYA AMITABH, AND MAY NOT BE CITED ARE THE SOLE INTELECTUAL PROPERTY OF AYUSHYA AMITABH, AND MAY NOT BE
COPIED, EDITED, OR REPRODUCED WITHOUT PERMISSION. COPIED, EDITED, OR REPRODUCED WITHOUT PERMISSION.
************************************************************************/ ************************************************************************/
import { PLAYER_STATUS, getPlayerSource, PLAYER_SOURCE, LocalData } from './Api'; import { PLAYER_STATUS, getPlayerSource, PLAYER_SOURCE, LocalData} from './Api';
const templateListener = (video) => console.log('MISSING VIDEO LISTENER'); const templateListener = (video) => console.log('MISSING VIDEO LISTENER');
@@ -72,7 +72,6 @@ export default class VideoListener {
switch (this.video.source) { switch (this.video.source) {
case PLAYER_SOURCE.CRUNCHYROLL: case PLAYER_SOURCE.CRUNCHYROLL:
case PLAYER_SOURCE.FUNIMATION: case PLAYER_SOURCE.FUNIMATION:
case PLAYER_SOURCE.VRV:
window.removeEventListener('watchParty', this.crunchyRollListener); window.removeEventListener('watchParty', this.crunchyRollListener);
break; break;
default: default:
@@ -162,16 +161,6 @@ export default class VideoListener {
time: serverPlayer.time, time: serverPlayer.time,
}) })
); );
case PLAYER_SOURCE.VRV:
window.postMessage(
JSON.stringify({
watchPartyDirection: 'TO_SCRIPT',
type: 'WATCH_PARTY_SEEK',
status: serverPlayer.status,
time: serverPlayer.time,
})
);
break;
default: default:
break; break;
} }
@@ -190,8 +179,7 @@ export default class VideoListener {
PLAYER_SOURCE.CRUNCHYROLL === this.video.source || PLAYER_SOURCE.CRUNCHYROLL === this.video.source ||
PLAYER_SOURCE.PEACOCK === this.video.source || PLAYER_SOURCE.PEACOCK === this.video.source ||
PLAYER_SOURCE.FUNIMATION === this.video.source || PLAYER_SOURCE.FUNIMATION === this.video.source ||
PLAYER_SOURCE.ROOSTERTEETH === this.video.source || PLAYER_SOURCE.ROOSTERTEETH === this.video.source
PLAYER_SOURCE.VRV === this.video.source
) { ) {
window.postMessage( window.postMessage(
JSON.stringify({ JSON.stringify({
@@ -217,8 +205,7 @@ export default class VideoListener {
PLAYER_SOURCE.CRUNCHYROLL === this.video.source || PLAYER_SOURCE.CRUNCHYROLL === this.video.source ||
PLAYER_SOURCE.PEACOCK === this.video.source || PLAYER_SOURCE.PEACOCK === this.video.source ||
PLAYER_SOURCE.FUNIMATION === this.video.source || PLAYER_SOURCE.FUNIMATION === this.video.source ||
PLAYER_SOURCE.ROOSTERTEETH === this.video.source || PLAYER_SOURCE.ROOSTERTEETH === this.video.source
PLAYER_SOURCE.VRV === this.video.source
) { ) {
window.postMessage( window.postMessage(
JSON.stringify({ JSON.stringify({
@@ -242,7 +229,6 @@ export default class VideoListener {
switch (this.video.source) { switch (this.video.source) {
case PLAYER_SOURCE.CRUNCHYROLL: case PLAYER_SOURCE.CRUNCHYROLL:
case PLAYER_SOURCE.FUNIMATION: case PLAYER_SOURCE.FUNIMATION:
case PLAYER_SOURCE.VRV:
window.addEventListener('watchParty', this.crunchyRollListener); window.addEventListener('watchParty', this.crunchyRollListener);
break; break;
default: default:
@@ -357,12 +343,6 @@ export default class VideoListener {
return roosterTeethShow === '' && roosterTeethEpisode === '' return roosterTeethShow === '' && roosterTeethEpisode === ''
? null ? null
: roosterTeethShow + '\n' + roosterTeethEpisode; : roosterTeethShow + '\n' + roosterTeethEpisode;
case PLAYER_SOURCE.VRV:
const vrvShowContainer = document.querySelector(nS.show);
const vrvEpisodeContainer = document.querySelector(nS.episode);
const vrvShow = vrvShowContainer ? vrvShowContainer.innerText : '';
const vrvEpisode = vrvEpisodeContainer ? vrvEpisodeContainer.innerText : '';
return vrvShow === '' && vrvEpisode === '' ? null : vrvShow + ' ' + vrvEpisode;
default: default:
break; break;
} }
@@ -403,7 +383,6 @@ export default class VideoListener {
switch (this.video.source) { switch (this.video.source) {
case PLAYER_SOURCE.CRUNCHYROLL: case PLAYER_SOURCE.CRUNCHYROLL:
case PLAYER_SOURCE.FUNIMATION: case PLAYER_SOURCE.FUNIMATION:
case PLAYER_SOURCE.VRV:
window.postMessage( window.postMessage(
JSON.stringify({ JSON.stringify({
watchPartyDirection: 'TO_SCRIPT', watchPartyDirection: 'TO_SCRIPT',
@@ -771,38 +750,6 @@ export default class VideoListener {
); );
} }
break; break;
case PLAYER_SOURCE.VRV:
const vrvInject = `var sendToWatchPartyApp=function(pS,pT){var customWatchPartyEvent=new CustomEvent('watchParty',{detail:{watchPartyDirection:'TO_APP',type:'WATCH_PARTY_PLAYER_UPDATE',status:pS,time:pT}});window.dispatchEvent(customWatchPartyEvent)},watchPartyGetTimeAndSend=function(pS){const playerIframe=document.querySelector('${
this.selectors[PLAYER_SOURCE.VRV]
}');if(playerIframe){const player=playerIframe.contentWindow.document.querySelector('video');if(player){sendToWatchPartyApp(pS,player.currentTime)}}},watchPartySendPlaying=function(){watchPartyGetTimeAndSend('PLAYING')},watchPartySendPaused=function(){watchPartyGetTimeAndSend('PAUSED')},watchPartyInteraction=function(e){const data=JSON.parse(e.data);const playerIframe=document.querySelector('${
this.selectors[PLAYER_SOURCE.VRV]
}');if(playerIframe){const player=playerIframe.contentWindow.document.querySelector('video');if(player){if(data.watchPartyDirection==='TO_SCRIPT'){if(data.type==='WATCH_PARTY_ADD_LISTENERS'){player.addEventListener('playing',watchPartySendPlaying);player.addEventListener('pause',watchPartySendPaused)}else if(data.type==='WATCH_PARTY_SEEK'){const playerNode=player.parentNode;if(playerNode&&playerNode.player){playerNode.player.currentTime(data.time)}}else if(data.type==='WATCH_PARTY_STATUS'){if(data.status==='PAUSED')player.pause();if(data.status==='PLAYING')player.play()}}}}};window.addEventListener("message",watchPartyInteraction);`;
const vrvInjectScript = document.createElement('script');
vrvInjectScript.text = vrvInject;
document.head.appendChild(vrvInjectScript);
const vrvIframe = document.querySelector(this.selectors[PLAYER_SOURCE.VRV]);
if (vrvIframe) {
this.firstTimeSync(vrvIframe);
} else {
setInterval(
this.video.element
? null
: () => {
const vrvif = document.querySelector(this.selectors[PLAYER_SOURCE.VRV]);
if (vrvif) {
this.firstTimeSync(vrvif);
}
},
1000
);
}
break;
case PLAYER_SOURCE.LOCAL:
const localVideoElement = document.getElementsByTagName('video')[0];
if (localVideoElement) {
this.firstTimeSync(localVideoElement);
}
break;
default: default:
break; break;
} }
-4
View File
@@ -278,10 +278,6 @@ body.roosterteeth.visible .party-content-wrapper textarea:focus {
border-bottom: none !important; border-bottom: none !important;
box-shadow: none !important; box-shadow: none !important;
} }
/* VRV STYLING */
body.vrv.visible .header-content {
max-width: var(--body-width);
}
#party-loading { #party-loading {
position: absolute; position: absolute;
-3
View File
@@ -131,9 +131,6 @@ switch (getPlayerSource()) {
case PLAYER_SOURCE.ROOSTERTEETH: case PLAYER_SOURCE.ROOSTERTEETH:
document.body.classList.add('roosterteeth'); document.body.classList.add('roosterteeth');
break; break;
case PLAYER_SOURCE.VRV:
document.body.classList.add('vrv');
break;
case PLAYER_SOURCE.LOCAL: case PLAYER_SOURCE.LOCAL:
document.body.classList.add('local'); document.body.classList.add('local');
break; break;