openvidu-browser: IE final fixes

pull/255/head
pabloFuente 2019-05-20 11:40:58 +02:00
parent b70581addc
commit 227eefd99b
2 changed files with 12 additions and 4 deletions

View File

@ -814,9 +814,6 @@ export class OpenVidu {
width: simVideo.videoWidth, width: simVideo.videoWidth,
height: simVideo.videoHeight height: simVideo.videoHeight
}; };
// TODO: if screen-share, set this.screenShareResizeInterval
str.isLocalStreamReadyToPublish = true; str.isLocalStreamReadyToPublish = true;
str.ee.emitEvent('stream-ready-to-publish', []); str.ee.emitEvent('stream-ready-to-publish', []);
}; };

View File

@ -427,7 +427,14 @@ export class StreamManager implements EventDispatcher {
*/ */
addPlayEventToFirstVideo() { addPlayEventToFirstVideo() {
if ((!!this.videos[0]) && (!!this.videos[0].video) && (this.videos[0].video.oncanplay === null)) { if ((!!this.videos[0]) && (!!this.videos[0].video) && (this.videos[0].video.oncanplay === null)) {
this.videos[0].video.addEventListener('canplay', platform['isInternetExplorer'] ? (<any>window).IEOnCanPlay(this) : this.canPlayListener); if (platform['isInternetExplorer']) {
if (!(this.videos[0].video instanceof HTMLVideoElement)) {
// Add canplay event listener only after plugin has inserted custom video element (not a DOM HTMLVideoElement)
(<any>this.videos[0].video).addEventListener('canplay', (<any>window).IEOnCanPlay(this));
}
} else {
this.videos[0].video.addEventListener('canplay', this.canPlayListener);
}
} }
} }
@ -497,6 +504,10 @@ export class StreamManager implements EventDispatcher {
// Always launch videoElementCreated event after IE plugin has inserted simulated video into DOM // Always launch videoElementCreated event after IE plugin has inserted simulated video into DOM
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent(simVideo, this, 'videoElementCreated')]); this.ee.emitEvent('videoElementCreated', [new VideoElementEvent(simVideo, this, 'videoElementCreated')]);
// Add streamPlaying event to newly inserted video if necessary
this.addPlayEventToFirstVideo();
return simVideo; return simVideo;
} }