v1.7.3/fix video, fix funimation
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user