diff --git a/app/WatchParty_Source.zip b/app/WatchParty_Source.zip deleted file mode 100644 index 159d70a..0000000 Binary files a/app/WatchParty_Source.zip and /dev/null differ diff --git a/app/public/manifest.json b/app/public/manifest.json index 8557668..b6e1d32 100644 --- a/app/public/manifest.json +++ b/app/public/manifest.json @@ -26,7 +26,9 @@ "https://*.funimation.com/*", "https://*.roosterteeth.com/*", "https://*.stan.com.au/*", - "https://api.giphy.com/*" + "https://api.giphy.com/*", + "https://*.voxeet.com/*", + "wss://*.voxeet.com/*" ], "content_scripts": [ { diff --git a/app/src/CallManager.js b/app/src/CallManager.js index 45d7a49..d98193a 100644 --- a/app/src/CallManager.js +++ b/app/src/CallManager.js @@ -191,7 +191,7 @@ export default class CallManager { VoxeetSDK.conference.on('streamAdded', (participant, stream) => { this.listener({ callActionPending: true }); - const vid = 'video#' + participant.id; + const vid = 'video#' + CSS.escape(participant.id); if (!document.querySelector(vid)) { const vidNode = document.createElement('video'); vidNode.id = participant.id; @@ -205,8 +205,6 @@ export default class CallManager { vidContainerNode.setAttribute('data-name', participant.info.name || ''); vidContainerNode.appendChild(vidNode); - console.log(participant); - if (participant.info.externalId !== LocalData().userUid) { const volSliderNode = document.createElement('input'); volSliderNode.setAttribute('type', 'range'); @@ -236,8 +234,8 @@ export default class CallManager { }); VoxeetSDK.conference.on('streamRemoved', (participant, stream) => { - const vcid = ".vxt-video[data-id='" + participant.id + "']"; - const vid = 'video#' + participant.id; + const vcid = ".vxt-video[data-id='" + CSS.escape(participant.id) + "']"; + const vid = 'video#' + CSS.escape(participant.id); if (document.querySelector(vcid)) { document .querySelector(vid) diff --git a/app/src/VideoListener.js b/app/src/VideoListener.js index c5e0cb8..d0274a1 100644 --- a/app/src/VideoListener.js +++ b/app/src/VideoListener.js @@ -721,7 +721,7 @@ export default class VideoListener { this.selectors[PLAYER_SOURCE.FUNIMATION] }');if(playerIframe){const player=playerIframe.contentWindow.document.querySelector('video');if(player){sendToWatchPartyApp(pS,player.currentTime)}}},watchPartySendPlaying=function(){watchPartyGetTimeAndSend('PLAYING')},watchPartySendPaused=function(){watchPartyGetTimeAndSend('PAUSED')},watchPartyAddListeners=function(){const playerIframe=document.querySelector('${ this.selectors[PLAYER_SOURCE.FUNIMATION] - }');if(playerIframe){const player=playerIframe.contentWindow.document.querySelector('video');if(player && player.currentTime > 0 && player.paused === false && player.ended === false){player.addEventListener('playing',watchPartySendPlaying);player.addEventListener('pause',watchPartySendPaused);clearInterval(watchPartyAddListeners)}}},watchPartyInteraction=function(e){const data=JSON.parse(e.data);const playerIframe=document.querySelector('${ + }');if(playerIframe){const player=playerIframe.contentWindow.document.querySelector('video');if(player&&player.currentTime>0&&player.paused===false&&player.ended===false){player.parentNode.player.on('playing',watchPartySendPlaying);player.parentNode.player.on('pause',watchPartySendPaused);clearInterval(watchPartyAddListeners)}}},watchPartyInteraction=function(e){const data=JSON.parse(e.data);const playerIframe=document.querySelector('${ this.selectors[PLAYER_SOURCE.FUNIMATION] }');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=playerIframe.contentWindow.document.querySelector('#brightcove-player');if(playerNode){playerNode.player.currentTime(data.time)}}else if(data.type==='WATCH_PARTY_STATUS'){if(data.status==='PAUSED')player.pause();if(data.status==='PLAYING')player.play()}}}else{setInterval(watchPartyAddListeners,1000)}}else{setInterval(watchPartyAddListeners,1000)}};window.addEventListener("message",watchPartyInteraction);`; const funimationInjectScript = document.createElement('script');