mirror of
https://github.com/lrsjng/h5ai
synced 2026-01-03 22:52:24 +01:00
autoplay fix
This commit is contained in:
parent
aa94de4945
commit
5666ee9898
2 changed files with 12 additions and 0 deletions
|
|
@ -37,6 +37,12 @@ const load = item => {
|
|||
.attr('controls', 'controls');
|
||||
if (settings.autoplay) {
|
||||
$el.attr('autoplay', 'autoplay');
|
||||
$el.on('loadeddata', () => {
|
||||
var isPlaying = $el[0].currentTime > 0 && !$el[0].paused && !$el[0].ended;
|
||||
if (!isPlaying) {
|
||||
$el[0].play();
|
||||
}
|
||||
});
|
||||
}
|
||||
addUnloadFn($el[0]);
|
||||
$el.attr('src', item.absHref);
|
||||
|
|
|
|||
|
|
@ -41,6 +41,12 @@ const load = item => {
|
|||
.attr('controls', 'controls');
|
||||
if (settings.autoplay) {
|
||||
$el.attr('autoplay', 'autoplay');
|
||||
$el.on('loadeddata', () => {
|
||||
var isPlaying = $el[0].currentTime > 0 && !$el[0].paused && !$el[0].ended;
|
||||
if (!isPlaying) {
|
||||
$el[0].play();
|
||||
}
|
||||
});
|
||||
}
|
||||
addUnloadFn($el[0]);
|
||||
$el.attr('src', item.absHref);
|
||||
|
|
|
|||
Loading…
Reference in a new issue