MediaResource Class

A media resource fetched by a media element, given to MediaBackend.CreatePlayer.

public sealed class MediaResource

Properties

NameDescription
ContentGets the bytes of the resource: the whole body of the response, or the bytes received so far when the response arrives over time (DocumentResource.RemainingContentBytes) and MediaResource.IsComplete is false.
ContentTypeGets the Content-Type of the response (or the type of the Blob), or null when there is none. It is a hint: the format of a media resource is sniffed.
IsCompleteGets a value indicating whether MediaResource.Content is the entire resource. Otherwise the player receives the rest of the resource as it arrives (MediaPlayer.OnDataReceived).
IsVideoElementGets a value indicating whether the resource is played by a video element, which paints the video frames (an audio element only plays the audio).
TimeProviderGets the clock of the event loop of the document of the media element (BrowsingContextOptions.TimeProvider): the clock of the media timeline.
UrlGets the URL of the response (after the redirects), or an empty string for a media provider object (a Blob assigned to srcObject).

Gets the bytes of the resource: the whole body of the response, or the bytes received so far when the response arrives over time (DocumentResource.RemainingContentBytes) and MediaResource.IsComplete is false.

public ReadOnlyMemory<byte> Content { get; }

Property value

ReadOnlyMemory<byte>

ContentType

MediaBackend.cs

Gets the Content-Type of the response (or the type of the Blob), or null when there is none. It is a hint: the format of a media resource is sniffed.

public string? ContentType { get; }

Property value

string?

IsComplete

MediaBackend.cs

Gets a value indicating whether MediaResource.Content is the entire resource. Otherwise the player receives the rest of the resource as it arrives (MediaPlayer.OnDataReceived).

public bool IsComplete { get; }

Property value

bool

IsVideoElement

MediaBackend.cs

Gets a value indicating whether the resource is played by a video element, which paints the video frames (an audio element only plays the audio).

public bool IsVideoElement { get; }

Property value

bool

TimeProvider

MediaBackend.cs

Gets the clock of the event loop of the document of the media element (BrowsingContextOptions.TimeProvider): the clock of the media timeline.

public TimeProvider TimeProvider { get; }

Property value

TimeProvider

Gets the URL of the response (after the redirects), or an empty string for a media provider object (a Blob assigned to srcObject).

public string Url { get; }

Property value

string