v1.7.3/fix video, fix funimation

This commit is contained in:
2020-09-10 10:11:24 -04:00
parent 9d29fa6647
commit 1bd2a23a19
4 changed files with 7 additions and 7 deletions
Binary file not shown.
+3 -1
View File
@@ -26,7 +26,9 @@
"https://*.funimation.com/*", "https://*.funimation.com/*",
"https://*.roosterteeth.com/*", "https://*.roosterteeth.com/*",
"https://*.stan.com.au/*", "https://*.stan.com.au/*",
"https://api.giphy.com/*" "https://api.giphy.com/*",
"https://*.voxeet.com/*",
"wss://*.voxeet.com/*"
], ],
"content_scripts": [ "content_scripts": [
{ {
+3 -5
View File
@@ -191,7 +191,7 @@ export default class CallManager {
VoxeetSDK.conference.on('streamAdded', (participant, stream) => { VoxeetSDK.conference.on('streamAdded', (participant, stream) => {
this.listener({ callActionPending: true }); this.listener({ callActionPending: true });
const vid = 'video#' + participant.id; const vid = 'video#' + CSS.escape(participant.id);
if (!document.querySelector(vid)) { if (!document.querySelector(vid)) {
const vidNode = document.createElement('video'); const vidNode = document.createElement('video');
vidNode.id = participant.id; vidNode.id = participant.id;
@@ -205,8 +205,6 @@ export default class CallManager {
vidContainerNode.setAttribute('data-name', participant.info.name || ''); vidContainerNode.setAttribute('data-name', participant.info.name || '');
vidContainerNode.appendChild(vidNode); vidContainerNode.appendChild(vidNode);
console.log(participant);
if (participant.info.externalId !== LocalData().userUid) { if (participant.info.externalId !== LocalData().userUid) {
const volSliderNode = document.createElement('input'); const volSliderNode = document.createElement('input');
volSliderNode.setAttribute('type', 'range'); volSliderNode.setAttribute('type', 'range');
@@ -236,8 +234,8 @@ export default class CallManager {
}); });
VoxeetSDK.conference.on('streamRemoved', (participant, stream) => { VoxeetSDK.conference.on('streamRemoved', (participant, stream) => {
const vcid = ".vxt-video[data-id='" + participant.id + "']"; const vcid = ".vxt-video[data-id='" + CSS.escape(participant.id) + "']";
const vid = 'video#' + participant.id; const vid = 'video#' + CSS.escape(participant.id);
if (document.querySelector(vcid)) { if (document.querySelector(vcid)) {
document document
.querySelector(vid) .querySelector(vid)
+1 -1
View File
@@ -721,7 +721,7 @@ export default class VideoListener {
this.selectors[PLAYER_SOURCE.FUNIMATION] 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('${ }');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] 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] 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);`; }');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'); const funimationInjectScript = document.createElement('script');