MediaComposition Class

Definition

Represents a collection of media clips and background audio tracks.

C#
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.GCPressure]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class MediaComposition
C#
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.GCPressure]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class MediaComposition
Inheritance
Object MediaComposition
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Constructors

MediaComposition()

Initializes a new instance of the MediaComposition class.

Properties

BackgroundAudioTracks

A collection of background audio tracks for playback in the media composition.

Clips

A collection of media clips for playback in the media composition.

Duration

The total playback time of the media composition.

OverlayLayers

Gets the list of overlay layers for the media composition.

UserData

An associative collection for storing custom properties associated with the media composition.

Methods

Clone()

Creates a MediaComposition object that is identical to this instance.

CreateDefaultEncodingProfile()

Create a new default media encoding profile which can be modified if necessary.

GenerateMediaStreamSource()

Creates a new MediaStreamSource.

GenerateMediaStreamSource(MediaEncodingProfile)

Creates a new MediaStreamSource using the specified MediaEncodingProfile.

GeneratePreviewMediaStreamSource(Int32, Int32)

Creates a new MediaStreamSource used to preview the edited media.

GetThumbnailAsync(TimeSpan, Int32, Int32, VideoFramePrecision)

Asynchronously gets an image stream that represents a thumbnail of the media composition.

GetThumbnailsAsync(IIterable<TimeSpan>, Int32, Int32, VideoFramePrecision)

Asynchronously gets a vector view of thumbnails of the media composition.

LoadAsync(StorageFile)

Asynchronously loads a MediaComposition from a StorageFile.

RenderToFileAsync(IStorageFile, MediaTrimmingPreference, MediaEncodingProfile)

Asynchronously renders the MediaComposition to a specified file using the indicated media trimming preference and encoding profile.

RenderToFileAsync(IStorageFile, MediaTrimmingPreference)

Asynchronously renders the MediaComposition to a specified file using the indicated media trimming preference.

RenderToFileAsync(IStorageFile)

Asynchronously renders the MediaComposition to the specified file.

SaveAsync(IStorageFile)

Asynchronously serializes the MediaComposition to disk so that it can be loaded and modified in the future.

Applies to

Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100