Meziantou.Framework.WebPlatform.Media namespace

Classes

NameDescription
MediaBackendThe media pipeline plugged into the browsing contexts (BrowsingContextOptions.MediaBackend): it tells which media types can be played, reads the media resources fetched by the audio and video elements (their duration, their dimensions, their tracks) and plays them. The library never decodes audio or video by itself: it implements the processing model of the media elements (the resource selection, the fetch of the resource, the ready states, the events, the promises of play(), seeking, looping...) on top of the MediaPlayer the backend creates for each media resource.
MediaInitializationSegmentAn initialization segment of a SourceBuffer (https://w3c.github.io/media-source/#init-segment): the tracks of the next media segments.
MediaPlayerThe player of a media resource of a media element, created by MediaBackend.CreatePlayer: it gives the metadata of the resource (the duration, the dimensions, the tracks, the buffered and seekable ranges), holds the current playback position and gives the video frame to paint. The media element implements the rest: the ready states and the network states, the events, the promises of play(), loop, ended, played...
MediaResourceA media resource fetched by a media element, given to MediaBackend.CreatePlayer.
MediaSegmentParseResultThe result of MediaSegmentParser.Parse.
MediaSegmentParserThe byte stream parser of a SourceBuffer of the Media Source Extensions (https://w3c.github.io/media-source/#byte-stream-formats), created by MediaBackend.CreateSegmentParser for the MIME type of addSourceBuffer() or changeType(): it splits the bytes appended by appendBuffer() into initialization segments (the tracks) and media segments (the coded frames: their timestamps, their durations and whether they are random access points). The library implements the rest of the specification on top of it: the segment parser loop, the coded frame processing algorithm (timestampOffset, mode, the append window), the track buffers and their buffered ranges, the removals, the duration, the ready states of the media element...
MediaSegmentTrackA track of an initialization segment (MediaInitializationSegment).
MediaTextTrackCueA cue of a text track of a media resource, exposed as a VTTCue.
MediaTextTrackInfoA text track of a media resource (https://html.spec.whatwg.org/multipage/media.html#media-resource-specific-text-track), reported by a MediaPlayer, with its cues.
MediaTrackInfoAn audio or video track of a media resource (https://html.spec.whatwg.org/multipage/media.html#media-resources-with-multiple-media-tracks), reported by a MediaPlayer.
MediaVideoFrameA frame of a video, painted in the box of the video element by the rendering backend of the browsing context and drawn by drawImage(): pixels in the RGBA format (4 bytes per pixel, not premultiplied, sRGB), from the top-left pixel, row by row.

Structs

NameDescription
MediaCodedFrameA coded frame of a media segment (https://w3c.github.io/media-source/#coded-frame): the library stores its position on the media timeline, not its data.
MediaTimeRangeA range of the media timeline, in seconds (a range of a TimeRanges object).

Enums

NameDescription
MediaAutoplayPolicyWhether the media elements are allowed to play without a user gesture (BrowsingContextOptions.MediaAutoplayPolicy).
MediaPlayerErrorA fatal error of a MediaPlayer (https://html.spec.whatwg.org/multipage/media.html#error-codes).
MediaReadyStateHow much of a media resource is available to render the current playback position (https://html.spec.whatwg.org/multipage/media.html#ready-states). A MediaPlayer is created once the metadata is known, so its state is at least MediaReadyState.HaveMetadata.
MediaSegmentParseStatusWhat MediaSegmentParser.Parse found at the start of the input buffer of a SourceBuffer.
MediaTypeSupportThe answer of MediaBackend.CanPlayType (https://html.spec.whatwg.org/multipage/media.html#dom-navigator-canplaytype).