diff --git a/core/frontend/src/components/video-manager/VideoStreamCreationDialog.vue b/core/frontend/src/components/video-manager/VideoStreamCreationDialog.vue index 7f5f9d20eb..950081b31b 100644 --- a/core/frontend/src/components/video-manager/VideoStreamCreationDialog.vue +++ b/core/frontend/src/components/video-manager/VideoStreamCreationDialog.vue @@ -27,6 +27,7 @@ label="Encoding" :disabled="is_redirect_source" :rules="[validate_required_field]" + @change="change_endpoints_from_encode($event)" /> { + if (encode === VideoEncodeType.H264) { + if (endpoint.includes('udp265://')) { + return endpoint.replace('udp265://', 'udp://') + } + } + + if (encode === VideoEncodeType.H265) { + if (endpoint.includes('udp://')) { + return endpoint.replace('udp://', 'udp265://') + } + } + return endpoint + }) + }, set_default_address_for_stream(index: number, stream_type: StreamType) { switch (stream_type) { case StreamType.UDP: @@ -426,6 +445,12 @@ export default Vue.extend({ Vue.set(this.stream_endpoints, index, `udp://${this.user_ip_address}:${5600 + index}`) } break + case StreamType.UDP265: + if (!this.stream_endpoints[index].includes('udp265://')) { + // Vue.set() forces the update of a nested property + Vue.set(this.stream_endpoints, index, `udp265://${this.user_ip_address}:${5600 + index}`) + } + break case StreamType.RTSP: case StreamType.RTSPU: case StreamType.RTSPT: diff --git a/core/frontend/src/types/video.ts b/core/frontend/src/types/video.ts index a5f33dae2f..cbf263aa9c 100644 --- a/core/frontend/src/types/video.ts +++ b/core/frontend/src/types/video.ts @@ -19,6 +19,7 @@ export enum VideoEncodeType { export enum StreamType { RTSP = 'RTSP', UDP = 'UDP', + UDP265 = 'UDP265', RTSPU = 'RTSPU', RTSPT = 'RTSPT', RTSPH = 'RTSPH', diff --git a/core/frontend/src/utils/pattern_validators.ts b/core/frontend/src/utils/pattern_validators.ts index 5a23b39943..923abee8a0 100644 --- a/core/frontend/src/utils/pattern_validators.ts +++ b/core/frontend/src/utils/pattern_validators.ts @@ -29,7 +29,7 @@ export function isIpAddress(ip: string): boolean { export function isUdpAddress(address: string): boolean { try { - return new URL(address).protocol === 'udp:' + return ['udp:', 'udp265:'].includes(new URL(address).protocol) } catch (error) { return false }