ソースを参照

增加录像预览进度条

kkkkk 5 年 前
コミット
149d77ff9e
2 ファイル変更11 行追加3 行削除
  1. 9 1
      public/video/video.html
  2. 2 2
      src/components/videoList.vue

+ 9 - 1
public/video/video.html

@@ -19,6 +19,14 @@
 						console.log("收到消息:"+JSON.stringify(data.params));
 						var player = document.getElementById('player01');
 						player.setAttribute("video-url",data.params["path"]);
+						if(data.params['live'])
+						{
+							player.setAttribute('live',true);
+						}
+						else
+						{
+							player.setAttribute('live',false);
+						}
 						break;
 				}
 			});
@@ -40,7 +48,7 @@
 		<live-player id="player01" live="true" stretch="true" show-custom-button="false" autoplay>
 		</live-player>
 		<script>
-			var videoPath = getQueryVariable("url");
+			var videoPath = decodeURIComponent(getQueryVariable("url"));
 			console.log('播放地址:' + videoPath);
 			var player = document.getElementById('player01');
 			player.setAttribute("video-url", videoPath);

+ 2 - 2
src/components/videoList.vue

@@ -91,7 +91,7 @@
 				if (!this.showVideoDialog) { //防止出现流断开不彻底的问题
 					return '';
 				} else {
-					return '/video/video.html?url=' + this.videoUrl;
+					return '/video/video.html?url=' + encodeURIComponent(this.videoUrl);
 				}
 			},
 			getPlayerShared: function() {
@@ -280,7 +280,7 @@
 				console.log("当前行:" + JSON.stringify(rowData));
 				this.$refs.videoRender.contentWindow.postMessage({
 					cmd: 'switchUrl',
-					params: isBackLive?{"path":this.videoUrl}:rowData
+					params: isBackLive?{"path":this.videoUrl,"live":isBackLive}:{"path":rowData.path,"live":isBackLive}
 				}, '*')
 			}
 		}