UNPKG

@mafalda-sfu/scalabilitymodesutils

Version:
22 lines (21 loc) 647 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseScalabilityMode = parseScalabilityMode; const ScalabilityModeRegex = new RegExp('^[LS]([1-9]\\d{0,1})T([1-9]\\d{0,1})(_KEY)?'); function parseScalabilityMode(scalabilityMode) { const match = ScalabilityModeRegex.exec(scalabilityMode ?? ''); if (match) { return { spatialLayers: Number(match[1]), temporalLayers: Number(match[2]), ksvc: Boolean(match[3]), }; } else { return { spatialLayers: 1, temporalLayers: 1, ksvc: false, }; } }