fix autoplay mse video

This commit is contained in:
DIYgod 2018-01-11 16:51:29 +08:00
parent b7dcba30d8
commit ec160d1587
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
6 changed files with 19 additions and 18 deletions

View File

@ -121,14 +121,15 @@ function initPlayers () {
// });
// // dp4
// window.dp4 = new DPlayer({
// container: document.getElementById('dplayer4'),
// preload: 'none',
// video: {
// url: 'https://moeplayer.b0.upaiyun.com/dplayer/hls/hikarunara.m3u8',
// type: 'hls'
// }
// });
window.dp4 = new DPlayer({
container: document.getElementById('dplayer4'),
preload: 'none',
autoplay: true,
video: {
url: 'https://moeplayer.b0.upaiyun.com/dplayer/hls/hikarunara.m3u8',
type: 'hls'
}
});
// // dp5
// window.dp5 = new DPlayer({

2
dist/DPlayer.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "dplayer",
"version": "1.18.0",
"version": "1.18.1",
"description": "Wow, such a lovely HTML5 danmaku video player",
"main": "dist/DPlayer.min.js",
"style": "dist/DPlayer.min.css",

View File

@ -230,7 +230,7 @@ class Controller {
hide () {
this.player.container.classList.add('dplayer-hide-controller');
this.player.setting.hide();
this.player.comment.hide();
this.player.comment && this.player.comment.hide();
}
isShow () {

View File

@ -126,6 +126,12 @@ class DPlayer {
this.time = new Time(this);
this.hotkey = new HotKey(this);
this.contextmenu = new ContextMenu(this);
this.initVideo(this.video, this.quality && this.quality.type || this.options.video.type);
if (!this.danmaku) {
// autoplay
if (this.options.autoplay && !utils.isMobile) {
@ -136,12 +142,6 @@ class DPlayer {
}
}
this.hotkey = new HotKey(this);
this.contextmenu = new ContextMenu(this);
this.initVideo(this.video, this.quality && this.quality.type || this.options.video.type);
index++;
instances.push(this);
}