Kaynağa Gözat

dash 播放有点问题,但在 vlc 中播放正常,考虑换个播放器

reghao 4 yıl önce
ebeveyn
işleme
fb82a7ba84

+ 75 - 2
package-lock.json

@@ -3479,6 +3479,11 @@
         "q": "^1.1.2"
       }
     },
+    "codem-isoboxer": {
+      "version": "0.3.6",
+      "resolved": "https://registry.nlark.com/codem-isoboxer/download/codem-isoboxer-0.3.6.tgz",
+      "integrity": "sha1-hn9nBFm4gdRPORaNX/Ko8UwWFR0="
+    },
     "collection-visit": {
       "version": "1.0.0",
       "resolved": "https://registry.npm.taobao.org/collection-visit/download/collection-visit-1.0.0.tgz",
@@ -4150,6 +4155,26 @@
         "assert-plus": "^1.0.0"
       }
     },
+    "dashjs": {
+      "version": "4.2.0",
+      "resolved": "https://registry.npmmirror.com/dashjs/download/dashjs-4.2.0.tgz",
+      "integrity": "sha512-bDXsBKTniuyI8NomZOuxdtbmfiGRxQiiK4Nx/GG5ysLXKVnVRHAXCqI0j2/dPx2BgZHlOmbE9LeDwyS1yHKTLQ==",
+      "requires": {
+        "codem-isoboxer": "0.3.6",
+        "es6-promise": "^4.2.8",
+        "fast-deep-equal": "2.0.1",
+        "html-entities": "^1.2.1",
+        "imsc": "^1.0.2",
+        "localforage": "^1.7.1"
+      },
+      "dependencies": {
+        "fast-deep-equal": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-2.0.1.tgz?cache=0&sync_timestamp=1591599604098&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-deep-equal%2Fdownload%2Ffast-deep-equal-2.0.1.tgz",
+          "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk="
+        }
+      }
+    },
     "de-indent": {
       "version": "1.0.2",
       "resolved": "https://registry.npm.taobao.org/de-indent/download/de-indent-1.0.2.tgz",
@@ -4693,6 +4718,11 @@
         }
       }
     },
+    "eme-encryption-scheme-polyfill": {
+      "version": "2.0.3",
+      "resolved": "https://registry.nlark.com/eme-encryption-scheme-polyfill/download/eme-encryption-scheme-polyfill-2.0.3.tgz",
+      "integrity": "sha1-LKbgZIDgbM615Q79J5Q6xGyVmHg="
+    },
     "emoji-regex": {
       "version": "8.0.0",
       "resolved": "https://registry.npm.taobao.org/emoji-regex/download/emoji-regex-8.0.0.tgz",
@@ -6034,8 +6064,7 @@
     "html-entities": {
       "version": "1.3.1",
       "resolved": "https://registry.npm.taobao.org/html-entities/download/html-entities-1.3.1.tgz?cache=0&sync_timestamp=1586616304085&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhtml-entities%2Fdownload%2Fhtml-entities-1.3.1.tgz",
-      "integrity": "sha1-+5oaS1sUxdq6gtPjTGrk/nAaDkQ=",
-      "dev": true
+      "integrity": "sha1-+5oaS1sUxdq6gtPjTGrk/nAaDkQ="
     },
     "html-minifier": {
       "version": "3.5.21",
@@ -6265,6 +6294,11 @@
       "integrity": "sha1-dQ49tYYgh7RzfrrIIH/9HvJ7Jfw=",
       "dev": true
     },
+    "immediate": {
+      "version": "3.0.6",
+      "resolved": "https://registry.npm.taobao.org/immediate/download/immediate-3.0.6.tgz",
+      "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps="
+    },
     "import-cwd": {
       "version": "2.1.0",
       "resolved": "https://registry.npm.taobao.org/import-cwd/download/import-cwd-2.1.0.tgz",
@@ -6303,6 +6337,21 @@
         "resolve-cwd": "^2.0.0"
       }
     },
