huliu 1 anno fa
parent
commit
630876f6ce
1 ha cambiato i file con 23 aggiunte e 8 eliminazioni
  1. 23 8
      src/components/home.vue

+ 23 - 8
src/components/home.vue

@@ -46,6 +46,7 @@ import {
46 46
     callUIInteraction,
47 47
 } from "../webrtcVideo";
48 48
 
49
+import { getVideoUrl } from '../request/api';
49 50
 
50 51
 export default ({
51 52
     name: 'Histogram',
@@ -59,6 +60,7 @@ export default ({
59 60
             color: "red", //主题色
60 61
             title: "互动教室", //视频名称
61 62
             // src: "https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/IronMan.mp4", //视频源
63
+            type: 'm3u8',
62 64
             src: '',
63 65
             muted: false, //静音
64 66
             webFullScreen: false,
@@ -154,20 +156,29 @@ export default ({
154 156
             // console.log("屏幕点击位置看", e)
155 157
             clickData1.value.x = e.clientX;
156 158
             clickData1.value.y = e.clientY;
157
-
158
-        }
159
-        const clickFun = function (e) {
160
-            console.log("当前鼠标点击的坐标", e, e.clientX, e.clientY);
161 159
         }
160
+
162 161
         const handleResponseFunction = (data) => {
163 162
             console.log("从UE返回过来的值", data)
163
+            if (data == "{isrotate}") {
164
+                // console.log("旋转场景了", lineContainer, lineContainer.value);
165
+                if (lineContainer.value) {
166
+                    lineContainer.value.remove()
167
+                    lineContainer.value = null
168
+                }
169
+                popoverRef.value.style.display = "none"
170
+                return
171
+            }
164 172
             let json = eval("(" + data + ")");//转对象
165
-
166 173
             console.log("clickData---点击的数据", json)
167
-            if (json.videoUrl) {
174
+            if (json.url) {
168 175
                 videoDialog.value = true;
169
-                videoData.src = json.videoUrl
170
-                titleDialog.value = "互动教室"
176
+                titleDialog.value = json.name
177
+                getVideoUrl({ "rtsp": json.url }).then(res => {
178
+                    videoData.src = res.data.httpFlv;
179
+                    console.log("32424", videoData.src)
180
+                })
181
+
171 182
                 return
172 183
             }
173 184
             clickData.value = json;
@@ -217,9 +228,12 @@ export default ({
217 228
 
218 229
                     if (lineContainer.value) {
219 230
                         lineContainer.value.remove()
231
+
220 232
                     }
221 233
 
222 234
                     lineContainer.value = new LeaderLine(linedomRef.value, popoverRef.value, lineStyleOption.value)
235
+
236
+
223 237
                     lineContainer.value.show('draw', {
224 238
                         duration: 100, //持续时长
225 239
                         timing: 'ease-in' // 动画函数
@@ -229,6 +243,7 @@ export default ({
229 243
                     lineContainer.value.position();
230 244
 
231 245
 
246
+
232 247
                 })
233 248
 
234 249
             }