Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@webex/media-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"deploy:npm": "yarn npm publish"
},
"dependencies": {
"@webex/internal-media-core": "2.18.5",
"@webex/internal-media-core": "link:../../../../webrtc-media-core",
"@webex/ts-events": "^1.1.0",
"@webex/web-media-effects": "2.27.1"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/@webex/plugin-meetings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,12 @@
"jsdom-global": "3.0.2",
"prettier": "^2.7.1",
"sinon": "^9.2.4",
"typed-emitter": "^2.1.0",
"typescript": "^4.7.4"
},
"dependencies": {
"@webex/common": "workspace:*",
"@webex/event-dictionary-ts": "^1.0.1819",
"@webex/internal-media-core": "2.18.5",
"@webex/internal-media-core": "link:../../../../webrtc-media-core",
"@webex/internal-plugin-conversation": "workspace:*",
"@webex/internal-plugin-device": "workspace:*",
"@webex/internal-plugin-llm": "workspace:*",
Expand All @@ -86,6 +85,7 @@
"javascript-state-machine": "^3.1.0",
"jwt-decode": "3.1.2",
"lodash": "^4.17.21",
"typed-emitter": "^2.1.0",
"uuid": "^3.3.2",
"webrtc-adapter": "^8.1.2"
},
Expand Down
1 change: 1 addition & 0 deletions packages/@webex/plugin-meetings/src/media/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ Media.createMediaConnection = (
iceServers,
iceCandidatesTimeout,
skipInactiveTransceivers: false,
// TODO: Should we require H264 when AV1 is supported?
requireH264: true,
sdpMunging: {
convertPort9to0: false,
Expand Down
15 changes: 8 additions & 7 deletions packages/@webex/plugin-meetings/src/meeting/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,13 @@ export type LocalStreams = {
};
};

export type AdditionalMediaOptions = {
sendVideo?: boolean; // if not specified, default value of videoEnabled is used
receiveVideo?: boolean; // if not specified, default value of videoEnabled is used
sendAudio?: boolean; // if not specified, default value of audioEnabled true is used
receiveAudio?: boolean; // if not specified, default value of audioEnabled true is used
};

export type AddMediaOptions = {
localStreams?: LocalStreams;
audioEnabled?: boolean; // if not specified, default value true is used
Expand All @@ -237,13 +244,6 @@ export type AddMediaOptions = {
additionalMediaOptions?: AdditionalMediaOptions; // allows adding additional options like send/receive audio/video
};

export type AdditionalMediaOptions = {
sendVideo?: boolean; // if not specified, default value of videoEnabled is used
receiveVideo?: boolean; // if not specified, default value of videoEnabled is used
sendAudio?: boolean; // if not specified, default value of audioEnabled true is used
receiveAudio?: boolean; // if not specified, default value of audioEnabled true is used
};

export type CallStateForMetrics = {
correlationId?: string;
sessionCorrelationId?: string;
Expand Down Expand Up @@ -7330,6 +7330,7 @@ export default class Meeting extends StatelessWebexPlugin {
this.statsAnalyzer = new StatsAnalyzer({
// @ts-ignore - config coming from registerPlugin
config: this.config.stats,
// @ts-ignore
networkQualityMonitor: this.networkQualityMonitor,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: fix this in this PR

isMultistream: this.isMultistream,
});
Expand Down
34 changes: 14 additions & 20 deletions packages/@webex/plugin-meetings/src/meetings/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* globals window */

import {Media} from '@webex/internal-media-core';
import {
_CREATED_,
_INCOMING_,
Expand Down Expand Up @@ -157,24 +158,18 @@ MeetingsUtil.parseDefaultSiteFromMeetingPreferences = (userPreferences) => {
* @private
* @returns {Promise<boolean>}
*/
MeetingsUtil.hasH264Codec = async () => {
let hasCodec = false;

try {
const pc = new window.RTCPeerConnection();
const offer = await pc.createOffer({offerToReceiveVideo: true});

if (offer.sdp.match(/^a=rtpmap:\d+\s+H264\/\d+/m)) {
hasCodec = true;
}
pc.close();
} catch (error) {
LoggerProxy.logger.warn(
'Meetings:util#hasH264Codec --> Error creating peerConnection for H.264 test.'
);
}
MeetingsUtil.isH264CodecAvailable = async () => {
return Media.isH264CodecAvailable();
};

return hasCodec;
/**
* Will check to see if the AV1 media codec is supported.
* @async
* @private
* @returns {Promise<boolean>}
*/
MeetingsUtil.isAV1CodecAvailable = async () => {
return Media.isAV1CodecAvailable();
};

/**
Expand All @@ -192,7 +187,6 @@ MeetingsUtil.checkH264Support = async function checkH264Support(options: {
firstChecked: number;
disableNotifications: boolean;
}) {
const {hasH264Codec} = MeetingsUtil;
const {firstChecked, disableNotifications} = options || {};
const delay = 5e3; // ms
const maxDuration = 3e5; // ms
Expand All @@ -201,13 +195,13 @@ MeetingsUtil.checkH264Support = async function checkH264Support(options: {

// Disable notifications and start H.264 download only
if (disableNotifications) {
hasH264Codec();
MeetingsUtil.isH264CodecAvailable();

return;
}

// Codec loaded trigger event notification
if (await hasH264Codec()) {
if (await MeetingsUtil.isH264CodecAvailable()) {
Trigger.trigger(
this,
{
Expand Down
19 changes: 19 additions & 0 deletions packages/@webex/plugin-meetings/src/multistream/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export const MAX_FS_VALUES = {
'90p': 60,
'180p': 240,
'360p': 920,
'540p': 2040,
'720p': 3600,
'1080p': 8192,
};

export const CODEC_DEFAULTS = {
h264: {
maxFs: 8192,
maxFps: 3000,
maxMbps: 245760,
},
av1: {
maxPicSize: 8192,
},
};
Loading
Loading