From 489ec2918429b64f2e3cd6fed1b02363a3574005 Mon Sep 17 00:00:00 2001 From: 15683799673 Date: Sun, 10 Aug 2025 19:35:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=92=AD=E6=94=BE=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E6=94=AF=E6=8C=81h265=E5=92=8Ch264=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/api/sis/stream/index.ts | 3 +- apps/web-antd/src/utils/video.ts | 21 ++++ apps/web-antd/src/views/sis/acAdmin/index.vue | 106 ++++++++---------- apps/web-antd/src/views/sis/video/index.vue | 61 ++++++---- apps/web-antd/vite.config.mts | 4 - 5 files changed, 104 insertions(+), 91 deletions(-) create mode 100644 apps/web-antd/src/utils/video.ts diff --git a/apps/web-antd/src/api/sis/stream/index.ts b/apps/web-antd/src/api/sis/stream/index.ts index 65f08721..c233a1f5 100644 --- a/apps/web-antd/src/api/sis/stream/index.ts +++ b/apps/web-antd/src/api/sis/stream/index.ts @@ -12,9 +12,10 @@ export function addStreamProxy(params?: any) { params, ); } + export function addFFmpegStreamProxy(params?: any) { return requestClient.post( - 'sis/stream/realtime/addFfmpeg', + 'sis/stream/FFmpeg/proxy', params, ); } diff --git a/apps/web-antd/src/utils/video.ts b/apps/web-antd/src/utils/video.ts new file mode 100644 index 00000000..606cee2e --- /dev/null +++ b/apps/web-antd/src/utils/video.ts @@ -0,0 +1,21 @@ +/** + * 验证浏览器是否支持播放h265 编码的视频流 + */ +export function checkHEVCSupport() { + const video = document.createElement('video'); + const h265Support = { + hevc: false, + hvc1: false, + }; + + // 测试不同的HEVC MIME类型 + if (video.canPlayType) { + h265Support.hevc = + video.canPlayType('video/mp4; codecs="hev1.1.6.L93.B0"') !== ''; + h265Support.hvc1 = + video.canPlayType('video/mp4; codecs="hvc1.1.6.L93.B0"') !== ''; + } + const result = h265Support.hevc || h265Support.hvc1; + console.log('当前浏览器是否支持h265:' + result); + return result; +} diff --git a/apps/web-antd/src/views/sis/acAdmin/index.vue b/apps/web-antd/src/views/sis/acAdmin/index.vue index cbf4ed1d..dd871237 100644 --- a/apps/web-antd/src/views/sis/acAdmin/index.vue +++ b/apps/web-antd/src/views/sis/acAdmin/index.vue @@ -27,10 +27,12 @@