Skip to content

Fix HLS on Android 9.0#2950

Merged
balloob merged 2 commits intohome-assistant:devfrom
hunterjm:fix-hls-android
Mar 17, 2019
Merged

Fix HLS on Android 9.0#2950
balloob merged 2 commits intohome-assistant:devfrom
hunterjm:fix-hls-android

Conversation

@hunterjm
Copy link
Copy Markdown
Member

@hunterjm hunterjm commented Mar 16, 2019

This fixes #2948. The issue is Chrome on Android 9.0 was returning "maybe" for canPlayType (docs), but was unable to actually play the media. This PR checks HLS.js before "native" support, then falls back to MJPEG.

@hunterjm
Copy link
Copy Markdown
Member Author

Hold off on this. Apparently iOS Safari returns maybe here. Will need to check HLS.js first, and fall back to native before going to MJPEG.

@hunterjm
Copy link
Copy Markdown
Member Author

The latest commit is confirmed working in Chrome and Safari on their respective mobile emulators (Android 9.0, and iOS 12) and desktop.

);

if (Hls) {
if (Hls.isSupported()) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird. Does hls better check for supported than native? We can check the return type of can play too

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So HLS.js just have to check if MediaSourceExtension is supported, which is an easy check on the window. I have no clue why canPlayType returns an empty string, maybe, or probably. All 3 of them sound pretty uncertain. All the demos I’ve looked at use HLS.js first and fallback to canPlayType, then unsupported.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@balloob balloob merged commit 6ba77b4 into home-assistant:dev Mar 17, 2019
@ghost ghost removed the in progress label Mar 17, 2019
@balloob balloob mentioned this pull request Mar 17, 2019
@hunterjm hunterjm deleted the fix-hls-android branch March 24, 2019 03:33
@github-actions github-actions bot locked and limited conversation to collaborators Jul 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New Stream Player Not Loading On Android Phone

3 participants