From 694ea5b1afa3f97a7e48caebbc515603ec7c9144 Mon Sep 17 00:00:00 2001 From: 86156 <823267011@qq.com> Date: Wed, 1 Oct 2025 23:42:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=A5=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rtsp-vue/src/views/video/device/component/flv.vue | 7 ++++--- ruoyi-admin/src/main/resources/application.yml | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/rtsp-vue/src/views/video/device/component/flv.vue b/rtsp-vue/src/views/video/device/component/flv.vue index 395d2a2..552719d 100644 --- a/rtsp-vue/src/views/video/device/component/flv.vue +++ b/rtsp-vue/src/views/video/device/component/flv.vue @@ -68,11 +68,12 @@ onMounted(() => { const getDetails = async (deviceId) => { const res = await getDevice(deviceId); tableData.value = res.data; - // 使用当前访问的域名和端口,通过Nginx代理访问视频流 + // 直接访问后端视频流服务器(10083端口),绕过Nginx反代,避免缓冲问题 // 注意:RTSP URL需要原样传递,不要编码,&&&作为特殊分隔符 // 使用 ffmpeg=true,系统 FFmpeg 包含完整的编码器支持(包括 libx264) - playUrl.value = `${window.location.origin}/live?url=${tableData.value.url}&&&ffmpeg=true`; - console.log('播放地址:', playUrl.value); + const videoServerUrl = 'http://49.232.154.205:10083'; + playUrl.value = `${videoServerUrl}/live?url=${tableData.value.url}&&&ffmpeg=true`; + console.log('📺 播放地址(直连后端):', playUrl.value); handlePlay(); } diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index d9e0b81..983e0ae 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -149,8 +149,8 @@ xss: # 流媒体服务端口 mediasServer: port: ${MEDIA_SERVER_PORT:10083} - # 监听地址,支持环境变量配置(默认127.0.0.1,只监听本地,通过Nginx代理) - address: ${MEDIA_SERVER_ADDRESS:127.0.0.1} + # 监听地址,支持环境变量配置(0.0.0.0 允许外网直接访问) + address: ${MEDIA_SERVER_ADDRESS:0.0.0.0} # 网络超时,15秒 netTimeout: 15000000 # 读写超时,15秒