Permalink
Browse files

Merge pull request #49 from skyway/release/v1.1.4

Release/v1.1.4
  • Loading branch information...
iwashi committed Jan 31, 2018
2 parents f2abe42 + 049763c commit 6349aec0ea23262eded4a34b34b48514ccf6197b
Showing with 20 additions and 6 deletions.
  1. +3 −0 .eslintrc.js
  2. +6 −0 CHANGELOG.md
  3. +1 −1 package.json
  4. +9 −5 src/peer/negotiator.js
  5. +1 −0 tests/peer/negotiator.js
@@ -27,4 +27,7 @@ module.exports = {
es6: true,
mocha: true,
},
globals: {
RTCRtpSender: true,
},
};
@@ -1,5 +1,11 @@
# Changelog

## [v1.1.4](https://github.com/skyway/skyway-js-sdk/releases/tag/v1.1.4) - 2018-01-30

### Fixed

- Fixed a bug that replaceStream does not work correctly on Google Chrome 64.

## [v1.1.3](https://github.com/skyway/skyway-js-sdk/releases/tag/v1.1.3) - 2017-12-11

### Fixed
@@ -1,6 +1,6 @@
{
"name": "skyway-js",
"version": "1.1.3",
"version": "1.1.4",
"description": "The official JavaScript SDK for SkyWay",
"main": "dist/skyway.js",
"module": "src/peer.js",
@@ -64,7 +64,9 @@ class Negotiator extends EventEmitter {

if (this._type === 'media') {
if (options.stream) {
if (this._isAddTrackAvailable) {
// To check Chrome M64 or not. This is a tentative fix.
// M65 should be handled soon because it implements replaceTrack.
if (this._isAddTrackAvailable && this._isReplaceTrackAvailable) {
options.stream.getTracks().forEach(track => {
this._pc.addTrack(track, options.stream);
});
@@ -106,7 +108,7 @@ class Negotiator extends EventEmitter {
// This doesn't require renegotiation.
// Firefox 53 has both getSenders and getLocalStreams,
// but Google Chrome 61 has only getLocalStreams.
if (this._isRtpSenderAvailable) {
if (this._isRtpSenderAvailable && this._isReplaceTrackAvailable) {
this._replacePerTrack(newStream);
} else {
this._replacePerStream(newStream);
@@ -195,8 +197,8 @@ class Negotiator extends EventEmitter {
this._isOnTrackAvailable = 'ontrack' in RTCPeerConnection.prototype;
this._isRtpSenderAvailable =
typeof RTCPeerConnection.prototype.getSenders === 'function';
this._isRtpLocalStreamsAvailable =
typeof RTCPeerConnection.prototype.getLocalStreams === 'function';
this._isReplaceTrackAvailable =
typeof RTCRtpSender.prototype.replaceTrack === 'function';
this._isAddTransceiverAvailable =
typeof RTCPeerConnection.prototype.addTransceiver === 'function';

@@ -211,7 +213,9 @@ class Negotiator extends EventEmitter {
*/
_setupPCListeners() {
const pc = this._pc;
if (this._isOnTrackAvailable) {
// To check Chrome M64 or not. This is a tentative fix.
// M65 should be handled soon because it implements replaceTrack.
if (this._isOnTrackAvailable && this._isReplaceTrackAvailable) {
pc.ontrack = evt => {
logger.log('Received remote media stream');
evt.streams.forEach(stream => {
@@ -311,6 +311,7 @@ describe('Negotiator', () => {
negotiator._pc.removeTrack = removeTrackStub;
negotiator._pc.onnegotiationneeded = negotiationNeededStub;
negotiator._isRtpSenderAvailable = true;
negotiator._isReplaceTrackAvailable = true;

audioSender = {
track: {

0 comments on commit 6349aec

Please sign in to comment.