fix autoplay mse video

This commit is contained in:
DIYgod
2018-01-11 16:51:29 +08:00
parent b7dcba30d8
commit ec160d1587
6 changed files with 19 additions and 18 deletions
+9 -8
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({
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
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",
+1 -1
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 () {
+6 -6
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);
}