guhongwei 4 年之前
父節點
當前提交
efa523f77a

+ 1 - 0
.env

@@ -1,2 +1,3 @@
 VUE_APP_AXIOS_BASE_URL = ''
 VUE_APP_ROUTER="/platmobile"
+VUE_APP_LIVE_URL='rtmp://124.71.143.119/live/'

文件差異過大導致無法顯示
+ 9012 - 0
public/ckplayer/ckplayer/ckplayer.js


文件差異過大導致無法顯示
+ 105 - 0
public/ckplayer/ckplayer/ckplayer.json


文件差異過大導致無法顯示
+ 16 - 0
public/ckplayer/ckplayer/ckplayer.min.js


文件差異過大導致無法顯示
+ 105 - 0
public/ckplayer/ckplayer/ckplayer.mobile.json


+ 28 - 0
public/ckplayer/ckplayer/hls/LICENSE

@@ -0,0 +1,28 @@
+Copyright (c) 2017 Dailymotion (http://www.dailymotion.com)
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+src/remux/mp4-generator.js and src/demux/exp-golomb.js implementation in this project
+are derived from the HLS library for video.js (https://github.com/videojs/videojs-contrib-hls)
+
+That work is also covered by the Apache 2 License, following copyright:
+Copyright (c) 2013-2015 Brightcove
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

文件差異過大導致無法顯示
+ 15403 - 0
public/ckplayer/ckplayer/hls/hls.js


文件差異過大導致無法顯示
+ 7 - 0
public/ckplayer/ckplayer/hls/hls.min.js


+ 42 - 0
public/ckplayer/ckplayer/language.json

@@ -0,0 +1,42 @@
+{
+    "adCountdown": "[$Second]",
+    "skipDelay": "[$Second]",
+    "buttonOver": {
+      "play": "点击播放",
+      "pause": "暂停播放",
+      "mute": "静音",
+      "escMute": "恢复音量",
+      "full": "全屏",
+      "escFull": "退出全屏",
+      "previousPage": "上一集",
+      "nextPage": "下一集",
+      "definition": "选择清晰度",
+      "subtitles": "选择字幕",
+      "playbackrate": "倍速播放"
+    },
+    "volumeSliderOver": "音量:[$volume]%",
+    "buffer": "[$percentage]%",
+    "timeSliderOver": "[$timeh]:[$timei]:[$times]",
+    "liveAndVod": "[$timeh]:[$timei]:[$times]",
+    "vod":"[$timeh]:[$timei]:[$times] / [$durationh]:[$durationi]:[$durations]",
+    "live": "直播中 [$liveTimeY]-[$liveTimem]-[$liveTimed] [$liveTimeh]:[$liveTimei]:[$liveTimes]",
+    "m3u8Definition": {
+      "name": [
+        "流畅",
+        "低清",
+        "标清",
+        "高清",
+        "超清",
+        "蓝光",
+        "未知"
+      ]
+    },
+    "error": {
+      "cannotFindUrl": "视频地址不存在",
+      "streamNotFound": "加载失败",
+      "formatError": "视频格式错误"
+    },
+    "definition": "自动",
+    "subtitle": "默认",
+    "playbackrate": "默认"
+}

文件差異過大導致無法顯示
+ 883 - 0
public/ckplayer/ckplayer/style.json


文件差異過大導致無法顯示
+ 861 - 0
public/ckplayer/ckplayer/style.mobile.json


+ 1 - 0
public/index.html

@@ -5,6 +5,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+    <script src="/platlive/ckplayer/ckplayer/ckplayer.js"></script>
     <title><%= htmlWebpackPlugin.options.title %></title>
   </head>
   <body>

+ 38 - 24
src/views/live/detail.vue

@@ -4,26 +4,28 @@
       <el-col :span="24" class="main">
         <el-col :span="24" class="video">
           <el-col :span="24" class="top">
-            <!-- <video :src="videoPath" v-if="videoData != ''" autoplay="autoplay" controls="controls" loop="loop">
-              您的浏览器不支持 video 标签。
-            </video> -->
-            <video
-              autoplay="autoplay"
-              controls="controls"
-              preload="meta"
-              x-webkit-airplay="true"
-              webkit-playsinline="true"
-              playsinline="true"
-              x5-video-player-type="h5"
-              x5-video-player-fullscreen="true"
-              :src="videoPath"
-              v-if="videoData != ''"
-              loop="loop"
-            >
-              <source src="movie.ogg" type="video/ogg" />
-              <source src="movie.mp4" type="video/mp4" />
-            </video>
-            <p v-else>{{ dockInfo.title }}</p>
+            <span v-if="dockInfo.room_id == '1006'">
+              <div id="ckplayera" class="h5video active"></div>
+            </span>
+            <span v-else>
+              <video
+                autoplay="autoplay"
+                controls="controls"
+                preload="meta"
+                x-webkit-airplay="true"
+                webkit-playsinline="true"
+                playsinline="true"
+                x5-video-player-type="h5"
+                x5-video-player-fullscreen="true"
+                :src="videoPath"
+                v-if="videoData != ''"
+                loop="loop"
+              >
+                <source src="movie.ogg" type="video/ogg" />
+                <source src="movie.mp4" type="video/mp4" />
+              </video>
+              <p v-else>{{ dockInfo.title }}</p>
+            </span>
           </el-col>
           <el-col :span="24" class="down">
             <el-button type="primary" size="mini" @click="back()">返回列表</el-button>
@@ -113,6 +115,7 @@ export default {
     }
     await this.search();
     await this.seachtVideo();
+    this.ckplayerb();
   },
   methods: {
     ...dock({ dockQuery: 'query', dockFetch: 'fetch' }),
@@ -169,9 +172,19 @@ export default {
     back() {
       this.$router.push({ path: '/live/index' });
     },
-  },
-  mounted() {
-    this.channelvideo();
+    ckplayerb() {
+      let rmtpUrl = `${process.env.VUE_APP_LIVE_URL + this.dockInfo.room_id}`;
+      setTimeout(function() {
+        var videoObjects = {
+          container: '#ckplayera',
+          variable: 'player',
+          autoplay: true,
+          live: true,
+          video: rmtpUrl,
+        };
+        let player = new ckplayer(videoObjects);
+      }, 2);
+    },
   },
   computed: {
     ...mapState(['user']),
@@ -187,8 +200,9 @@ export default {
 .main {
   .video {
     .top {
+      height: 215px;
       background-color: #000;
-      video {
+      .h5video {
         width: 100%;
         height: 215px;
       }