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;
|
||||
|
||||
// tslint:disable-next-line
|
||||
let Hls: HLSModule | undefined;
|
||||
|
||||
let hlsSupported =
|
||||
videoEl.canPlayType("application/vnd.apple.mpegurl") !== "";
|
||||
const Hls = ((await import(/* webpackChunkName: "hls.js" */ "hls.js")) as any)
|
||||
.default as HLSModule;
|
||||
let hlsSupported = Hls.isSupported();
|
||||
|
||||
if (!hlsSupported) {
|
||||
Hls = ((await import(/* webpackChunkName: "hls.js" */ "hls.js")) as any)
|
||||
.default as HLSModule;
|
||||
hlsSupported = Hls.isSupported();
|
||||
hlsSupported =
|
||||
videoEl.canPlayType("application/vnd.apple.mpegurl") !== "";
|
||||
}
|
||||
|
||||
if (hlsSupported) {
|
||||
@ -76,7 +74,7 @@ class MoreInfoCamera extends UpdatingElement {
|
||||
this.stateObj.entity_id
|
||||
);
|
||||
|
||||
if (Hls) {
|
||||
if (Hls.isSupported()) {
|
||||
this._renderHLSPolyfill(videoEl, Hls, url);
|
||||
} else {
|
||||
this._renderHLSNative(videoEl, url);
|
||||
|
Loading…
x
Reference in New Issue
Block a user