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

Commit ea2f536

Browse files
committed
Revert "Allow video codec preference when publishing with RTCRtpEncodingParameters."
This reverts commit 64125ee.
1 parent 9580b1b commit ea2f536

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

src/sdk/base/publication.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,14 @@ export class PublishOptions {
185185
* @member {?Array<Owt.Base.AudioEncodingParameters> | ?Array<RTCRtpEncodingParameters>} audio
186186
* @instance
187187
* @memberof Owt.Base.PublishOptions
188-
* @desc Parameters for audio RtpSender. Publishing with RTCRtpEncodingParameters is an experimental feature. It is subject to change.
188+
* @desc Parameters for audio RtpSender.
189189
*/
190190
this.audio = audio;
191191
/**
192192
* @member {?Array<Owt.Base.VideoEncodingParameters> | ?Array<RTCRtpEncodingParameters>} video
193193
* @instance
194194
* @memberof Owt.Base.PublishOptions
195-
* @desc Parameters for video RtpSender. Publishing with RTCRtpEncodingParameters is an experimental feature. It is subject to change.
195+
* @desc Parameters for video RtpSender.
196196
*/
197197
this.video = video;
198198
/**

src/sdk/conference/channel.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
3535
super();
3636
this._config = config;
3737
this._options = null;
38-
this._videoCodecs = undefined;
3938
this._signaling = signaling;
4039
this._pc = null;
4140
this._internalId = null; // It's publication ID or subscription ID.
@@ -79,7 +78,7 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
7978
}
8079
}
8180

82-
publish(stream, options, videoCodecs) {
81+
publish(stream, options) {
8382
if (options === undefined) {
8483
options = {
8584
audio: !!stream.mediaStream.getAudioTracks().length,
@@ -230,7 +229,6 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
230229
};
231230
if (this._isRtpEncodingParameters(options.video)) {
232231
transceiverInit.sendEncodings = options.video;
233-
this._videoCodecs = videoCodecs;
234232
}
235233
const transceiver = this._pc.addTransceiver(
236234
stream.mediaStream.getVideoTracks()[0], transceiverInit);
@@ -745,18 +743,6 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
745743
}
746744

747745
_setRtpReceiverOptions(sdp, options) {
748-
// Add legacy simulcast in SDP for safari.
749-
if (this._isRtpEncodingParameters(options.video) && Utils.isSafari()) {
750-
if (options.video.length > 1) {
751-
sdp = SdpUtils.addLegacySimulcast(sdp, 'video', options.video.length);
752-
}
753-
}
754-
755-
// _videoCodecs is a workaround for setting video codecs. It will be moved to RTCRtpSendParameters.
756-
if (this._isRtpEncodingParameters(options.video) && this._videoCodecs) {
757-
sdp = SdpUtils.reorderCodecs(sdp, 'video', this._videoCodecs);
758-
return sdp;
759-
}
760746
if (this._isRtpEncodingParameters(options.audio) ||
761747
this._isRtpEncodingParameters(options.video)) {
762748
return sdp;

src/sdk/conference/client.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,9 @@ export const ConferenceClient = function(config, signalingImpl) {
408408
* @desc Publish a LocalStream to conference server. Other participants will be able to subscribe this stream when it is successfully published.
409409
* @param {Owt.Base.LocalStream} stream The stream to be published.
410410
* @param {Owt.Base.PublishOptions} options Options for publication.
411-
* @param {string[]} videoCodecs Video codec names for publishing. Valid values are 'VP8', 'VP9' and 'H264'. This parameter only valid when options.video is RTCRtpEncodingParameters. Publishing with RTCRtpEncodingParameters is an experimental feature. This parameter is subject to change.
412411
* @return {Promise<Publication, Error>} Returned promise will be resolved with a newly created Publication once specific stream is successfully published, or rejected with a newly created Error if stream is invalid or options cannot be satisfied. Successfully published means PeerConnection is established and server is able to process media data.
413412
*/
414-
this.publish = function(stream, options, videoCodecs) {
413+
this.publish = function(stream, options) {
415414
if (!(stream instanceof StreamModule.LocalStream)) {
416415
return Promise.reject(new ConferenceError('Invalid stream.'));
417416
}
@@ -420,7 +419,7 @@ export const ConferenceClient = function(config, signalingImpl) {
420419
'Cannot publish a published stream.'));
421420
}
422421
const channel = createPeerConnectionChannel();
423-
return channel.publish(stream, options, videoCodecs);
422+
return channel.publish(stream, options);
424423
};
425424

426425
/**

0 commit comments

Comments
 (0)