This is an interesting idea and has a lot of merit. It does not solve all the use cases I need to solve, though, since the documentation I’m currently working on also needs to be able to present information about the capabilities of each codec and container outside the context of the specific element or API. But it does solve a significant part of the problem, and it’s true that we should have this information direclty in the context of the video and audio elements.
So I’ve slightly tweaked the suggestion made by @teoli and came up with the following. The __containers
object is located at the same level as the __compat
object and all of the element’s attributes.
"__containers": {
"mp4": {
"__compat": {
"support": {},
"status": {
"experimental": false,
"standard_track": true,
"deprecated": false
}
},
"h265": {
"__compat": {
"support": {
"firefox": {
"version_added": false
}
},
"status": {
"experimental": false,
"standard_track": true,
"deprecated": false
}
}
},
"mpeg2": {
"__compat": {
"support": {
"firefox": {
"version_added": "50"
}
},
"status": {
"experimental": false,
"standard_track": true,
"deprecated": false
}
}
},
"asp": {
"__compat": {
"support": {
"firefox": {
"version_added": false
}
},
"status": {
"experimental": false,
"standard_track": true,
"deprecated": false
}
}
},
"h264": {
"__compat": {
"support": {
"firefox": {
"version_added": true
}
},
"status": {
"experimental": false,
"standard_track": true,
"deprecated": false
}
}
}
},
"webm": {
"__compat": {
"support": {},
"status": {
"experimental": false,
"standard_track": true,
"deprecated": false
}
},
"vp8": {
"__compat": {
"support": {
"firefox": {
"version_added": "45"
}
},
"status": {
"experimental": false,
"standard_track": true,
"deprecated": false
}
}
},
"vp9": {
"__compat": {
"support": {
"firefox": {
"version_added": "47"
}
},
"status": {
"experimental": false,
"standard_track": true,
"deprecated": false
}
}
}
}
}
I’ve posted a complete JSON file with fake data for MP4 and WebM containers on the <video>
element. In Firefox at least, the built-in JSON viewer should make it pretty easy to look that over and get a better idea for the structure of the entire object.
If that passes muster for adding the information to BCD for now, then we’re in a good place to get a start. It doesn’t solve the problem of going from the name of a container and a codec to knowing whether or not it works in a particular browser, but it can answer what’s needed in the context of the element’s docs. That leaves me in the position of needing to find the answer to the other question still, but it’s a start…