|
|
@@ -59,7 +59,7 @@ export default {
|
|
|
urls.forEach(u => u.type = 'normal')
|
|
|
this.initMp4Player(urls, currentTime)
|
|
|
} else if (type === 'flv') {
|
|
|
- this.initFlvPlayer(urls, currentTime)
|
|
|
+ this.$message.error('flv player not implement')
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
@@ -81,29 +81,6 @@ export default {
|
|
|
this.player.seek(pos)
|
|
|
this.bindEvents()
|
|
|
},
|
|
|
- initFlvPlayer(urls, pos) {
|
|
|
- this.player = new DPlayer({
|
|
|
- container: this.$refs.dplayerContainer,
|
|
|
- lang: 'zh-cn',
|
|
|
- screenshot: true,
|
|
|
- volume: 0.1,
|
|
|
- video: {
|
|
|
- pic: this.videoData.coverUrl,
|
|
|
- defaultQuality: 0,
|
|
|
- quality: urls,
|
|
|
- type: 'customFlv',
|
|
|
- customType: {
|
|
|
- customFlv: (video) => {
|
|
|
- const flvPlayer = flvjs.createPlayer({ type: 'flv', url: video.src })
|
|
|
- flvPlayer.attachMediaElement(video)
|
|
|
- flvPlayer.load()
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- this.player.seek(pos)
|
|
|
- this.bindEvents()
|
|
|
- },
|
|
|
bindEvents() {
|
|
|
let ended = false
|
|
|
this.player.on('play', () => {
|
|
|
@@ -173,4 +150,14 @@ export default {
|
|
|
@media screen and (max-width: 768px) {
|
|
|
#dplayer { height: 240px; }
|
|
|
}
|
|
|
+
|
|
|
+/* 隐藏网页全屏按钮(左侧那个按钮) */
|
|
|
+::v-deep .dplayer-full-in-icon {
|
|
|
+ display: none !important;
|
|
|
+}
|
|
|
+
|
|
|
+/* 调整剩下的全屏按钮间距,防止右侧留白过大 */
|
|
|
+::v-deep .dplayer-full-icon {
|
|
|
+ margin-right: 5px !important;
|
|
|
+}
|
|
|
</style>
|