fix autoplay mse video
This commit is contained in:
parent
b7dcba30d8
commit
ec160d1587
17
demo/demo.js
17
demo/demo.js
|
|
@ -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({
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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 () {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue