Support setting a custom name for a stream output variant (#64)
* Display+set video stream output variant names * Merge in admin updates * Prettified Code! * Fix build * Prettified Code! Co-authored-by: gabek <gabek@users.noreply.github.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import TextField from './form-textfield';
|
|||||||
import {
|
import {
|
||||||
DEFAULT_VARIANT_STATE,
|
DEFAULT_VARIANT_STATE,
|
||||||
VIDEO_VARIANT_SETTING_DEFAULTS,
|
VIDEO_VARIANT_SETTING_DEFAULTS,
|
||||||
|
VIDEO_NAME_DEFAULTS,
|
||||||
ENCODER_PRESET_SLIDER_MARKS,
|
ENCODER_PRESET_SLIDER_MARKS,
|
||||||
ENCODER_PRESET_TOOLTIPS,
|
ENCODER_PRESET_TOOLTIPS,
|
||||||
VIDEO_BITRATE_DEFAULTS,
|
VIDEO_BITRATE_DEFAULTS,
|
||||||
@@ -69,6 +70,10 @@ export default function VideoVariantForm({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleNameChanged = (args: UpdateArgs) => {
|
||||||
|
onUpdateField({ fieldName: 'name', value: args.value });
|
||||||
|
};
|
||||||
|
|
||||||
// Slider notes
|
// Slider notes
|
||||||
const selectedVideoBRnote = () => {
|
const selectedVideoBRnote = () => {
|
||||||
if (videoPassthroughEnabled) {
|
if (videoPassthroughEnabled) {
|
||||||
@@ -122,6 +127,12 @@ export default function VideoVariantForm({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<Row gutter={16}>
|
<Row gutter={16}>
|
||||||
|
<TextField
|
||||||
|
maxLength="10"
|
||||||
|
{...VIDEO_NAME_DEFAULTS}
|
||||||
|
value={dataState.name}
|
||||||
|
onChange={handleNameChanged}
|
||||||
|
/>
|
||||||
<Col sm={24} md={12}>
|
<Col sm={24} md={12}>
|
||||||
{/* ENCODER PRESET (CPU USAGE) FIELD */}
|
{/* ENCODER PRESET (CPU USAGE) FIELD */}
|
||||||
<div className="form-module cpu-usage-container">
|
<div className="form-module cpu-usage-container">
|
||||||
|
|||||||
@@ -125,6 +125,11 @@ export default function CurrentVariantsTable() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const videoQualityColumns: ColumnsType<VideoVariant> = [
|
const videoQualityColumns: ColumnsType<VideoVariant> = [
|
||||||
|
{
|
||||||
|
title: 'Name',
|
||||||
|
dataIndex: 'name',
|
||||||
|
render: (name: string) => (!name ? 'No name' : name),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: 'Video bitrate',
|
title: 'Video bitrate',
|
||||||
dataIndex: 'videoBitrate',
|
dataIndex: 'videoBitrate',
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ export interface VideoVariant {
|
|||||||
|
|
||||||
scaledWidth: number;
|
scaledWidth: number;
|
||||||
scaledHeight: number;
|
scaledHeight: number;
|
||||||
|
|
||||||
|
name: string;
|
||||||
}
|
}
|
||||||
export interface VideoSettingsFields {
|
export interface VideoSettingsFields {
|
||||||
latencyLevel: number;
|
latencyLevel: number;
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ export const DEFAULT_VARIANT_STATE: VideoVariant = {
|
|||||||
cpuUsageLevel: 3,
|
cpuUsageLevel: 3,
|
||||||
scaledHeight: null,
|
scaledHeight: null,
|
||||||
scaledWidth: null,
|
scaledWidth: null,
|
||||||
|
name: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const VIDEO_VARIANT_SETTING_DEFAULTS = {
|
export const VIDEO_VARIANT_SETTING_DEFAULTS = {
|
||||||
@@ -223,6 +224,15 @@ export const VIDEO_BITRATE_DEFAULTS = {
|
|||||||
incrementBy: 100,
|
incrementBy: 100,
|
||||||
tip: 'The overall quality of your stream is generally impacted most by bitrate.',
|
tip: 'The overall quality of your stream is generally impacted most by bitrate.',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const VIDEO_NAME_DEFAULTS = {
|
||||||
|
fieldName: 'name',
|
||||||
|
label: 'Name',
|
||||||
|
maxLength: 12,
|
||||||
|
placeholder: 'HD or Low',
|
||||||
|
tip: 'Human-readable name for for displaying in the quality selector.',
|
||||||
|
};
|
||||||
|
|
||||||
export const VIDEO_BITRATE_SLIDER_MARKS = {
|
export const VIDEO_BITRATE_SLIDER_MARKS = {
|
||||||
[VIDEO_BITRATE_DEFAULTS.min]: `${VIDEO_BITRATE_DEFAULTS.min} ${VIDEO_BITRATE_DEFAULTS.unit}`,
|
[VIDEO_BITRATE_DEFAULTS.min]: `${VIDEO_BITRATE_DEFAULTS.min} ${VIDEO_BITRATE_DEFAULTS.unit}`,
|
||||||
3000: 3000,
|
3000: 3000,
|
||||||
|
|||||||
Reference in New Issue
Block a user