From c8a38d5fd8b1a92d4d14a9785f21b1e0223e2460 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期五, 17 六月 2022 15:17:35 +0800 Subject: [PATCH] cameraplayer,添加本地播放功能 --- src/pages/cameraPlayer/index/App.vue | 22 +++++++++++++++++----- public/fonts/element-icons.ttf | 0 public/fonts/element-icons.woff | 0 src/components/player/index.vue | 2 +- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/public/fonts/element-icons.ttf b/public/fonts/element-icons.ttf new file mode 100644 index 0000000..91b74de --- /dev/null +++ b/public/fonts/element-icons.ttf Binary files differ diff --git a/public/fonts/element-icons.woff b/public/fonts/element-icons.woff new file mode 100644 index 0000000..02b9a25 --- /dev/null +++ b/public/fonts/element-icons.woff Binary files differ diff --git a/src/components/player/index.vue b/src/components/player/index.vue index 5962311..2cc9f85 100644 --- a/src/components/player/index.vue +++ b/src/components/player/index.vue @@ -55,7 +55,7 @@ }, data() { return { - wfs: {}, + wfs: null, wfsId: 0, Camera: new VideoRuleData(), showCanvas: true, diff --git a/src/pages/cameraPlayer/index/App.vue b/src/pages/cameraPlayer/index/App.vue index 0559cf1..e7d97e6 100644 --- a/src/pages/cameraPlayer/index/App.vue +++ b/src/pages/cameraPlayer/index/App.vue @@ -6,13 +6,20 @@ :isGb="query.gb28181 === '1'" v-if="!enableWasm" ></camera-player> - <wasm-player :cameraID="query.cameraId" :rtspUrl="query.rtspUrl" :isGb="query.gb28181 === '1'" v-else></wasm-player> + <wasm-player + :cameraID="query.cameraId" + :rtspUrl="query.rtspUrl" + :isGb="query.gb28181 === '1'" + :videoUrl="query.videoUrl" + :isStream="isStream" + v-else + ></wasm-player> </div> </template> <script> // 鎺ュ彛浣跨敤 -// 鍙傛暟 cameraId 鎽勫儚鏈篿d, rtspUrl 鎽勫儚鏈簉tsp鍦板潃, gb28181 鏄惁鏄浗鏍囨憚鍍忔満(1 鎴� 0) +// 鍙傛暟 cameraId 鎽勫儚鏈篿d, rtspUrl 鎽勫儚鏈簉tsp鍦板潃, gb28181 鏄惁鏄浗鏍囨憚鍍忔満(1 鎴� 0), enableWasm 浣跨敤wasm 鎾斁鍣�, isStream 鏄惁鎾斁瀹炴椂娴�, videoUrl 瑙嗛鏂囦欢鍦板潃 // http://192.168.20.191:7003/view/cameraPlayer/index.html?cameraId=e7e6157a-5929-4e78-b390-e365141169c8&rtspUrl=rtsp://admin:a1234567@192.168.5.51:554/h264/ch1/main/av_stream import CameraPlayer from "../components/player" @@ -29,9 +36,11 @@ query: { cameraId: "", rtspUrl: "", - gb28181: "0" + gb28181: "0", + videoUrl: `${location.protocol === "https" ? "wss" : "ws"}://${location.host}/ws` }, - enableWasm: false + enableWasm: false, + isStream: true } }, mounted() { @@ -56,10 +65,13 @@ if (key == "enableWasm" && value == "1") { this.enableWasm = true } + if (key == "isStream" && value == "0") { + this.isStream = false + } }) } this.query = Object.assign({}, this.query, obj) - console.log("cameraPlayer:", this.query) + console.log("cameraPlayer:", this.query, "enableWasm:", this.enableWasm, "isStream:", this.isStream) }, // 瀵逛紶鍏ョ殑rtsp瀵嗙爜杩涜urlEncode澶勭悊 rtspParse(input) { -- Gitblit v1.8.0