Skip to content

Commit

Permalink
fix(TPC): replace isFirefox with feature
Browse files Browse the repository at this point in the history
  • Loading branch information
paweldomas committed Feb 27, 2017
1 parent a424955 commit 6981601
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
11 changes: 11 additions & 0 deletions modules/RTC/RTCBrowserType.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ var RTCBrowserType = {

RTC_BROWSER_REACT_NATIVE: "rtc_browser.react-native",

/**
* Tells whether or not the <tt>MediaStream/tt> is removed from
* the <tt>PeerConnection</tt> and disposed on video mute (in order to turn
* off the camera device).
* @return {boolean} <tt>true</tt> if the current browser supports this
* strategy or <tt>false</tt> otherwise.
*/
doesVideoMuteByStreamRemove: function () {
return !RTCBrowserType.isFirefox();
},

/**
* Gets current browser type.
* @returns {string}
Expand Down
5 changes: 2 additions & 3 deletions modules/RTC/TraceablePeerConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -941,12 +941,11 @@ var getters = {
dumpSDP(desc));
}

// FIXME replace with a feature
if (!RTCBrowserType.isFirefox()) {
if (RTCBrowserType.doesVideoMuteByStreamRemove()) {
this.mungeLocalSdp.maybeMungeLocalSdp(desc);
logger.debug(
'getLocalDescription::postTransform '
+ '(local video mute hack)', desc);
+ '(munge local SDP)', desc);
}

return desc ? desc : {};
Expand Down

0 comments on commit 6981601

Please sign in to comment.