guhongwei 4 năm trước cách đây
mục cha
commit
695a664fc3
4 tập tin đã thay đổi với 127 bổ sung0 xóa
  1. 22 0
      public/js/flowplayer-3.2.13.min.js
  2. 52 0
      public/videoLive.html
  3. 5 0
      src/router/index.js
  4. 48 0
      src/views/video.vue

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 22 - 0
public/js/flowplayer-3.2.13.min.js


+ 52 - 0
public/videoLive.html

@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+  <meta charset="UTF-8">
+  <title>rtmp直播</title>
+  <script src="./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);
+    console.log(oPlayerDiv2)
+    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;
+    console.log(swfStr, obj_2);
+    flowplayer('playerDiv2', swfStr, obj_2);
+  </script>
+</body>
+
+</html>

+ 5 - 0
src/router/index.js

@@ -8,6 +8,11 @@ const live = [
     name: 'live',
     component: () => import('../views/index.vue'),
     children: [
+      {
+        path: '/video',
+        meta: { title: '平台登陆' },
+        component: () => import('../views/video.vue'),
+      },
       // 平台登录
       {
         path: '/webLogin',

+ 48 - 0
src/views/video.vue

@@ -0,0 +1,48 @@
+<template>
+  <div id="video">
+    <el-row>
+      <el-col :span="24" class="main">
+        <div class="w_1200">
+          <el-col :span="24" class="video">
+            <iframe src="videoLive.html" style="width:100%;height:100%"></iframe>
+          </el-col>
+        </div>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  name: 'video',
+  props: {},
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    search() {},
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .video {
+    width: 500px;
+    height: 300px;
+    border: 1px solid red;
+  }
+}
+</style>