NOTE: This page is a recollection of what I've written previously. I do not guarantee it's accuracy.
Video/audio playback in WebKit is made from multiple components:
HTMLVideoElement
coordinates it’sHTMLMediaElement
superclass, it’sMediaPlayer
, and aRenderVideo
.HTMLMediaElement
(also a superclass ofHTMLAudioElement
) coordinates between a the DOM of which it’s a part, aMediaPlayer
, tracks, security checks, aMediaResourceLoader
, and the UI controls.RenderVideo
composites videos into a page’s layout.MediaPlayer
wraps the underlying platform’s media decoding library, which for the GNOME stack is GStreamer. GStreamer in turn forms a pipeline between all the necessary codecs.MediaResourceLoader
is a little modified resource request not unlike images, etc.- The UI controls are somewhat platform-specific JavaScript and CSS files, constructing an ordinary JavaScript-based UI inside a “shadow-DOM” invisible to other JavaScripts.