Fix force codec H264 not working using openvidu-node-client

pull/656/head
cruizba 2021-09-24 19:58:56 +02:00
parent 5ee08a2d62
commit 0079231967
3 changed files with 18 additions and 14 deletions

View File

@ -120,7 +120,8 @@ public class SessionProperties {
* the specified codec and {@link #allowTranscoding(Boolean)} is * the specified codec and {@link #allowTranscoding(Boolean)} is
* <code>false</code> and exception will occur. If forcedVideoCodec is set to * <code>false</code> and exception will occur. If forcedVideoCodec is set to
* NONE, no codec will be forced.<br> * NONE, no codec will be forced.<br>
* Default value is {@link VideoCodec#VP8} * If defined here, this parameter has prevalence over OPENVIDU_STREAMS_FORCED_VIDEO_CODEC.
* OPENVIDU_STREAMS_FORCED_VIDEO_CODEC default is {@link VideoCodec#VP8}
*/ */
public SessionProperties.Builder forcedVideoCodec(VideoCodec forcedVideoCodec) { public SessionProperties.Builder forcedVideoCodec(VideoCodec forcedVideoCodec) {
this.forcedVideoCodec = forcedVideoCodec; this.forcedVideoCodec = forcedVideoCodec;
@ -131,7 +132,8 @@ public class SessionProperties {
* Call this method to define if you want to allow transcoding in the media * Call this method to define if you want to allow transcoding in the media
* server or not when {@link #forcedVideoCodec(VideoCodec)} is not compatible * server or not when {@link #forcedVideoCodec(VideoCodec)} is not compatible
* with the browser/client.<br> * with the browser/client.<br>
* Default value is false * If defined here, this parameter has prevalence over OPENVIDU_STREAMS_ALLOW_TRANSCODING.
* OPENVIDU_STREAMS_ALLOW_TRANSCODING default is 'false'
*/ */
public SessionProperties.Builder allowTranscoding(Boolean allowTranscoding) { public SessionProperties.Builder allowTranscoding(Boolean allowTranscoding) {
this.allowTranscoding = allowTranscoding; this.allowTranscoding = allowTranscoding;
@ -247,4 +249,4 @@ public class SessionProperties {
return json; return json;
} }
} }

View File

@ -656,8 +656,8 @@ export class Session {
props.recordingMode = (props.recordingMode != null) ? props.recordingMode : RecordingMode.MANUAL; props.recordingMode = (props.recordingMode != null) ? props.recordingMode : RecordingMode.MANUAL;
props.customSessionId = (props.customSessionId != null) ? props.customSessionId : ''; props.customSessionId = (props.customSessionId != null) ? props.customSessionId : '';
props.mediaNode = (props.mediaNode != null) ? props.mediaNode : undefined; props.mediaNode = (props.mediaNode != null) ? props.mediaNode : undefined;
props.forcedVideoCodec = (props.forcedVideoCodec != null) ? props.forcedVideoCodec : VideoCodec.VP8; props.forcedVideoCodec = props.forcedVideoCodec;
props.allowTranscoding = (props.allowTranscoding != null) ? props.allowTranscoding : false; props.allowTranscoding = props.allowTranscoding;
if (!props.defaultRecordingProperties) { if (!props.defaultRecordingProperties) {
props.defaultRecordingProperties = {}; props.defaultRecordingProperties = {};
@ -695,4 +695,4 @@ export class Session {
} }
} }
} }

View File

@ -28,14 +28,14 @@ export interface SessionProperties {
/** /**
* How the media streams will be sent and received by your clients: routed through OpenVidu Media Node * How the media streams will be sent and received by your clients: routed through OpenVidu Media Node
* (`MediaMode.ROUTED`) or attempting direct p2p connections (`MediaMode.RELAYED`, _not available yet_) * (`MediaMode.ROUTED`) or attempting direct p2p connections (`MediaMode.RELAYED`, _not available yet_)
* *
* Default to [[MediaMode.ROUTED]] * Default to [[MediaMode.ROUTED]]
*/ */
mediaMode?: MediaMode; mediaMode?: MediaMode;
/** /**
* Whether the Session will be automatically recorded (`RecordingMode.ALWAYS`) or not (`RecordingMode.MANUAL`) * Whether the Session will be automatically recorded (`RecordingMode.ALWAYS`) or not (`RecordingMode.MANUAL`)
* *
* Default to [[RecordingMode.MANUAL]] * Default to [[RecordingMode.MANUAL]]
*/ */
recordingMode?: RecordingMode; recordingMode?: RecordingMode;
@ -43,7 +43,7 @@ export interface SessionProperties {
/** /**
* Default recording properties of this session. You can easily override this value later when starting a * Default recording properties of this session. You can easily override this value later when starting a
* [[Recording]] by providing new [[RecordingProperties]] * [[Recording]] by providing new [[RecordingProperties]]
* *
* Default values defined in [[RecordingProperties]] class * Default values defined in [[RecordingProperties]] class
*/ */
defaultRecordingProperties?: RecordingProperties; defaultRecordingProperties?: RecordingProperties;
@ -57,7 +57,7 @@ export interface SessionProperties {
/** /**
* **This feature is part of OpenVidu Pro tier** <a href="https://docs.openvidu.io/en/stable/openvidu-pro/" target="_blank" style="display: inline-block; background-color: rgb(0, 136, 170); color: white; font-weight: bold; padding: 0px 5px; margin-right: 5px; border-radius: 3px; font-size: 13px; line-height:21px; font-family: Montserrat, sans-serif">PRO</a> * **This feature is part of OpenVidu Pro tier** <a href="https://docs.openvidu.io/en/stable/openvidu-pro/" target="_blank" style="display: inline-block; background-color: rgb(0, 136, 170); color: white; font-weight: bold; padding: 0px 5px; margin-right: 5px; border-radius: 3px; font-size: 13px; line-height:21px; font-family: Montserrat, sans-serif">PRO</a>
* *
* The Media Node where to host the session. The default option if this property is not defined is the less loaded * The Media Node where to host the session. The default option if this property is not defined is the less loaded
* Media Node at the moment the first user joins the session. This object defines the following properties as Media Node selector: * Media Node at the moment the first user joins the session. This object defines the following properties as Media Node selector:
* - `id`: Media Node unique identifier * - `id`: Media Node unique identifier
@ -71,16 +71,18 @@ export interface SessionProperties {
* This allows browsers/clients to use the same codec avoiding transcoding in the media server. * This allows browsers/clients to use the same codec avoiding transcoding in the media server.
* If the browser/client is not compatible with the specified codec and [[allowTranscoding]] is <code>false</code> * If the browser/client is not compatible with the specified codec and [[allowTranscoding]] is <code>false</code>
* and exception will occur. If forcedVideoCodec is set to [[VideoCodec.NONE]], no codec will be forced. * and exception will occur. If forcedVideoCodec is set to [[VideoCodec.NONE]], no codec will be forced.
* *
* Default to [[VideoCodec.VP8]] * If defined here, this parameter has prevalence over OPENVIDU_STREAMS_FORCED_VIDEO_CODEC.
* OPENVIDU_STREAMS_FORCED_VIDEO_CODEC default is [[VideoCodec.VP8]]
*/ */
forcedVideoCodec?: VideoCodec; forcedVideoCodec?: VideoCodec;
/** /**
* It defines if you want to allow transcoding in the media server or not * It defines if you want to allow transcoding in the media server or not
* when [[forcedVideoCodec]] is not compatible with the browser/client. * when [[forcedVideoCodec]] is not compatible with the browser/client.
* *
* Default to false * If defined here, this parameter has prevalence over OPENVIDU_STREAMS_ALLOW_TRANSCODING.
* OPENVIDU_STREAMS_ALLOW_TRANSCODING default is 'false'
*/ */
allowTranscoding?: boolean; allowTranscoding?: boolean;