Meziantou.Framework.WebPlatform.Media namespace

Classes

NameDescription
DisplayCaptureRequestA request of getDisplayMedia(), given to MediaCaptureBackend.SelectDisplaySurface.
DisplayCaptureSelectionThe display surface chosen for getDisplayMedia() (see MediaCaptureBackend.SelectDisplaySurface).
MediaAudioDecoderAn audio decoder created by MediaCodecBackend.CreateAudioDecoder.
MediaAudioEncoderAn audio encoder created by MediaCodecBackend.CreateAudioEncoder.
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.
MediaCaptureBackendThe capture devices plugged into the browsing contexts (BrowsingContextOptions.MediaCapture): the cameras and the microphones of navigator.mediaDevices.getUserMedia() and enumerateDevices(), and the screen of getDisplayMedia(). The backend lists the devices and their capabilities, and produces the video frames and the audio samples of the devices it starts. The library implements Media Capture and Streams on top of it (https://w3c.github.io/mediacapture-main/): the permissions, the device identifiers, the constraint processing, the tracks and the streams.
MediaCaptureDeviceA capture device of a MediaCaptureBackend: a camera, a microphone, an audio output or a display surface.
MediaCaptureRequestA request to start a capture device, given to MediaCaptureBackend.StartCapture.
MediaCaptureSourceThe media produced by a capture device started by MediaCaptureBackend.StartCapture: the video frames of a camera or a screen, or the audio samples of a microphone. The library pulls the media when a sink needs it (a video element paints a frame, ImageCapture.grabFrame(), a Web Audio graph renders a quantum...).
MediaCaptureVideoModeA native video mode of a camera or a screen: its size and its frame rate.
MediaCodecBackendThe audio and video codecs plugged into the browsing contexts (BrowsingContextOptions.MediaCodecs): the implementations of the decoders and the encoders of WebCodecs (https://w3c.github.io/webcodecs/), also used by MediaRecorder. The backend tells which configurations it supports and creates the codec implementations; the library implements the codec processing model on top of them (the states, the control message queue, the queue sizes and the dequeue events, flush(), reset(), close(), the output and error callbacks, the validation and the cloning of the configurations, the decoder configuration of the encoded chunks).
MediaCodecImplementationThe base class of the codec implementations of a MediaCodecBackend. An operation that throws closes the codec: a DomException is given to the error callback as is, another exception as an EncodingError.
MediaCodecStringA codec string of the WebCodecs codec registry (https://w3c.github.io/webcodecs/codec_registry.html), parsed by MediaCodecString.TryParse: the codec and, for the video codecs, the profile, the level and the bit depth. The strings are case-sensitive and must be exact: an ambiguous string (e.g. vp9), a string with spaces, or a string whose profile or level is not defined (e.g. vp09.99.99.08) is rejected. A MediaCodecBackend can use it to answer the support of the configurations.
MediaEncodedAudioA chunk produced by a MediaAudioEncoder.
MediaEncodedVideoA chunk produced by a MediaVideoEncoder.
MediaEncryptionInitDataInitialization Data found in the media data (https://w3c.github.io/encrypted-media/#initialization-data), reported by the backend.
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.
MediaSampleEncryptionHow a coded frame of a media segment is encrypted (MediaCodedFrame.Encryption): the key that decrypts it, the initialization vector, and the ranges of the frame that are encrypted. The library decrypts the frame with the keys of the MediaKeys of the media element (Encrypted Media Extensions, https://w3c.github.io/encrypted-media/), and the playback waits for the key when no session has it.
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.
MediaVideoDecoderA video decoder created by MediaCodecBackend.CreateVideoDecoder.
MediaVideoEncoderA video encoder created by MediaCodecBackend.CreateVideoEncoder.
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.
MediaSubsampleA subsample of an encrypted sample: a range of clear bytes followed by a range of protected bytes.
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).
MediaCodecThe codecs of the WebCodecs codec registry (https://w3c.github.io/webcodecs/codec_registry.html).
MediaEncryptionSchemeThe protection scheme of an encrypted sample (ISO/IEC 23001-7, Common Encryption): the scheme_type of the schm box of an MP4 track, and the scheme of the encrypted blocks of WebM.
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).