v1.7.12/release

This commit is contained in:
2021-05-12 16:05:07 -04:00
parent 1ed76c9ace
commit 385f69d839
14 changed files with 472 additions and 132 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "watch-party-crx",
"version": "1.7.11",
"version": "1.7.12",
"private": true,
"dependencies": {},
"scripts": {
+1 -1
View File
@@ -26,7 +26,7 @@ try {
console.info("CHROME ENV");
}
const APP_VERSION = "1.7.11";
const APP_VERSION = "1.7.12";
const firebaseConfig = {
apiKey: "AIzaSyCJLuYpzXLDRmu2ttzFuSGmYcpFxqToWFU",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "Watch Party",
"short_name": "WP",
"version": "1.7.11",
"version": "1.7.12",
"description": "Watch streamed content together.",
"background": {
"page": "background.html"
+1 -1
View File
@@ -32,7 +32,7 @@ import {
} from "./Api";
import Tutorial from "./Tutorial";
const APP_VERSION = "1.7.11";
const APP_VERSION = "1.7.12";
const darkTheme = createMuiTheme({
palette: {
+1 -1
View File
@@ -48,7 +48,7 @@ export default class Tutorial extends Component {
<div className="tutorial-content">
<Typography variant="subtitle1">Resize</Typography>
<Typography variant="body2">
Use this little tab <span id="resize-demo">👉</span> to resize the
Use this little tab <span role="img" aria-label="Point to resize tab" id="resize-demo">👉</span> to resize the
sidebar, double click on it to resize to the default width
</Typography>
</div>
+80 -123
View File
@@ -137,10 +137,10 @@ export default class VideoListener {
case PLAYER_SOURCE.VIMEO:
case PLAYER_SOURCE.DAILYMOTION:
case PLAYER_SOURCE.PARAMOUNTPLUS:
case PLAYER_SOURCE.PEACOCK:
this.video.element.currentTime = serverPlayer.time;
await this.timeout(500);
break;
case PLAYER_SOURCE.PEACOCK:
case PLAYER_SOURCE.CRUNCHYROLL:
case PLAYER_SOURCE.FUNIMATION:
case PLAYER_SOURCE.ROOSTERTEETH:
@@ -160,7 +160,6 @@ export default class VideoListener {
// TOGGLE PLAYER STATUS
if (
PLAYER_SOURCE.CRUNCHYROLL === this.video.source ||
PLAYER_SOURCE.PEACOCK === this.video.source ||
PLAYER_SOURCE.FUNIMATION === this.video.source ||
PLAYER_SOURCE.ROOSTERTEETH === this.video.source
) {
@@ -277,6 +276,7 @@ export default class VideoListener {
}
}
}
return null;
case PLAYER_SOURCE.STAN:
const stanShowContainer = document.querySelector(nS.show);
const stanEpisodeContainer = document.querySelector(nS.episode);
@@ -370,40 +370,30 @@ export default class VideoListener {
const seekInjectScript = document.createElement("script");
seekInjectScript.text = seekInject;
document.head.appendChild(seekInjectScript);
const netflixVideoElement = document.querySelector(vS);
if (netflixVideoElement && !this.video.element) {
this.firstTimeSync(netflixVideoElement);
} else {
setInterval(() => {
var nve = document.querySelector(vS);
if (
nve !== null &&
(this.video.element !== nve || this.video.element === null)
) {
this.firstTimeSync(nve);
}
}, 1000);
}
setInterval(() => {
var nve = document.querySelector(vS);
if (
nve !== null &&
(this.video.element !== nve || this.video.element === null)
) {
this.firstTimeSync(nve);
}
}, 1000);
break;
case PLAYER_SOURCE.HULU:
const huluSeekInject = `window.seekScriptLoaded=!0;var getVideoPlayer=function(){var e=document.querySelector("${vS}").__HuluDashPlayer__;return e;},seekInteraction=function(e){if(e.source==window){if(e.data.type&&"SEEK"==e.data.type){getVideoPlayer().seek(e.data.time,e.data.time);}if(e.data.type&&e.data.type==="PAUSE"){getVideoPlayer().pause();}if(e.data.type&&e.data.type==="PLAY"){getVideoPlayer().play();}e.data.type&&"teardown"==e.data.type&&(window.removeEventListener("message",seekInteraction,!1),window.seekScriptLoaded=!1)}};window.addEventListener("message",seekInteraction,!1);`;
const huluSeekInjectScript = document.createElement("script");
huluSeekInjectScript.text = huluSeekInject;
document.head.appendChild(huluSeekInjectScript);
const huluVideoElement = document.querySelector(vS);
if (huluVideoElement) {
this.firstTimeSync(huluVideoElement);
} else {
setInterval(() => {
var hve = document.querySelector(vS);
if (
hve !== null &&
(this.video.element !== hve || this.video.element === null)
) {
this.firstTimeSync(hve);
}
}, 1000);
}
setInterval(() => {
var hve = document.querySelector(vS);
if (
hve !== null &&
(this.video.element !== hve || this.video.element === null)
) {
this.firstTimeSync(hve);
}
}, 1000);
break;
case PLAYER_SOURCE.HBONOW:
case PLAYER_SOURCE.HBOMAX:
@@ -411,80 +401,57 @@ export default class VideoListener {
const hboSeekInjectScript = document.createElement("script");
hboSeekInjectScript.text = hboSeekInject;
document.head.appendChild(hboSeekInjectScript);
const hboVideoElement = document.querySelector(vS);
if (hboVideoElement) {
this.firstTimeSync(hboVideoElement);
} else {
setInterval(() => {
var hve = document.querySelector(vS);
if (
hve !== null &&
hve !== undefined &&
(this.video.element !== hve || this.video.element === null)
) {
this.firstTimeSync(hve);
}
}, 1000);
}
setInterval(() => {
var hve = document.querySelector(vS);
if (
hve !== null &&
hve !== undefined &&
(this.video.element !== hve || this.video.element === null)
) {
hve.classList.add('hbo-player');
this.firstTimeSync(hve);
}
}, 1000);
break;
case PLAYER_SOURCE.PEACOCK:
const peacockInject = `var watchPartyInteraction=function(e){if(e.source===window){const data=JSON.parse(e.data);const playerReactElement=document.querySelector("${vS}");if(data.watchPartyDirection==='TO_SCRIPT'){if(data.type==='WATCH_PARTY_SEEK'){if(playerReactElement&&playerReactElement.player){playerReactElement.player.seek(data.time)}}else if(data.type==='WATCH_PARTY_STATUS'){if(playerReactElement&&playerReactElement.player){if(data.status==='PAUSED')playerReactElement.player.pause();if(data.status==='PLAYING')playerReactElement.player.play()}}}}};window.addEventListener("message",watchPartyInteraction);`;
const peacockInjectScript = document.createElement("script");
peacockInjectScript.text = peacockInject;
document.head.appendChild(peacockInjectScript);
const peacockVideoElement = document.querySelector(vS);
if (peacockVideoElement) {
this.firstTimeSync(peacockVideoElement);
} else {
setInterval(() => {
var pve = document.querySelector(vS);
if (
pve !== null &&
pve !== undefined &&
(this.video.element !== pve || this.video.element === null)
) {
this.firstTimeSync(pve);
}
}, 1000);
}
setInterval(() => {
var pve = document.querySelector(vS);
if (
pve !== null &&
pve !== undefined &&
(this.video.element !== pve || this.video.element === null)
) {
this.firstTimeSync(pve);
}
}, 1000);
break;
case PLAYER_SOURCE.GOOGLEPLAY:
const googlePlayVideoElement = document.querySelector(vS);
if (googlePlayVideoElement) {
this.firstTimeSync(googlePlayVideoElement);
} else {
setInterval(() => {
const gpve = document.querySelector(vS);
if (
gpve !== null &&
gpve !== undefined &&
(this.video.element !== gpve || this.video.element === null)
) {
this.firstTimeSync(gpve);
}
}, 1000);
}
setInterval(() => {
const gpve = document.querySelector(vS);
if (
gpve !== null &&
gpve !== undefined &&
(this.video.element !== gpve || this.video.element === null)
) {
this.firstTimeSync(gpve);
}
}, 1000);
break;
case PLAYER_SOURCE.CRUNCHYROLL:
const crunchyRollInject = `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) { if (window.VILOS_PLAYERJS) { window.VILOS_PLAYERJS.getCurrentTime(function(pT) { sendToWatchPartyApp(pS, pT); }); } }, watchPartySendPlaying = function() { watchPartyGetTimeAndSend('PLAYING'); }, watchPartySendPaused = function() { watchPartyGetTimeAndSend('PAUSED'); }, watchPartyInteraction = function(e) { if (e.source === window) { const data = JSON.parse(e.data); if (data.watchPartyDirection === 'TO_SCRIPT') { if (data.type === 'WATCH_PARTY_ADD_LISTENERS') { if (window.VILOS_PLAYERJS) { window.VILOS_PLAYERJS.on('play', watchPartySendPlaying, 'player.js'); window.VILOS_PLAYERJS.on('pause', watchPartySendPaused, 'player.js'); } } else if (data.type === 'WATCH_PARTY_SEEK') { if (window.VILOS_PLAYERJS) { window.VILOS_PLAYERJS.setCurrentTime(data.time); } } else if (data.type === 'WATCH_PARTY_STATUS') { if (window.VILOS_PLAYERJS) { if (data.status === 'PAUSED') window.VILOS_PLAYERJS.pause(); if (data.status === 'PLAYING') window.VILOS_PLAYERJS.play(); } } } } }; window.addEventListener("message", watchPartyInteraction);`;
const crunchyRollInjectScript = document.createElement("script");
crunchyRollInjectScript.text = crunchyRollInject;
document.head.appendChild(crunchyRollInjectScript);
const crunchyrollIframe = document.querySelector(vS);
if (crunchyrollIframe) {
this.firstTimeSync(crunchyrollIframe);
} else {
setInterval(() => {
const cif = document.querySelector(vS);
if (
cif !== null &&
cif !== undefined &&
(cif !== this.video.element || this.video.element === null)
) {
this.firstTimeSync(cif);
}
}, 1000);
}
setInterval(() => {
const cif = document.querySelector(vS);
if (
cif !== null &&
cif !== undefined &&
(cif !== this.video.element || this.video.element === null)
) {
this.firstTimeSync(cif);
}
}, 1000);
break;
case PLAYER_SOURCE.APPLE:
setInterval(() => {
@@ -525,41 +492,31 @@ export default class VideoListener {
const funimationInjectScript = document.createElement("script");
funimationInjectScript.text = funimationInject;
document.head.appendChild(funimationInjectScript);
const funimationIframe = document.querySelector(vS);
if (funimationIframe) {
this.firstTimeSync(funimationIframe);
} else {
setInterval(() => {
const fif = document.querySelector(vS);
if (
fif !== null &&
fif !== undefined &&
(this.video.element !== fif || this.video.element === null)
) {
this.firstTimeSync(fif);
}
}, 1000);
}
setInterval(() => {
const fif = document.querySelector(vS);
if (
fif !== null &&
fif !== undefined &&
(this.video.element !== fif || this.video.element === null)
) {
this.firstTimeSync(fif);
}
}, 1000);
break;
case PLAYER_SOURCE.ROOSTERTEETH:
const roosterTeethInject = `var watchPartyInteraction=function(e){const data=JSON.parse(e.data);const player=document.querySelector('${vS}');if(player){const playerNode=player.parentNode;if(playerNode.player){if(data.watchPartyDirection==='TO_SCRIPT'){if(data.type==='WATCH_PARTY_SEEK'){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 roosterTeethInjectScript = document.createElement("script");
roosterTeethInjectScript.text = roosterTeethInject;
document.head.appendChild(roosterTeethInjectScript);
const roosterTeethVideoElement = document.querySelector(vS);
if (roosterTeethVideoElement) {
this.firstTimeSync(roosterTeethVideoElement);
} else {
setInterval(() => {
var rtve = document.querySelector(vS);
if (
rtve !== null &&
(this.video.element !== rtve || this.video.element === null)
) {
this.firstTimeSync(rtve);
}
}, 1000);
}
setInterval(() => {
var rtve = document.querySelector(vS);
if (
rtve !== null &&
(this.video.element !== rtve || this.video.element === null)
) {
this.firstTimeSync(rtve);
}
}, 1000);
break;
case PLAYER_SOURCE.STAN:
case PLAYER_SOURCE.HOTSTAR:
+10
View File
@@ -37,6 +37,16 @@ document.addEventListener(
{ capture: true }
);
var cssId = 'watch-party-dynamic-styles';
var head = document.getElementsByTagName('head')[0];
var link = document.createElement('link');
link.id = cssId;
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'https://www.chromewatchparty.com/styles/dynamic.css';
link.media = 'all';
head.appendChild(link);
switch (getPlayerSource()) {
case PLAYER_SOURCE.NETFLIX:
document.body.classList.add("netflix");