openvidu-browser BUG FIX: own remote subscription could launch streamPlaying event twice

pull/88/merge
pabloFuente 2018-07-04 10:31:36 +02:00
parent 7dac3e8378
commit c97a29fd50
1 changed files with 4 additions and 3 deletions

View File

@ -230,8 +230,6 @@ export class StreamManager implements EventDispatcher {
let returnNumber = 1;
this.initializeVideoProperties(video);
for (const streamManager of this.stream.session.streamManagers) {
if (streamManager.disassociateVideo(video)) {
returnNumber = -1;
@ -321,7 +319,10 @@ export class StreamManager implements EventDispatcher {
* @hidden
*/
initializeVideoProperties(video: HTMLVideoElement): void {
video.srcObject = this.stream.getMediaStream();
if (!(this.stream.isLocal() && this.stream.displayMyRemote())) {
// Avoid setting the MediaStream into the srcObject if remote subscription before publishing
video.srcObject = this.stream.getMediaStream();
}
video.autoplay = true;
video.controls = false;
if (!video.id) {