Fixes JS errors on Temasys
This commit is contained in:
parent
73232be8be
commit
ac88c5cedc
|
@ -1397,7 +1397,7 @@ JitsiLocalTrack.prototype.stop = function () {
|
|||
if(!this.stream)
|
||||
return;
|
||||
if(this.rtc)
|
||||
this.rtc.room.removeStream(this.stream);
|
||||
this.rtc.room.removeStream(this.stream, function () {});
|
||||
RTC.stopMediaStream(this.stream);
|
||||
this.detach();
|
||||
}
|
||||
|
@ -1547,9 +1547,18 @@ function implementOnEndedHandling(jitsiTrack) {
|
|||
function addMediaStreamInactiveHandler(mediaStream, handler) {
|
||||
if(RTCBrowserType.isTemasysPluginUsed()) {
|
||||
// themasys
|
||||
mediaStream.attachEvent('ended', function () {
|
||||
handler(mediaStream);
|
||||
});
|
||||
//FIXME: Seems that not working properly.
|
||||
if(mediaStream.onended) {
|
||||
mediaStream.onended = handler;
|
||||
} else if(mediaStream.addEventListener) {
|
||||
mediaStream.addEventListener('ended', function () {
|
||||
handler(mediaStream);
|
||||
});
|
||||
} else if(mediaStream.attachEvent) {
|
||||
mediaStream.attachEvent('ended', function () {
|
||||
handler(mediaStream);
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(typeof mediaStream.active !== "undefined")
|
||||
|
|
|
@ -112,7 +112,7 @@ JitsiLocalTrack.prototype.stop = function () {
|
|||
if(!this.stream)
|
||||
return;
|
||||
if(this.rtc)
|
||||
this.rtc.room.removeStream(this.stream);
|
||||
this.rtc.room.removeStream(this.stream, function () {});
|
||||
RTC.stopMediaStream(this.stream);
|
||||
this.detach();
|
||||
}
|
||||
|
|
|
@ -27,9 +27,18 @@ function implementOnEndedHandling(jitsiTrack) {
|
|||
function addMediaStreamInactiveHandler(mediaStream, handler) {
|
||||
if(RTCBrowserType.isTemasysPluginUsed()) {
|
||||
// themasys
|
||||
mediaStream.attachEvent('ended', function () {
|
||||
handler(mediaStream);
|
||||
});
|
||||
//FIXME: Seems that not working properly.
|
||||
if(mediaStream.onended) {
|
||||
mediaStream.onended = handler;
|
||||
} else if(mediaStream.addEventListener) {
|
||||
mediaStream.addEventListener('ended', function () {
|
||||
handler(mediaStream);
|
||||
});
|
||||
} else if(mediaStream.attachEvent) {
|
||||
mediaStream.attachEvent('ended', function () {
|
||||
handler(mediaStream);
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(typeof mediaStream.active !== "undefined")
|
||||
|
|
Loading…
Reference in New Issue