diff --git a/src/views/video_manager/video_manager/components/playVideo.vue b/src/views/video_manager/video_manager/components/playVideo.vue
index 1d9cb79..ad27230 100644
--- a/src/views/video_manager/video_manager/components/playVideo.vue
+++ b/src/views/video_manager/video_manager/components/playVideo.vue
@@ -1,22 +1,19 @@
-
-
-
+
+
+
-
- 关闭播放
-
+ 关闭播放
diff --git a/src/views/video_manager/video_manager/index.vue b/src/views/video_manager/video_manager/index.vue
index 8823e61..8de001a 100644
--- a/src/views/video_manager/video_manager/index.vue
+++ b/src/views/video_manager/video_manager/index.vue
@@ -18,8 +18,8 @@
重置
- 播放后台转码视频播放实时视频(WebRTC)
@@ -106,12 +106,11 @@
@get-data="fnResetPagination"
/>
-
+
@@ -130,8 +129,10 @@ import {ElMessage, ElMessageBox} from "element-plus";
import SelectingPoints from "./components/selecting_points.vue";
import LayoutVideo from "@/components/video/index.vue";
import {setVideoManagerList} from "@/request/eightwork_videomanager.js";
-import PlayVideo from "@/views/video_manager/video_manager/components/playVideo.vue"; // 引入新播放器组件
-import {startTransCode, stopTransCode} from "@/request/video_info.js"; // 转码接口
+import PlayVideo from "@/views/video_manager/video_manager/components/playVideo.vue";
+
+// 更新相关导入
+import {startWebRtcStream, stopWebRtcStream} from "@/request/webrtc.js";
const data = reactive({
addDialog: {
@@ -155,42 +156,32 @@ const data = reactive({
videomanagerId: "",
visible: false,
},
- transcodeVideoDialog: {
+ webRtcVideoDialog: {
visible: false,
- src: "http://localhost:8100/api/hls/stream.m3u8", // 后端转码后HLS流的访问路径
id: "",
},
});
-// 启动转码并显示播放器
-const handleStartTranscode = async () => {
+// 启动WebRTC流并显示播放器
+const handleStartWebRtcStream = async () => {
try {
- await startTransCode(); // 调用后端“启动转码”接口
- data.transcodeVideoDialog.visible = true; // 显示播放器弹窗
+ // 这里应该选择一个默认视频或让用户选择
+ await startWebRtcStream();
+ data.webRtcVideoDialog.visible = true;
} catch (error) {
- ElMessage.error("启动转码失败: " + (error.message || "未知错误"));
+ ElMessage.error("启动实时视频流失败: " + (error.message || "未知错误"));
}
};
-// 转码停止后的回调
-const onTranscodeStopped = async () => {
- await stopTransCode(); // 调用后端“停止转码”接口
+// WebRTC流停止后的回调
+const onWebRtcStreamStopped = async () => {
+ await stopWebRtcStream();
};
// 列表数据逻辑(保持不变)
const {list, pagination, searchForm, fnGetData, fnResetPagination} =
useListData(getHkVideoManagerList);
-// 其他方法(保持不变)
-// const fnSetPositioning = async (row) => {
-// data.selectingPointsDialog.id = row.PLS_ID ? row.PLS_ID : "";
-// data.selectingPointsDialog.indexCode = row.indexCode;
-// data.selectingPointsDialog.regionPathName = row.regionPathName;
-// data.selectingPointsDialog.camName = row.name;
-// data.selectingPointsDialog.videomanagerId = row.videomanagerId;
-// data.selectingPointsDialog.visible = true;
-// };
-
const fnUpToBi = async (videomanagerId) => {
await ElMessageBox.confirm("确定要置顶吗?置顶后将会默认展示在Bi页", {
type: "warning",
@@ -201,13 +192,11 @@ const fnUpToBi = async (videomanagerId) => {
const fnPreviewVideo = async (row) => {
try {
- const resData = await startTransCode({url: row.url, id: row.PLS_ID}); // 调用后端“启动转码”接口
- data.transcodeVideoDialog.visible = true; // 显示播放器弹窗
- data.transcodeVideoDialog.id = row.PLS_ID; // 显示播放器弹窗
- data.transcodeVideoDialog.src =
- "http://172.16.70.226:7811/" + resData.videoUrl + "stream.m3u8";
+ await startWebRtcStream({url: row.url, id: row.PLS_ID});
+ data.webRtcVideoDialog.visible = true;
+ data.webRtcVideoDialog.id = row.PLS_ID;
} catch (error) {
- ElMessage.error("启动转码失败: " + (error.message || "未知错误"));
+ ElMessage.error("启动实时视频流失败: " + (error.message || "未知错误"));
}
};
@@ -233,4 +222,4 @@ const fnDeleteVideo = async (row) => {
};
-
+
\ No newline at end of file