I have a bunch of mp4 files that are all encoded video with a high level profile of H264 4.x. We want to display them with HTML5 video for delivery through the device (from phones to connected TVs). I know that abstract files can play poorly on all devices, especially old ones, so we are considering alternatives (for example, displaying a warning message for a user or creating basic versions for files). I need to check JavaScript if this device can read the given profile and level of H264, and I'm not sure how it works exactly.
I read http://diveintohtml5.info/detect.html , which provides the following function
function supports_h264_baseline_video() {
if (!supports_video()) { return false; }
var v = document.createElement("video");
return v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');
}
This tells me about the basic H264 profile - how to define a high level H264 profile 4.1, for example?
user3863627
source
share