+    "imsc": {
+      "version": "1.1.3",
+      "resolved": "https://registry.npmmirror.com/imsc/download/imsc-1.1.3.tgz",
+      "integrity": "sha512-IY0hMkVTNoqoYwKEp5UvNNKp/A5jeJUOrIO7judgOyhHT+xC6PA4VBOMAOhdtAYbMRHx9DTgI8p6Z6jhYQPFDA==",
+      "requires": {
+        "sax": "1.2.1"
+      },
+      "dependencies": {
+        "sax": {
+          "version": "1.2.1",
+          "resolved": "http://registry.npm.taobao.org/sax/download/sax-1.2.1.tgz",
+          "integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o="
+        }
+      }
+    },
     "imurmurhash": {
       "version": "0.1.4",
       "resolved": "https://registry.npm.taobao.org/imurmurhash/download/imurmurhash-0.1.4.tgz",
@@ -7032,6 +7081,14 @@
         "type-check": "~0.3.2"
       }
     },
+    "lie": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npm.taobao.org/lie/download/lie-3.1.1.tgz",
+      "integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=",
+      "requires": {
+        "immediate": "~3.0.5"
+      }
+    },
     "lines-and-columns": {
       "version": "1.1.6",
       "resolved": "https://registry.npm.taobao.org/lines-and-columns/download/lines-and-columns-1.1.6.tgz",
@@ -7117,6 +7174,14 @@
         }
       }
     },
+    "localforage": {
+      "version": "1.10.0",
+      "resolved": "https://registry.npmmirror.com/localforage/download/localforage-1.10.0.tgz",
+      "integrity": "sha1-XEZdxfYrKAfDqEwMahsbMhJ4HdQ=",
+      "requires": {
+        "lie": "3.1.1"
+      }
+    },
     "locate-path": {
       "version": "3.0.0",
       "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-3.0.0.tgz?cache=0&sync_timestamp=1597082033698&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flocate-path%2Fdownload%2Flocate-path-3.0.0.tgz",
@@ -9871,6 +9936,14 @@
         "safe-buffer": "^5.0.1"
       }
     },
