Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 1f6485a

Browse files
authored
Merge pull request #347 from jianjunz/merge-to-4.3.x
Pick a few commits to 4.3.x.
2 parents 4dcdd53 + 3e99197 commit 1f6485a

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

src/sdk/base/mediastream-factory.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,6 @@ export class MediaStreamFactory {
150150
return Promise.reject(
151151
new TypeError('Cannot share screen without video.'));
152152
}
153-
if (isVideoConstrainsForScreenCast(constraints) && !utils.isChrome() &&
154-
!utils.isFirefox()) {
155-
return Promise.reject(
156-
new TypeError('Screen sharing only supports Chrome and Firefox.'));
157-
}
158153
if (isVideoConstrainsForScreenCast(constraints) &&
159154
typeof constraints.audio === 'object' &&
160155
constraints.audio.source !==

src/sdk/conference/streamutils.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,29 @@ export function convertToSubscriptionCapabilities(mediaInfo) {
117117
}
118118
}
119119
videoCodecs.sort();
120-
const resolutions = Array.from(
120+
if (mediaInfo.video && mediaInfo.video.optional && mediaInfo.video.optional
121+
.parameters) {
122+
const resolutions = Array.from(
121123
mediaInfo.video.optional.parameters.resolution,
122124
(r) => new MediaFormatModule.Resolution(r.width, r.height));
123-
resolutions.sort(sortResolutions);
124-
const bitrates = Array.from(
125+
resolutions.sort(sortResolutions);
126+
const bitrates = Array.from(
125127
mediaInfo.video.optional.parameters.bitrate,
126128
(bitrate) => extractBitrateMultiplier(bitrate));
127-
bitrates.push(1.0);
128-
bitrates.sort(sortNumbers);
129-
const frameRates = JSON.parse(
129+
bitrates.push(1.0);
130+
bitrates.sort(sortNumbers);
131+
const frameRates = JSON.parse(
130132
JSON.stringify(mediaInfo.video.optional.parameters.framerate));
131-
frameRates.sort(sortNumbers);
132-
const keyFrameIntervals = JSON.parse(
133+
frameRates.sort(sortNumbers);
134+
const keyFrameIntervals = JSON.parse(
133135
JSON.stringify(mediaInfo.video.optional.parameters.keyFrameInterval));
134-
keyFrameIntervals.sort(sortNumbers);
135-
video = new SubscriptionModule.VideoSubscriptionCapabilities(
136+
keyFrameIntervals.sort(sortNumbers);
137+
video = new SubscriptionModule.VideoSubscriptionCapabilities(
136138
videoCodecs, resolutions, frameRates, bitrates, keyFrameIntervals);
139+
} else {
140+
video = new SubscriptionModule.VideoSubscriptionCapabilities(videoCodecs,
141+
[], [], [1.0], []);
142+
}
137143
}
138144
return new SubscriptionModule.SubscriptionCapabilities(audio, video);
139145
}

src/sdk/p2p/peerconnection-channel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ class P2PPeerConnectionChannel extends EventDispatcher {
661661
this._pc.addTransceiver('audio');
662662
this._pc.addTransceiver('video');
663663
}
664-
if (!this._isUnifiedPlan()) {
664+
if (!this._isUnifiedPlan() && !Utils.isSafari()) {
665665
this._pc.onaddstream = (event) => {
666666
// TODO: Legacy API, should be removed when all UAs implemented WebRTC 1.0.
667667
this._onRemoteStreamAdded.apply(this, [event]);

0 commit comments

Comments
 (0)