@ -1,6 +1,6 @@
// This content populates the video variant modal, which is spawned from the variants table. This relies on the `dataState` prop fed in by the table.
// This content populates the video variant modal, which is spawned from the variants table. This relies on the `dataState` prop fed in by the table.
import React , { FC } from 'react' ;
import React , { FC } from 'react' ;
import { Popconfirm , Row , Col , Slider , Collapse , Typography } from 'antd' ;
import { Popconfirm , Row , Col , Slider , Collapse , Typography , Alert , Button } from 'antd' ;
import { ExclamationCircleFilled } from '@ant-design/icons' ;
import { ExclamationCircleFilled } from '@ant-design/icons' ;
import classNames from 'classnames' ;
import classNames from 'classnames' ;
import { FieldUpdaterFunc , VideoVariant , UpdateArgs } from '../../types/config-section' ;
import { FieldUpdaterFunc , VideoVariant , UpdateArgs } from '../../types/config-section' ;
@ -108,17 +108,25 @@ export const VideoVariantForm: FC<VideoVariantFormProps> = ({
} ) ;
} ) ;
return (
return (
< div className = { classes } >
< div className = { classes } >
< p className = "description" >
< div className = "video-varient-alert" >
< a
< Alert
href = "https://owncast.online/docs/video?source=admin"
type = "info"
target = "_blank"
action = {
rel = "noopener noreferrer"
< a
>
href = "https://owncast.online/docs/video?source=admin"
Learn more
target = "_blank"
< / a > { ' ' }
rel = "noopener noreferrer"
about how each of these settings can impact the performance of your server .
>
< / p >
< div className = "video-varient-alert-button-container" >
< Button size = "small" type = "text" icon = { < ExclamationCircleFilled / > } >
Read more about how each of these settings can impact the performance of your
server .
< / Button >
< / div >
< / a >
}
/ >
< / div >
{ videoPassthroughEnabled && (
{ videoPassthroughEnabled && (
< p className = "passthrough-warning" >
< p className = "passthrough-warning" >
NOTE : Video Passthrough for this output stream variant is < em > enabled < / em > , disabling the
NOTE : Video Passthrough for this output stream variant is < em > enabled < / em > , disabling the
@ -127,12 +135,14 @@ export const VideoVariantForm: FC<VideoVariantFormProps> = ({
) }
) }
< Row gutter = { 16 } >
< Row gutter = { 16 } >
< TextField
< Col xs = { 24 } lg = { { span : 24 , pull : 3 } } className = "video-text-field-container" >
maxLength = "10"
< TextField
{ . . . VIDEO_NAME_DEFAULTS }
maxLength = "10"
value = { dataState . name }
{ . . . VIDEO_NAME_DEFAULTS }
onChange = { handleNameChanged }
value = { dataState . name }
/ >
onChange = { handleNameChanged }
/ >
< / Col >
< Col sm = { 24 } md = { 12 } >
< Col sm = { 24 } md = { 12 } >
< div className = "form-module cpu-usage-container" >
< div className = "form-module cpu-usage-container" >
< Typography.Title level = { 3 } > CPU or GPU Utilization < / Typography.Title >
< Typography.Title level = { 3 } > CPU or GPU Utilization < / Typography.Title >
@ -153,7 +163,9 @@ export const VideoVariantForm: FC<VideoVariantFormProps> = ({
< p className = "selected-value-note" > { cpuUsageNote ( ) } < / p >
< p className = "selected-value-note" > { cpuUsageNote ( ) } < / p >
< / div >
< / div >
< p className = "read-more-subtext" >
< p className = "read-more-subtext" >
This could mean GPU or CPU usage depending on your server environment . { ' ' }
This could mean GPU or CPU usage depending on your server environment .
< br / >
< br / >
< a
< a
href = "https://owncast.online/docs/video/?source=admin#cpu-usage"
href = "https://owncast.online/docs/video/?source=admin#cpu-usage"
target = "_blank"
target = "_blank"
@ -164,8 +176,7 @@ export const VideoVariantForm: FC<VideoVariantFormProps> = ({
< / p >
< / p >
< / div >
< / div >
< / Col >
< / Col >
< Col sm = { 24 } md = { 11 } offset = { 1 } >
< Col sm = { 24 } md = { 12 } >
{ /* VIDEO BITRATE FIELD */ }
{ /* VIDEO BITRATE FIELD */ }
< div
< div
className = { ` form-module bitrate-container ${
className = { ` form-module bitrate-container ${
@ -209,7 +220,8 @@ export const VideoVariantForm: FC<VideoVariantFormProps> = ({
< p className = "description" >
< p className = "description" >
Resizing your content will take additional resources on your server . If you wish
Resizing your content will take additional resources on your server . If you wish
to optionally resize your content for this stream output then you should either
to optionally resize your content for this stream output then you should either
set the width < strong > or < / strong > the height to keep your aspect ratio . { ' ' }
set the width < strong > or < / strong > the height to keep your aspect ratio . < br / >
< br / >
< a
< a
href = "https://owncast.online/docs/video/?source=admin"
href = "https://owncast.online/docs/video/?source=admin"
target = "_blank"
target = "_blank"
@ -258,26 +270,33 @@ export const VideoVariantForm: FC<VideoVariantFormProps> = ({
< / a >
< / a >
< / p >
< / p >
< / div >
< / div >
< Popconfirm
< div className = "advanced-switch-container" >
disabled = { dataState . videoPassthrough === true }
< Popconfirm
title = "Did you read the documentation about video passthrough and understand the risks involved with enabling it?"
disabled = { dataState . videoPassthrough === true }
icon = { < ExclamationCircleFilled / > }
title = "Did you read the documentation about video passthrough and understand the risks involved with enabling it?"
onConfirm = { handleVideoPassConfirm }
icon = { < ExclamationCircleFilled / > }
okText = "Yes"
onConfirm = { handleVideoPassConfirm }
cancelText = "No"
okText = "Yes"
>
cancelText = "No"
{ /* adding an <a> tag to force Popcofirm to register click on toggle */ }
>
{ /* eslint-disable-next-line jsx-a11y/anchor-is-valid */ }
{ /* adding an <a> tag to force Popcofirm to register click on toggle */ }
< a href = "#" >
{ /* eslint-disable-next-line jsx-a11y/anchor-is-valid */ }
< ToggleSwitch
< a href = "#" >
label = "Use Video Passthrough?"
< div className = "advanced-description-switch-container" >
fieldName = "video-passthrough"
< div className = "advanced-description-wrapper" >
tip = { VIDEO_VARIANT_SETTING_DEFAULTS . videoPassthrough . tip }
< p > Use Video Passthrough ? < / p >
checked = { dataState . videoPassthrough }
< / div >
onChange = { handleVideoPassthroughToggle }
< ToggleSwitch
/ >
label = ""
< / a >
fieldName = "video-passthrough"
< / Popconfirm >
checked = { dataState . videoPassthrough }
onChange = { handleVideoPassthroughToggle }
/ >
< / div >
< / a >
< p > * { VIDEO_VARIANT_SETTING_DEFAULTS . videoPassthrough . tip } < / p >
< / Popconfirm >
< / div >
< / div >
< / div >
< / Col >
< / Col >
< / Row >
< / Row >