The browser needs to know the mimetype of the video that is going to play. To build the html5 video tag the source tag must define the type attribute with the mimetype of the resource.
Building the media tag based on the mediatype of the resource to play. Doing it client-side instead of server-side.