浏览代码

Merge remote-tracking branch 'origin/master_fhhx_20250718' into master_fhhx_20250718

xdd 1 周之前
父节点
当前提交
68fdf98f63

+ 1 - 1
.env.development

@@ -12,7 +12,7 @@ VUE_APP_COS_BUCKET = fs-1319721001
 # 存储桶配置
 VUE_APP_COS_REGION = ap-chongqing
 # 线路一地址
-VUE_APP_VIDEO_LINE_1 = https://cos.his.cdwjyyh.com
+VUE_APP_VIDEO_LINE_1 = https://fs-1319721001.cos.ap-chongqing.myqcloud.com
 # 线路二地址
 VUE_APP_VIDEO_LINE_2 = https://zkzhobs.ylrztop.com
 

+ 1 - 1
.env.production

@@ -10,7 +10,7 @@ VUE_APP_COS_BUCKET = fs-1319721001
 # 存储桶配置
 VUE_APP_COS_REGION = ap-chongqing
 # 线路一地址
-VUE_APP_VIDEO_LINE_1 = https://cos.his.cdwjyyh.com
+VUE_APP_VIDEO_LINE_1 = https://fs-1319721001.cos.ap-chongqing.myqcloud.com
 # 线路二地址
 VUE_APP_VIDEO_LINE_2 = https://zkzhobs.ylrztop.com
 

+ 1 - 0
src/components/LiveVideoUpload/index.vue

@@ -218,6 +218,7 @@ export default {
         } else {
           line_1 = `${process.env.VUE_APP_VIDEO_LINE_1}${data.urlPath}`;
         }
+        line_1 = line_1.replace(/\.mp4$/, '.m3u8');
 
         let urlPathWithoutFirstSlash = data.urlPath.substring(1);
         this.$emit("update:fileKey", urlPathWithoutFirstSlash);

+ 1 - 6
src/components/VideoUpload/index.vue

@@ -230,10 +230,6 @@ export default {
     this.reset();
   },
   watch: {
-    localUploadType(newType) {
-      this.$emit("update:uploadType", newType);
-      this.$emit("change");
-    },
     uploadType(newType) {
       this.localUploadType = newType;
     },
@@ -308,6 +304,7 @@ export default {
         }else {
           line_1 = `${process.env.VUE_APP_VIDEO_LINE_1}${data.urlPath}`;
         }
+        line_1 = line_1.replace(/\.mp4$/, '.m3u8');
 
         let urlPathWithoutFirstSlash = data.urlPath.substring(1);
         this.$emit("update:fileKey", urlPathWithoutFirstSlash);
@@ -399,11 +396,9 @@ export default {
 
       // 更新组件内部数据
       this.$emit("update:fileName", this.selectedVideo.fileName);
-      this.$emit("update:thumbnail", this.selectedVideo.thumbnail);
       this.$emit("update:line_1", this.selectedVideo.lineOne);
       this.$emit("update:fileSize", this.selectedVideo.fileSize);
       this.$emit("update:fileKey", this.selectedVideo.fileKey);
-      this.$emit("update:uploadType", this.selectedVideo.uploadType);
       this.$emit("video-duration", this.selectedVideo.duration);
       // 设置预览URL
       this.$emit("update:videoUrl", this.selectedVideo.videoUrl);

+ 0 - 1
src/views/live/liveConfig/barrage.vue

@@ -216,7 +216,6 @@ export default {
           this.liveId = this.$route.query.liveId;
         }
         if(this.liveId == null) {
-          this.$message.error("页面错误,请联系管理员");
           return;
         }
         this.liveAbled = true

+ 3 - 4
src/views/live/liveConfig/task.vue

@@ -356,7 +356,6 @@ export default {
           this.liveId = this.$route.query.liveId;
         }
         if(this.liveId == null) {
-          this.$message.error("页面错误,请联系管理员");
           return;
         }
         this.liveAbled = true
@@ -556,9 +555,9 @@ export default {
       }
       this.loading = true;
       listTask(this.queryParams).then(res => {
-        if(res.rows.length > 0) {
-          this.taskList = res.rows;
-        }
+
+        this.taskList = res.rows;
+
         this.total = res.total;
         this.loading = false;
       });

+ 14 - 6
src/views/live/liveConsole/index.vue

@@ -100,7 +100,7 @@
             class="custom-video"
             style="display: block; background: #000; height: 40vh;"
           >
-            <source :src="videoUrl" type="video/mp4">
+            <source :src="videoUrl" type="application/x-mpegURL">
           </video>
           <!-- 自定义进度条容器 -->
           <div ref="progressBar" class="progress-container">
@@ -122,7 +122,7 @@
             playsinline
             style="display: block; background: #000; height: 40vh;"
           >
-            <source :src="videoUrl" type="video/mp4">
+            <source :src="videoUrl" type="application/x-mpegURL">
           </video>
         </div>
         <div style="border-radius: 5px; overflow: hidden;" v-else>
@@ -393,7 +393,6 @@ export default {
     this.$nextTick(() => {
       const video = this.$refs.videoPlayer;
       if (video != null) {
-        video.play();
         this.initVideoPlayer(this.liveInfo.startTime)
       }
     })
@@ -453,7 +452,17 @@ export default {
     },
     initVideoPlayer: function (startTime) {
       const video = this.$refs.videoPlayer;
-
+      this.hls = new Hls();
+      this.hls.attachMedia(video);
+      this.hls.on(Hls.Events.MEDIA_ATTACHED, () => {
+        this.hls.loadSource(this.videoUrl);
+        this.hls.on(Hls.Events.STREAM_LOADED, (event, data) => {
+          video.play();
+        });
+      });
+      this.hls.on(Hls.Events.ERROR, (event, data) => {
+        console.error('HLS 错误:', data);
+      });
 
       // 1. 初始化开播时间
       startTime = new Date(startTime).getTime();
@@ -588,8 +597,6 @@ export default {
               this.liveType = 2
               this.videoUrl = res.data.videoUrl;
               this.$nextTick(() => {
-                const video = this.$refs.videoPlayer;
-                video.play()
                 this.initVideoPlayer(res.data.startTime)
               })
             }
@@ -682,6 +689,7 @@ export default {
       }
     },
     loadUserList() {
+      if(this.liveId == null)  return
       // 直播间用户
       watchUserList({
         liveId: this.liveId,