mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
Fix iOS audio (#11863)
This commit is contained in:
parent
6907fa5c8e
commit
298296a81f
@ -25,6 +25,7 @@ export class BrowserMediaPlayer {
|
||||
private onChange: () => void
|
||||
) {
|
||||
const player = new Audio(this.resolved.url);
|
||||
player.autoplay = true;
|
||||
player.volume = volume;
|
||||
player.addEventListener("play", this._handleChange);
|
||||
player.addEventListener("playing", () => {
|
||||
@ -33,15 +34,7 @@ export class BrowserMediaPlayer {
|
||||
});
|
||||
player.addEventListener("pause", this._handleChange);
|
||||
player.addEventListener("ended", this._handleChange);
|
||||
player.addEventListener("canplaythrough", () => {
|
||||
if (this._removed) {
|
||||
return;
|
||||
}
|
||||
if (this.buffering) {
|
||||
player.play();
|
||||
}
|
||||
this.onChange();
|
||||
});
|
||||
player.addEventListener("canplaythrough", this._handleChange);
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user