mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-20 07:46:37 +00:00
Fix HLS on Android 9.0 (#2950)
* make sure can play type is "probably" * check hls.js first and then native
This commit is contained in:
parent
27b61776e8
commit
6ba77b4fa5
@ -58,15 +58,13 @@ class MoreInfoCamera extends UpdatingElement {
|
|||||||
videoEl.muted = true;
|
videoEl.muted = true;
|
||||||
|
|
||||||
// tslint:disable-next-line
|
// tslint:disable-next-line
|
||||||
let Hls: HLSModule | undefined;
|
const Hls = ((await import(/* webpackChunkName: "hls.js" */ "hls.js")) as any)
|
||||||
|
.default as HLSModule;
|
||||||
let hlsSupported =
|
let hlsSupported = Hls.isSupported();
|
||||||
videoEl.canPlayType("application/vnd.apple.mpegurl") !== "";
|
|
||||||
|
|
||||||
if (!hlsSupported) {
|
if (!hlsSupported) {
|
||||||
Hls = ((await import(/* webpackChunkName: "hls.js" */ "hls.js")) as any)
|
hlsSupported =
|
||||||
.default as HLSModule;
|
videoEl.canPlayType("application/vnd.apple.mpegurl") !== "";
|
||||||
hlsSupported = Hls.isSupported();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hlsSupported) {
|
if (hlsSupported) {
|
||||||
@ -76,7 +74,7 @@ class MoreInfoCamera extends UpdatingElement {
|
|||||||
this.stateObj.entity_id
|
this.stateObj.entity_id
|
||||||
);
|
);
|
||||||
|
|
||||||
if (Hls) {
|
if (Hls.isSupported()) {
|
||||||
this._renderHLSPolyfill(videoEl, Hls, url);
|
this._renderHLSPolyfill(videoEl, Hls, url);
|
||||||
} else {
|
} else {
|
||||||
this._renderHLSNative(videoEl, url);
|
this._renderHLSNative(videoEl, url);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user