guhongwei преди 4 години
родител
ревизия
92f476aad4
променени са 6 файла, в които са добавени 33 реда и са изтрити 53 реда
  1. 1 0
      public/index.html
  2. BIN
      public/swf/flowplayer-3.2.18.swf
  3. BIN
      public/swf/flowplayer.controls-3.2.16.swf
  4. BIN
      public/swf/flowplayer.rtmp-3.2.13.swf
  5. 0 50
      public/videoLive.html
  6. 32 3
      src/views/hall/direct.vue

+ 1 - 0
public/index.html

@@ -6,6 +6,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title><%= htmlWebpackPlugin.options.title %></title>
+    <script src="/platlive/static/js/flowplayer-3.2.13.min.js"></script>
   </head>
   <body>
     <noscript>

BIN
public/swf/flowplayer-3.2.18.swf


BIN
public/swf/flowplayer.controls-3.2.16.swf


BIN
public/swf/flowplayer.rtmp-3.2.13.swf


+ 0 - 50
public/videoLive.html

@@ -1,50 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-  <meta charset="UTF-8">
-  <title>rtmp直播</title>
-  <script src="/platlive/static/js/flowplayer-3.2.13.min.js"></script>
-  <style type="text/css">
-    body {
-      margin: 0;
-    }
-
-    .h5video {
-      width: 100%;
-      height: 100vh;
-    }
-  </style>
-</head>
-
-<body>
-  <div class="h5video" id="playerDiv2"></div>
-  <script>
-    var url_2 = 'rtmp://127.0.0.1/live/111111';
-    var oPlayerDiv2 = document.getElementById('playerDiv2');
-    oPlayerDiv2.setAttribute("data-rtmp", url_2);
-    oPlayerDiv2.setAttribute("href", url_2);
-    var swfStr = "/platlive/static/swf/flowplayer-3.2.18.swf"
-    var obj_1 = {
-      clip: {
-        provider: 'rtmp',
-        bufferLength: 0,
-        bufferTime: 0,
-        autoPlay: true,
-        live: true
-      },
-      plugins: {
-        rtmp: {
-          url: "flowplayer.rtmp-3.2.13.swf",
-          netConnectionUrl: url_2
-        }
-      }
-    };
-
-    const obj_2 = JSON.parse(JSON.stringify(obj_1));
-    obj_2.plugins.rtmp.netConnectionUrl = url_2;
-    flowplayer('playerDiv2', swfStr, obj_2);
-  </script>
-</body>
-
-</html>

+ 32 - 3
src/views/hall/direct.vue

@@ -56,7 +56,7 @@
                 </el-col>
                 <el-col :span="24" :class="[dockInfo.room_id == '1006' ? 'leftvideos' : 'leftvideo']">
                   <span v-if="dockInfo.room_id == '1006'">
-                    <iframe src="/platlive/videoLive.html" style="width:100%;height:100%"></iframe>
+                    <div class="h5video" id="videoDiv" style="height:400px;"></div>
                   </span>
                   <span v-else>
                     <el-col :span="24" class="videoTop">
@@ -359,7 +359,7 @@ export default {
     expeDetail, //专家详情
     trainList, //交易列表
     imagetxtList, //图文直播
-    // swiper,
+    swiper,
   },
   data: () => ({
     // 对接会详情
@@ -409,14 +409,44 @@ export default {
         prevEl: '.swiper-button-prev',
       },
     },
+    // 直播流地址
+    rmtpUrl: 'rtmp://127.0.0.1/live/111111',
   }),
 
   async created() {
     this.$set(this, `dock_id`, this.$route.query.id);
     await this.searchdock();
     await this.seachtVideo();
+    this.$nextTick(() => {
+      this.searchLive();
+    });
   },
   methods: {
+    searchLive() {
+      let url_2 = this.rmtpUrl;
+      var ovideoDiv = document.getElementById('videoDiv');
+      ovideoDiv.setAttribute('data-rtmp', url_2);
+      ovideoDiv.setAttribute('href', url_2);
+      var swfStr = '/swf/flowplayer-3.2.18.swf';
+      var obj_1 = {
+        clip: {
+          provider: 'rtmp',
+          bufferLength: 0,
+          bufferTime: 0,
+          autoPlay: true,
+          live: true,
+        },
+        plugins: {
+          rtmp: {
+            url: 'flowplayer.rtmp-3.2.13.swf',
+            netConnectionUrl: url_2,
+          },
+        },
+      };
+      const obj_2 = JSON.parse(JSON.stringify(obj_1));
+      obj_2.plugins.rtmp.netConnectionUrl = url_2;
+      flowplayer('videoDiv', swfStr, obj_2);
+    },
     // 展会
     ...dock({ dockQuery: 'query', dockFetch: 'fetch', goodsquery: 'goodsquery' }),
     // 用户
@@ -431,7 +461,6 @@ export default {
     ...newsguidance({ danceQuery: 'query' }),
     // 项目路演
     ...newsroadshow({ adshowQuery: 'query' }),
-
     // 查询详情
     async searchdock() {
       // 对接会详情