fix(RemoteVideo): .oncanplay -> addEventListener
Replaces the .oncanplay listener with addEventListener('canplay', ...). This is needed because third party libraries (for example callstats) are brutally overriding the .oncanplay property and replacing our listener.
This commit is contained in:
parent
57bb2ead36
commit
851976ebdf
|
@ -456,14 +456,16 @@ export default class RemoteVideo extends SmallVideo {
|
|||
return;
|
||||
}
|
||||
|
||||
streamElement.oncanplay = () => {
|
||||
const listener = () => {
|
||||
this._canPlayEventReceived = true;
|
||||
this.VideoLayout.remoteVideoActive(streamElement, this.id);
|
||||
streamElement.oncanplay = undefined;
|
||||
streamElement.removeEventListener('canplay', listener);
|
||||
|
||||
// Refresh to show the video
|
||||
this.updateView();
|
||||
};
|
||||
|
||||
streamElement.addEventListener('canplay', listener);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue