huliu 1 vuosi sitten
vanhempi
commit
630876f6ce
1 muutettua tiedostoa jossa 23 lisäystä ja 8 poistoa
  1. 23 8
      src/components/home.vue

+ 23 - 8
src/components/home.vue

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