+    "shaka-player": {
+      "version": "3.2.1",
+      "resolved": "https://registry.npmmirror.com/shaka-player/download/shaka-player-3.2.1.tgz",
+      "integrity": "sha1-vHo8NADrggTEqixhvEL/obCLIo8=",
+      "requires": {
+        "eme-encryption-scheme-polyfill": "^2.0.3"
+      }
+    },
     "shallow-clone": {
       "version": "3.0.1",
       "resolved": "https://registry.npm.taobao.org/shallow-clone/download/shallow-clone-3.0.1.tgz",

+ 1 - 0
package.json

@@ -10,6 +10,7 @@
   "dependencies": {
     "core-js": "^3.6.5",
     "crypto-js": "^4.1.1",
+    "dashjs": "^4.2.0",
     "dplayer": "^1.26.0",
     "element-ui": "2.13.2",
     "filepond": "^4.20.1",

+ 8 - 1
src/components/player/player.vue

@@ -5,6 +5,7 @@
 <script>
 import { videoUrl } from '@/api/media/video'
 import DPlayer from 'dplayer'
+const dashjs = require('dashjs')
 const flv = require('flv.js')
 const hls = require('hls.js')
 export default {
@@ -85,7 +86,13 @@ export default {
         video: {
           pic: coverUrl,
           url: videoUrl,
-          type: 'auto'
+          // type: 'auto'
+          type: 'customDash',
+          customType: {
+            customDash: function(video, player) {
+              dashjs.MediaPlayer().create().initialize(video, video.src, false)
+            }
+          }
         },
         logo: '/logo.png',
         danmaku: {

+ 6 - 2
src/layout/components/head.vue

@@ -46,7 +46,7 @@ export default {
     return {
       userInfo: {},
       headItem: [
-        { icon: 'mdi-account', text: '个人主页', link: '/user/', id: 0 },
+        { icon: 'mdi-account', text: '个人中心', link: '/studio', id: 0 },
         { icon: 'mdi-cash-usd', text: '付费会员', link: '/vip', id: 3 },
         { icon: 'mdi-application', text: '创作中心', link: '/studio', id: 1 },
         { icon: 'mdi-wrench', text: '自定义频道', link: '/user/setting', id: 4 },
@@ -61,7 +61,11 @@ export default {
     headClick(value) {
       if (value === 0) {
         // this.$router.push('/user/' + this.userInfo.id)
-        location.replace('/user/' + this.userInfo.id)
+        // location.replace('/user/' + this.userInfo.id)
+        if (this.$route.path === '/studio') {
+          return
+        }
+        this.$router.push('/studio')
       } else if (value === 1) {
         if (this.$route.path === '/studio') {
           return

+ 1 - 1
src/layout/index.vue

@@ -106,7 +106,7 @@ export default {
 
     ],
     headItem: [
-      { icon: 'mdi-head', text: '个人主页', link: '/user/', id: 0 },
+      { icon: 'mdi-head', text: '个人中心', link: '/studio', id: 0 },
       { icon: 'mdi-wrench', text: '创作中心', link: '/studio', id: 1 },
       { icon: 'mdi-logout', text: '退出', link: '/logout', id: 2 }
     ]

+ 12 - 10
src/layout/studio.vue

@@ -65,7 +65,7 @@
         style="width: 300px"
         class="ml-0 pl-4"
       >
-        <span class="hidden-sm-and-down">{{ this.$store.state.webInfo.name }} Studio 创作中心</span>
+        <span style="cursor:pointer" @click="goToHome()">{{ this.$store.state.webInfo.name }}</span>
       </v-toolbar-title>
       <v-text-field
         flat
@@ -111,13 +111,10 @@
       >
         <v-icon left dark>mdi-account</v-icon> 登录
       </v-btn>
-
     </v-app-bar>
 
     <v-main>
-
       <router-view />
-
     </v-main>
   </div>
 </template>
@@ -133,13 +130,13 @@ export default {
     CheckPower,
     drawer: true,
     items: [
-      { icon: 'mdi-application', text: '信息中心', link: '/studio' },
-      { icon: 'mdi-filmstrip-box-multiple', text: '稿列表', link: '/studio/list' },
+      { icon: 'mdi-application', text: '个人主页', link: '/studio' },
+      { icon: 'mdi-filmstrip-box-multiple', text: '稿列表', link: '/studio/list' },
       { icon: 'mdi-upload', text: '投稿', link: '/studio/upload' },
       { icon: 'mdi-database', text: '数据分析', link: '/studio/data' },
-      { icon: 'mdi-account-multiple', text: '粉丝管理', link: '/studio/fans' }
-      //   { icon: 'mdi-history', text: '历史记录', link: '/history' },
-      //   { icon: 'mdi-playlist-play', text: '稍后再看', link: '/playlist' }
+      { icon: 'mdi-account-multiple', text: '粉丝管理', link: '/studio/fans' },
+      { icon: 'mdi-cash-usd', text: '付费会员', link: '/vip' },
+      { icon: 'mdi-wrench', text: '自定义频道', link: '/user/setting' }
     ],
     adminList: [
       { icon: 'mdi-application', text: '邀请码', link: '/studio/admin/invitation' },
@@ -169,8 +166,13 @@ export default {
     },
     goToUserHome() {
       this.$router.push('/user/' + this.$store.state.user.userInfo.id)
+    },
+    goToHome() {
+      if (this.$route.path === '/') {
+        return
+      }
+      this.$router.push('/')
     }
-
   }
 }
 </script>

+ 1 - 1
src/router/index.js

@@ -99,7 +99,7 @@ const routes = [
         name: 'StudioIndex',
         component: () => import('@/views/studio/index.vue'),
         meta: {
-          title: '创作中心',
+          title: '个人主页',
           requireAuth: true
         }
       },