Fix addVideo() issue due to adapter.js
parent
267ebb320a
commit
ae24aa4b09
|
|
@ -132,10 +132,8 @@ export default class Client extends events.EventEmitter
|
||||||
return Promise.reject(new Error('no video track'));
|
return Promise.reject(new Error('no video track'));
|
||||||
}
|
}
|
||||||
|
|
||||||
stream.removeTrack(videoTrack);
|
|
||||||
videoTrack.stop();
|
videoTrack.stop();
|
||||||
|
|
||||||
// NOTE: For Firefox (modern WenRTC API).
|
|
||||||
if (this._peerconnection.removeTrack)
|
if (this._peerconnection.removeTrack)
|
||||||
{
|
{
|
||||||
let sender;
|
let sender;
|
||||||
|
|
@ -148,6 +146,10 @@ export default class Client extends events.EventEmitter
|
||||||
|
|
||||||
this._peerconnection.removeTrack(sender);
|
this._peerconnection.removeTrack(sender);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stream.removeTrack(videoTrack);
|
||||||
|
}
|
||||||
|
|
||||||
if (!dontNegotiate)
|
if (!dontNegotiate)
|
||||||
{
|
{
|
||||||
|
|
@ -185,11 +187,14 @@ export default class Client extends events.EventEmitter
|
||||||
|
|
||||||
if (stream)
|
if (stream)
|
||||||
{
|
{
|
||||||
|
// Fucking hack for adapter.js in Chrome.
|
||||||
|
if (this._peerconnection.removeStream)
|
||||||
|
this._peerconnection.removeStream(stream);
|
||||||
|
|
||||||
stream.addTrack(newVideoTrack);
|
stream.addTrack(newVideoTrack);
|
||||||
|
|
||||||
// NOTE: For Firefox (modern WenRTC API).
|
|
||||||
if (this._peerconnection.addTrack)
|
if (this._peerconnection.addTrack)
|
||||||
this._peerconnection.addTrack(newVideoTrack, this._localStream);
|
this._peerconnection.addTrack(newVideoTrack, stream);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,24 +14,21 @@ import edgeRTCPeerConnection from './edge/RTCPeerConnection';
|
||||||
import edgeRTCSessionDescription from './edge/RTCSessionDescription';
|
import edgeRTCSessionDescription from './edge/RTCSessionDescription';
|
||||||
import App from './components/App';
|
import App from './components/App';
|
||||||
|
|
||||||
// TODO: TMP
|
|
||||||
global.BROWSER = browser;
|
|
||||||
|
|
||||||
const REGEXP_FRAGMENT_ROOM_ID = new RegExp('^#room-id=([0-9a-zA-Z_\-]+)$');
|
const REGEXP_FRAGMENT_ROOM_ID = new RegExp('^#room-id=([0-9a-zA-Z_\-]+)$');
|
||||||
const logger = new Logger();
|
const logger = new Logger();
|
||||||
|
|
||||||
logger.warn('detected browser [name:"%s", version:%s]', browser.name, browser.version);
|
injectTapEventPlugin();
|
||||||
|
|
||||||
|
logger.debug('detected browser [name:"%s", version:%s]', browser.name, browser.version);
|
||||||
|
|
||||||
if (browser.msedge)
|
if (browser.msedge)
|
||||||
{
|
{
|
||||||
logger.warn('EDGE detected, overriding WebRTC global classes');
|
logger.debug('EDGE detected, overriding WebRTC global classes');
|
||||||
|
|
||||||
window.RTCPeerConnection = edgeRTCPeerConnection;
|
window.RTCPeerConnection = edgeRTCPeerConnection;
|
||||||
window.RTCSessionDescription = edgeRTCSessionDescription;
|
window.RTCSessionDescription = edgeRTCSessionDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
injectTapEventPlugin();
|
|
||||||
|
|
||||||
domready(() =>
|
domready(() =>
|
||||||
{
|
{
|
||||||
logger.debug('DOM ready');
|
logger.debug('DOM ready');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue