v1.6.5/version bump
- fix HBO
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "watch-party-crx",
|
||||
"version": "1.6.4",
|
||||
"version": "1.6.5",
|
||||
"private": true,
|
||||
"dependencies": {},
|
||||
"scripts": {
|
||||
|
||||
+53
-51
@@ -12,18 +12,18 @@ COPIED, EDITED, OR REPRODUCED WITHOUT PERMISSION.
|
||||
/* global chrome */
|
||||
/* global firebase */
|
||||
|
||||
const APP_VERSION = '1.6.4';
|
||||
const APP_VERSION_STRING = APP_VERSION.replace(/\./g, '');
|
||||
const APP_VERSION = "1.6.5";
|
||||
const APP_VERSION_STRING = APP_VERSION.replace(/\./g, "");
|
||||
|
||||
const firebaseConfig = {
|
||||
apiKey: 'AIzaSyCJLuYpzXLDRmu2ttzFuSGmYcpFxqToWFU',
|
||||
authDomain: 'watch-party-crx.firebaseapp.com',
|
||||
databaseURL: 'https://watch-party-crx.firebaseio.com',
|
||||
projectId: 'watch-party-crx',
|
||||
storageBucket: 'watch-party-crx.appspot.com',
|
||||
messagingSenderId: '712242707190',
|
||||
appId: '1:712242707190:web:65fa7f772e30da364b0ad7',
|
||||
measurementId: 'G-EZS4PEVG4T',
|
||||
apiKey: "AIzaSyCJLuYpzXLDRmu2ttzFuSGmYcpFxqToWFU",
|
||||
authDomain: "watch-party-crx.firebaseapp.com",
|
||||
databaseURL: "https://watch-party-crx.firebaseio.com",
|
||||
projectId: "watch-party-crx",
|
||||
storageBucket: "watch-party-crx.appspot.com",
|
||||
messagingSenderId: "712242707190",
|
||||
appId: "1:712242707190:web:65fa7f772e30da364b0ad7",
|
||||
measurementId: "G-EZS4PEVG4T",
|
||||
};
|
||||
|
||||
firebase.initializeApp(firebaseConfig);
|
||||
@@ -44,8 +44,8 @@ const fetcher = async (request, sendResponse) => {
|
||||
method,
|
||||
headers: {
|
||||
Authorization: `Token ${idToken}:${firebase.auth().currentUser.uid}`,
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Keep-Alive': true,
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Keep-Alive": true,
|
||||
},
|
||||
...request,
|
||||
})
|
||||
@@ -73,37 +73,37 @@ const sendAuth = async (sendResponse) => {
|
||||
|
||||
chrome.runtime.onInstalled.addListener((details) => {
|
||||
if (details.reason) {
|
||||
if (details.reason === 'install') {
|
||||
if (window.localStorage.getItem('watchPartyVersion')) {
|
||||
if (window.localStorage.getItem('watchPartyVersion') !== APP_VERSION) {
|
||||
if (details.reason === "install") {
|
||||
if (window.localStorage.getItem("watchPartyVersion")) {
|
||||
if (window.localStorage.getItem("watchPartyVersion") !== APP_VERSION) {
|
||||
chrome.tabs.create({
|
||||
url: `http://www.chromewatchparty.com/changes/v${APP_VERSION}`,
|
||||
active: true,
|
||||
});
|
||||
window.localStorage.setItem('watchPartyVersion', APP_VERSION);
|
||||
window.localStorage.setItem("watchPartyVersion", APP_VERSION);
|
||||
}
|
||||
} else {
|
||||
chrome.tabs.create({
|
||||
url: 'https://www.chromewatchparty.com/welcome',
|
||||
url: "https://www.chromewatchparty.com/welcome",
|
||||
active: true,
|
||||
});
|
||||
window.localStorage.setItem('watchPartyVersion', APP_VERSION);
|
||||
window.localStorage.setItem("watchPartyVersion", APP_VERSION);
|
||||
}
|
||||
} else if (details.reason === 'update') {
|
||||
if (window.localStorage.getItem('watchPartyVersion')) {
|
||||
if (window.localStorage.getItem('watchPartyVersion') !== APP_VERSION) {
|
||||
} else if (details.reason === "update") {
|
||||
if (window.localStorage.getItem("watchPartyVersion")) {
|
||||
if (window.localStorage.getItem("watchPartyVersion") !== APP_VERSION) {
|
||||
chrome.tabs.create({
|
||||
url: `http://www.chromewatchparty.com/changes/v${APP_VERSION}`,
|
||||
active: true,
|
||||
});
|
||||
window.localStorage.setItem('watchPartyVersion', APP_VERSION);
|
||||
window.localStorage.setItem("watchPartyVersion", APP_VERSION);
|
||||
}
|
||||
} else {
|
||||
chrome.tabs.create({
|
||||
url: `http://www.chromewatchparty.com/changes/v${APP_VERSION}`,
|
||||
active: true,
|
||||
});
|
||||
window.localStorage.setItem('watchPartyVersion', APP_VERSION);
|
||||
window.localStorage.setItem("watchPartyVersion", APP_VERSION);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,41 +112,41 @@ chrome.runtime.onInstalled.addListener((details) => {
|
||||
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
const { type } = request;
|
||||
switch (type) {
|
||||
case 'API_CALL':
|
||||
case "API_CALL":
|
||||
fetcher(request, sendResponse);
|
||||
break;
|
||||
case 'GET_AUTH':
|
||||
case "GET_AUTH":
|
||||
sendAuth(sendResponse);
|
||||
break;
|
||||
case 'GET_PARTIES':
|
||||
case "GET_PARTIES":
|
||||
sendResponse(
|
||||
window.localStorage.getItem('parties')
|
||||
? JSON.parse(window.localStorage.getItem('parties'))
|
||||
window.localStorage.getItem("parties")
|
||||
? JSON.parse(window.localStorage.getItem("parties"))
|
||||
: []
|
||||
);
|
||||
break;
|
||||
case 'EMPTY_PARTIES':
|
||||
window.localStorage.removeItem('parties');
|
||||
case "EMPTY_PARTIES":
|
||||
window.localStorage.removeItem("parties");
|
||||
break;
|
||||
case 'IS_HIDDEN':
|
||||
case "IS_HIDDEN":
|
||||
sendResponse(
|
||||
window.localStorage.getItem('showWPButton')
|
||||
? JSON.parse(window.localStorage.getItem('showWPButton'))
|
||||
window.localStorage.getItem("showWPButton")
|
||||
? JSON.parse(window.localStorage.getItem("showWPButton"))
|
||||
: true
|
||||
);
|
||||
break;
|
||||
case 'GET_TUTORIAL':
|
||||
case "GET_TUTORIAL":
|
||||
sendResponse(
|
||||
window.localStorage.getItem('tutorialComplete')
|
||||
? JSON.parse(window.localStorage.getItem('tutorialComplete'))
|
||||
window.localStorage.getItem("tutorialComplete")
|
||||
? JSON.parse(window.localStorage.getItem("tutorialComplete"))
|
||||
: false
|
||||
);
|
||||
break;
|
||||
case 'SET_TUTORIAL':
|
||||
window.localStorage.setItem('tutorialComplete', request.status);
|
||||
case "SET_TUTORIAL":
|
||||
window.localStorage.setItem("tutorialComplete", request.status);
|
||||
break;
|
||||
default:
|
||||
console.warn('Unknown message type: <', type, '>');
|
||||
console.warn("Unknown message type: <", type, ">");
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
@@ -160,10 +160,10 @@ chrome.runtime.onConnect.addListener((port) => {
|
||||
});
|
||||
port.onMessage.addListener((request) => {
|
||||
const { type, roomId, roomPin } = request;
|
||||
if (type === 'INIT') {
|
||||
if (type === "INIT") {
|
||||
port.roomListener = firebase
|
||||
.firestore()
|
||||
.collection('rooms')
|
||||
.collection("rooms")
|
||||
.doc(roomId)
|
||||
.onSnapshot(
|
||||
(snap) => {
|
||||
@@ -177,14 +177,16 @@ chrome.runtime.onConnect.addListener((port) => {
|
||||
);
|
||||
port.userListener = firebase
|
||||
.firestore()
|
||||
.collection('rooms')
|
||||
.collection("rooms")
|
||||
.doc(roomId)
|
||||
.collection('users')
|
||||
.collection("users")
|
||||
.onSnapshot(
|
||||
(snap) => {
|
||||
if (snap) {
|
||||
const isAdmin = snap.docs
|
||||
.filter((user) => user.id === firebase.auth().currentUser.uid)[0]
|
||||
.filter(
|
||||
(user) => user.id === firebase.auth().currentUser.uid
|
||||
)[0]
|
||||
.data().admin;
|
||||
const users = snap.docs.map((userSnap) => userSnap.data().name);
|
||||
port.postMessage({ admin: isAdmin, users });
|
||||
@@ -196,10 +198,10 @@ chrome.runtime.onConnect.addListener((port) => {
|
||||
);
|
||||
port.messageListener = firebase
|
||||
.firestore()
|
||||
.collection('rooms')
|
||||
.collection("rooms")
|
||||
.doc(roomId)
|
||||
.collection('messages')
|
||||
.orderBy('time')
|
||||
.collection("messages")
|
||||
.orderBy("time")
|
||||
.onSnapshot(
|
||||
(snap) => {
|
||||
if (snap) {
|
||||
@@ -213,18 +215,18 @@ chrome.runtime.onConnect.addListener((port) => {
|
||||
port.postMessage({ isError: true, ...err });
|
||||
}
|
||||
);
|
||||
if (window.localStorage.getItem('parties')) {
|
||||
var existing = JSON.parse(window.localStorage.getItem('parties'));
|
||||
if (window.localStorage.getItem("parties")) {
|
||||
var existing = JSON.parse(window.localStorage.getItem("parties"));
|
||||
if (!(existing.filter((i) => i.name === roomId).length > 0)) {
|
||||
existing.push({
|
||||
name: roomId,
|
||||
pin: roomPin,
|
||||
});
|
||||
window.localStorage.setItem('parties', JSON.stringify(existing));
|
||||
window.localStorage.setItem("parties", JSON.stringify(existing));
|
||||
}
|
||||
} else {
|
||||
window.localStorage.setItem(
|
||||
'parties',
|
||||
"parties",
|
||||
JSON.stringify([
|
||||
{
|
||||
name: roomId,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "Watch Party",
|
||||
"short_name": "WP",
|
||||
"version": "1.6.4",
|
||||
"version": "1.6.5",
|
||||
"description": "Watch streamed content together.",
|
||||
"background": {
|
||||
"page": "background.html"
|
||||
|
||||
+86
-59
@@ -9,34 +9,40 @@ 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
|
||||
COPIED, EDITED, OR REPRODUCED WITHOUT PERMISSION.
|
||||
************************************************************************/
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import Router from 'route-lite';
|
||||
import { Fab, createMuiTheme, ThemeProvider, Snackbar, Tooltip } from '@material-ui/core';
|
||||
import Create from './Create';
|
||||
import Loading from './Loading';
|
||||
import firebase from 'firebase/app';
|
||||
import 'firebase/firestore';
|
||||
import Inactive from './Inactive';
|
||||
import React, { useState, useEffect } from "react";
|
||||
import Router from "route-lite";
|
||||
import {
|
||||
Fab,
|
||||
createMuiTheme,
|
||||
ThemeProvider,
|
||||
Snackbar,
|
||||
Tooltip,
|
||||
} from "@material-ui/core";
|
||||
import Create from "./Create";
|
||||
import Loading from "./Loading";
|
||||
import firebase from "firebase/app";
|
||||
import "firebase/firestore";
|
||||
import Inactive from "./Inactive";
|
||||
import {
|
||||
getUserUid,
|
||||
getPlayerSource,
|
||||
PLAYER_SOURCE,
|
||||
getShowWPButton,
|
||||
getTutorialStatus,
|
||||
} from './Api';
|
||||
import Tutorial from './Tutorial';
|
||||
} from "./Api";
|
||||
import Tutorial from "./Tutorial";
|
||||
|
||||
const APP_VERSION = '1.6.4';
|
||||
const APP_VERSION_STRING = APP_VERSION.replace(/\./g, '');
|
||||
const APP_VERSION = "1.6.5";
|
||||
const APP_VERSION_STRING = APP_VERSION.replace(/\./g, "");
|
||||
|
||||
const darkTheme = createMuiTheme({
|
||||
palette: {
|
||||
type: 'dark',
|
||||
type: "dark",
|
||||
primary: {
|
||||
main: '#FF0000',
|
||||
main: "#FF0000",
|
||||
},
|
||||
secondary: {
|
||||
main: '#c0f300',
|
||||
main: "#c0f300",
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -49,35 +55,44 @@ const Routes = (props) => (
|
||||
|
||||
const resetResize = () => {
|
||||
const checkedX = 425;
|
||||
document.documentElement.style.setProperty('--party-width', `${checkedX}px`);
|
||||
document.documentElement.style.setProperty('--neg-party-width', `-${checkedX}px`);
|
||||
document.documentElement.style.setProperty("--party-width", `${checkedX}px`);
|
||||
document.documentElement.style.setProperty(
|
||||
"--neg-party-width",
|
||||
`-${checkedX}px`
|
||||
);
|
||||
};
|
||||
|
||||
const doResize = (ev) => {
|
||||
const checkedX =
|
||||
window.innerWidth -
|
||||
Math.min(window.innerWidth - 300, Math.max(window.innerWidth * 0.5, ev.clientX));
|
||||
document.documentElement.style.setProperty('--party-width', `${checkedX}px`);
|
||||
document.documentElement.style.setProperty('--neg-party-width', `-${checkedX}px`);
|
||||
Math.min(
|
||||
window.innerWidth - 300,
|
||||
Math.max(window.innerWidth * 0.5, ev.clientX)
|
||||
);
|
||||
document.documentElement.style.setProperty("--party-width", `${checkedX}px`);
|
||||
document.documentElement.style.setProperty(
|
||||
"--neg-party-width",
|
||||
`-${checkedX}px`
|
||||
);
|
||||
};
|
||||
|
||||
const stopResize = (ev) => {
|
||||
document.documentElement.removeEventListener('mousemove', doResize, false);
|
||||
document.documentElement.removeEventListener('mouseup', stopResize, false);
|
||||
document.documentElement.removeEventListener("mousemove", doResize, false);
|
||||
document.documentElement.removeEventListener("mouseup", stopResize, false);
|
||||
};
|
||||
|
||||
const startResize = (ev) => {
|
||||
document.documentElement.addEventListener('mousemove', doResize, false);
|
||||
document.documentElement.addEventListener('mouseup', stopResize, false);
|
||||
document.documentElement.addEventListener("mousemove", doResize, false);
|
||||
document.documentElement.addEventListener("mouseup", stopResize, false);
|
||||
};
|
||||
|
||||
const App = () => {
|
||||
const closedNotification = { open: false, message: '' };
|
||||
const closedNotification = { open: false, message: "" };
|
||||
|
||||
const [tutorialComponent, setTutorialComponent] = useState(null);
|
||||
const [showFab, setShowFab] = useState(false);
|
||||
const [tutorialComplete, setTutorialComplete] = useState(false);
|
||||
const [status, setStatus] = useState({ active: false, message: '' });
|
||||
const [status, setStatus] = useState({ active: false, message: "" });
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [notification, setNotification] = useState(closedNotification);
|
||||
@@ -89,8 +104,8 @@ const App = () => {
|
||||
getUserUid();
|
||||
firebase
|
||||
.firestore()
|
||||
.collection('server')
|
||||
.doc('status')
|
||||
.collection("server")
|
||||
.doc("status")
|
||||
.onSnapshot((statusSnap) => {
|
||||
setStatus(statusSnap.data());
|
||||
setLoading(false);
|
||||
@@ -98,7 +113,9 @@ const App = () => {
|
||||
getShowWPButton().then((showWPButton) => {
|
||||
setShowFab(showWPButton);
|
||||
if (showWPButton === true) {
|
||||
document.querySelector('.watch-party-fab').classList.remove('watch-party-fab-hidden');
|
||||
document
|
||||
.querySelector(".watch-party-fab")
|
||||
.classList.remove("watch-party-fab-hidden");
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
@@ -106,40 +123,45 @@ const App = () => {
|
||||
getTutorialStatus().then((v) => setTutorialComplete(v));
|
||||
|
||||
// HANDLE VISIBILITY STYLING
|
||||
const PartyRoutesWrapper = document.getElementById('party-routes-wrapper');
|
||||
const PartyRoutesWrapper = document.getElementById("party-routes-wrapper");
|
||||
if (visible) {
|
||||
document.body.classList.add('visible');
|
||||
PartyRoutesWrapper && PartyRoutesWrapper.classList.add('visible');
|
||||
if (getPlayerSource() === PLAYER_SOURCE.HBOMAX || getPlayerSource() === PLAYER_SOURCE.HBONOW) {
|
||||
setTutorialComplete(true);
|
||||
if (!hasAttached) {
|
||||
document.addEventListener(
|
||||
'mousedown',
|
||||
function (ev) {
|
||||
if (document.body.querySelector('body.visible')) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
ev.stopImmediatePropagation();
|
||||
}
|
||||
},
|
||||
{ capture: true }
|
||||
);
|
||||
hasAttached = true;
|
||||
}
|
||||
document.body.classList.add("visible");
|
||||
PartyRoutesWrapper && PartyRoutesWrapper.classList.add("visible");
|
||||
if (
|
||||
getPlayerSource() === PLAYER_SOURCE.HBOMAX ||
|
||||
(getPlayerSource() === PLAYER_SOURCE.HBONOW && !hasAttached)
|
||||
) {
|
||||
document.addEventListener(
|
||||
"mousedown",
|
||||
function (ev) {
|
||||
if (document.body.querySelector("body.visible")) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
ev.stopImmediatePropagation();
|
||||
}
|
||||
},
|
||||
{ capture: true }
|
||||
);
|
||||
hasAttached = true;
|
||||
}
|
||||
if (getPlayerSource() === PLAYER_SOURCE.APPLE) {
|
||||
const appleTvPlayer = document.querySelector('apple-tv-plus-player');
|
||||
const takeoverContainer = appleTvPlayer.shadowRoot.querySelector('.takeover.container.show');
|
||||
if (takeoverContainer) takeoverContainer.style.maxWidth = 'var(--body-width)';
|
||||
const appleTvPlayer = document.querySelector("apple-tv-plus-player");
|
||||
const takeoverContainer = appleTvPlayer.shadowRoot.querySelector(
|
||||
".takeover.container.show"
|
||||
);
|
||||
if (takeoverContainer)
|
||||
takeoverContainer.style.maxWidth = "var(--body-width)";
|
||||
}
|
||||
} else {
|
||||
if (getPlayerSource() === PLAYER_SOURCE.APPLE) {
|
||||
const appleTvPlayer = document.querySelector('apple-tv-plus-player');
|
||||
const takeoverContainer = appleTvPlayer.shadowRoot.querySelector('.takeover.container.show');
|
||||
if (takeoverContainer) takeoverContainer.style.maxWidth = 'none';
|
||||
const appleTvPlayer = document.querySelector("apple-tv-plus-player");
|
||||
const takeoverContainer = appleTvPlayer.shadowRoot.querySelector(
|
||||
".takeover.container.show"
|
||||
);
|
||||
if (takeoverContainer) takeoverContainer.style.maxWidth = "none";
|
||||
}
|
||||
document.body.classList.remove('visible');
|
||||
PartyRoutesWrapper && PartyRoutesWrapper.classList.remove('visible');
|
||||
document.body.classList.remove("visible");
|
||||
PartyRoutesWrapper && PartyRoutesWrapper.classList.remove("visible");
|
||||
}
|
||||
|
||||
// HANDLE FULLSCREEN EVENT
|
||||
@@ -156,7 +178,7 @@ const App = () => {
|
||||
<ThemeProvider theme={darkTheme}>
|
||||
<Snackbar
|
||||
className="party-notification-container"
|
||||
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
|
||||
anchorOrigin={{ vertical: "bottom", horizontal: "right" }}
|
||||
open={notification.open}
|
||||
onClose={() => setNotification(closedNotification)}
|
||||
message={notification.message}
|
||||
@@ -176,12 +198,17 @@ const App = () => {
|
||||
title="Resize Sidebar / Double Click To Reset"
|
||||
aria-label="Resize Sidebar / Double Click To Reset"
|
||||
>
|
||||
<div onDoubleClick={resetResize} onMouseDown={startResize} id="party-width-dragger">
|
||||
<div
|
||||
onDoubleClick={resetResize}
|
||||
onMouseDown={startResize}
|
||||
id="party-width-dragger"
|
||||
>
|
||||
||
|
||||
</div>
|
||||
</Tooltip>
|
||||
{loading && <Loading />}
|
||||
{status[APP_VERSION_STRING] && status[APP_VERSION_STRING].active === true ? (
|
||||
{status[APP_VERSION_STRING] &&
|
||||
status[APP_VERSION_STRING].active === true ? (
|
||||
<Routes
|
||||
showFab={showFab}
|
||||
resetTutorial={resetTutorial}
|
||||
|
||||
Reference in New Issue
Block a user