MediaResource Class
A media resource fetched by a media element, given to MediaBackend.CreatePlayer.
public sealed class MediaResourceProperties
| Name | Description |
|---|---|
| Content | 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. |
| ContentType | 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. |
| IsComplete | 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). |
| IsVideoElement | 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). |
| TimeProvider | Gets the clock of the event loop of the document of the media element (BrowsingContextOptions.TimeProvider): the clock of the media timeline. |
| Url | Gets the URL of the response (after the redirects), or an empty string for a media provider object (a Blob assigned to srcObject). |
Content
MediaBackend.csGets 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
ContentType
MediaBackend.csIsComplete
MediaBackend.csGets 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
IsVideoElement
MediaBackend.csTimeProvider
MediaBackend.csGets 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; }