MediaSource Constructors

Definition

Overloads

Name Description
MediaSource(Byte[], String, String)

Initializes a new instance of MediaSource with byte array data. A non-writable MemoryStream is created over the provided data. The byte array reference is not copied, so callers should not mutate it afterwards.

MediaSource(Stream, String, String)

Initializes a new instance of MediaSource from an existing stream. The stream reference is retained (not copied). The caller retains ownership and is responsible for disposal after the media has loaded. The stream must remain readable for the duration of the load.

MediaSource(Byte[], String, String)

Source:
MediaSource.cs

Initializes a new instance of MediaSource with byte array data. A non-writable MemoryStream is created over the provided data. The byte array reference is not copied, so callers should not mutate it afterwards.

public MediaSource(byte[] data, string mimeType, string cacheKey);
new Microsoft.AspNetCore.Components.Web.Media.MediaSource : byte[] * string * string -> Microsoft.AspNetCore.Components.Web.Media.MediaSource
Public Sub New (data As Byte(), mimeType As String, cacheKey As String)

Parameters

data
Byte[]

The media data as a byte array.

mimeType
String

The media MIME type.

cacheKey
String

The cache key used for caching and re-use.

Applies to

MediaSource(Stream, String, String)

Source:
MediaSource.cs

Initializes a new instance of MediaSource from an existing stream. The stream reference is retained (not copied). The caller retains ownership and is responsible for disposal after the media has loaded. The stream must remain readable for the duration of the load.

public MediaSource(System.IO.Stream stream, string mimeType, string cacheKey);
new Microsoft.AspNetCore.Components.Web.Media.MediaSource : System.IO.Stream * string * string -> Microsoft.AspNetCore.Components.Web.Media.MediaSource
Public Sub New (stream As Stream, mimeType As String, cacheKey As String)

Parameters

stream
Stream

The readable stream positioned at the beginning.

mimeType
String

The media MIME type.

cacheKey
String

The cache key.

Applies to