Hi Dimka, since we need to enable support for self host multimedia file embedded, I think we need to add this media JS library file into your extension hook to make html5 video and audio tags work in our PUNBB.
media.min.js
IMHO, it more better than adding the 3rd party swf file (flash based) to make the self host audio and video file work with our PUNBB. In my trial error with my custom of your media extension, it work like a charm on both desktop and mobile (iPhone/Android) in our PUNBB with the common html5 multimedia tag.
eg:
<video src="video.mp4" width="320" height="200" controls preload></video>
<audio src="audio.mp3" controls preload></audio>
And if possible, you should add the support of some common video host like in vB cms too (eg: Hulu, Metacafe etc).