|
|
@@ -48,7 +48,8 @@ export default {
|
|
|
for (const url of urls) {
|
|
|
url.type = 'normal'
|
|
|
}
|
|
|
- this.initMp4Player(this.videoProp.userId, videoId, this.videoProp.coverUrl, urls, res.data.currentTime)
|
|
|
+ const autoPlay = false
|
|
|
+ this.initMp4Player(this.videoProp.userId, videoId, this.videoProp.coverUrl, urls, res.data.currentTime, autoPlay)
|
|
|
} else if (urlType === 'flv') {
|
|
|
const urls = res.data.urls
|
|
|
const url = urls[0].url
|
|
|
@@ -78,13 +79,13 @@ export default {
|
|
|
danmakuConfig() {
|
|
|
// TODO 获取弹幕配置,将 videoUrl 作为本函数的回调
|
|
|
},
|
|
|
- initMp4Player(userId, videoId, coverUrl, urls, pos) {
|
|
|
+ initMp4Player(userId, videoId, coverUrl, urls, pos, autoPlay) {
|
|
|
const player = new DPlayer({
|
|
|
container: document.querySelector('#dplayer'),
|
|
|
lang: 'zh-cn',
|
|
|
logo: '/logo.png',
|
|
|
screenshot: false,
|
|
|
- autoplay: true,
|
|
|
+ autoplay: autoPlay,
|
|
|
volume: 0.1,
|
|
|
mutex: true,
|
|
|
video: {
|