According to this answer, to test the browser's capabilities to play HLS video, the MIME application/x-mpegURL
can be used.
But the problem with this approach is that it is returning maybe
for iPhone (actually supports HLS) as well as for Firefox for Android (which doesn't support). Though this works well by returning an empty string in case of desktop browsers such as Chrome and Firefox.
Is there any precise way to check for HLS support in a browser?
HTML5test.com could able to predict the HLS support precisely as Yes or No. How is this functioning?
At source code at linked page see
engine.js
at lines2405-2533
whereHTMLMediaElement.canPlayType()
is usedSee also Apple HTTP Live Streaming (HLS)