I am seeking a reliable method to determine if a mobile device can play HTTP Live Streaming (m3u8).
Currently, I am using the following script for testing purposes:
function isHLSEnabled() {
var videoElement = document.createElement('video'),
canPlayAppMpeg = videoElement.canPlayType('application/x-mpegURL'),
canPlayAppleMpeg = videoElement.canPlayType('vnd.apple.mpegURL');
return (
(canPlayAppMpeg == 'probably' || canPlayAppMpeg == 'maybe')
|| (canPlayAppleMpeg == 'probably' || canPlayAppleMpeg == 'maybe')
);
}
However, this script does not perform well on certain Samsung browsers (such as stock, dolphin, etc) - it returns false because the canPlayTypes are empty strings even though the video can still be played.
Are there any foolproof solutions for accurately detecting support for this type of streaming?