The HTML output of the audio/video elements, their container, and their subelements, is currently kinda specific to the transformation with the Kaltura player... especially the popup transform mode that drops a big blob of HTML in an attribute.
Should clean up the HTML to be cleaner, and usable as a base for both old Kaltura player and VideoJS. Probably clean up the popup transform mode so it doesn't stick in all that stuff in the attribute... either load it separately (maybe via embed iframe?) or properly embed it in the markup tree.
Scrawling some notes at https://www.mediawiki.org/wiki/User:Brion_VIBBER/Media_rendering_encapsulation_2