MediaClip MediaClip MediaClip MediaClip Class

Definition

Represents a single media object.

public : sealed class MediaClip : IMediaClippublic sealed class MediaClip : IMediaClipPublic NotInheritable Class MediaClip Implements IMediaClip// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Add media clips to a composition by adding them to a MediaComposition object's Clips collection.

For how-to guidance on adding media editing to your app, see Media compositions and editing.

Properties

AudioEffectDefinitions AudioEffectDefinitions AudioEffectDefinitions AudioEffectDefinitions

Gets the list of audio effect definitions for processing the media clip.

public : IVector<IAudioEffectDefinition> AudioEffectDefinitions { get; }public IList<IAudioEffectDefinition> AudioEffectDefinitions { get; }Public ReadOnly Property AudioEffectDefinitions As IList<IAudioEffectDefinition>// You can use this property in JavaScript.
Value
IVector<IAudioEffectDefinition> IList<IAudioEffectDefinition> IList<IAudioEffectDefinition> IList<IAudioEffectDefinition>

The list of audio effect definitions for processing the media clip.

EmbeddedAudioTracks EmbeddedAudioTracks EmbeddedAudioTracks EmbeddedAudioTracks

The list of embedded audio tracks in this media clip.

public : IVectorView<EmbeddedAudioTrack> EmbeddedAudioTracks { get; }public IReadOnlyList<EmbeddedAudioTrack> EmbeddedAudioTracks { get; }Public ReadOnly Property EmbeddedAudioTracks As IReadOnlyList<EmbeddedAudioTrack>// You can use this property in JavaScript.
Value
IVectorView<EmbeddedAudioTrack> IReadOnlyList<EmbeddedAudioTrack> IReadOnlyList<EmbeddedAudioTrack> IReadOnlyList<EmbeddedAudioTrack>

Each member in the list is an EmbeddedAudioTrack object.

EndTimeInComposition EndTimeInComposition EndTimeInComposition EndTimeInComposition

The time when the media clip stops playing within a MediaComposition.

public : TimeSpan EndTimeInComposition { get; }public TimeSpan EndTimeInComposition { get; }Public ReadOnly Property EndTimeInComposition As TimeSpan// You can use this property in JavaScript.
Value
TimeSpan TimeSpan TimeSpan TimeSpan

Time is measured relative to the beginning of the media clip.

OriginalDuration OriginalDuration OriginalDuration OriginalDuration

Original playback time of the media clip, without the effects of TrimTimeFromStart and TrimTimeFromEnd properties.

public : TimeSpan OriginalDuration { get; }public TimeSpan OriginalDuration { get; }Public ReadOnly Property OriginalDuration As TimeSpan// You can use this property in JavaScript.
Value
TimeSpan TimeSpan TimeSpan TimeSpan

The original duration of the media clip is equal to TrimmedDuration + TrimTimeFromStart + TrimTimeFromEnd.

SelectedEmbeddedAudioTrackIndex SelectedEmbeddedAudioTrackIndex SelectedEmbeddedAudioTrackIndex SelectedEmbeddedAudioTrackIndex

The index of the audio track within the media clip that is used for playback.

public : unsigned int SelectedEmbeddedAudioTrackIndex { get; set; }public uint SelectedEmbeddedAudioTrackIndex { get; set; }Public ReadWrite Property SelectedEmbeddedAudioTrackIndex As uint// You can use this property in JavaScript.
Value
unsigned int uint uint uint

The default value of 0 selects the first audio track within the media clip.

StartTimeInComposition StartTimeInComposition StartTimeInComposition StartTimeInComposition

The time when the media clip starts playing within a MediaComposition.

public : TimeSpan StartTimeInComposition { get; }public TimeSpan StartTimeInComposition { get; }Public ReadOnly Property StartTimeInComposition As TimeSpan// You can use this property in JavaScript.
Value
TimeSpan TimeSpan TimeSpan TimeSpan

Time is measured relative to the beginning of the media clip.

TrimmedDuration TrimmedDuration TrimmedDuration TrimmedDuration

Duration of the media clip with TrimTimeFromStart and TrimTimeFromEnd applied to playback.

public : TimeSpan TrimmedDuration { get; }public TimeSpan TrimmedDuration { get; }Public ReadOnly Property TrimmedDuration As TimeSpan// You can use this property in JavaScript.
Value
TimeSpan TimeSpan TimeSpan TimeSpan

The trimmed duration of the media clip is equal to OriginalDuration - (TrimTimeFromStart + TrimTimeFromEnd ).

TrimTimeFromEnd TrimTimeFromEnd TrimTimeFromEnd TrimTimeFromEnd

The amount of time to trim from the end of the media clip.

public : TimeSpan TrimTimeFromEnd { get; set; }public TimeSpan TrimTimeFromEnd { get; set; }Public ReadWrite Property TrimTimeFromEnd As TimeSpan// You can use this property in JavaScript.
Value
TimeSpan TimeSpan TimeSpan TimeSpan

The trim time must be greater than or equal to 0 and less than the length of the media clip.

TrimTimeFromStart TrimTimeFromStart TrimTimeFromStart TrimTimeFromStart

The amount of time to trim from the beginning of the media clip.

public : TimeSpan TrimTimeFromStart { get; set; }public TimeSpan TrimTimeFromStart { get; set; }Public ReadWrite Property TrimTimeFromStart As TimeSpan// You can use this property in JavaScript.
Value
TimeSpan TimeSpan TimeSpan TimeSpan

The trim time must be greater than or equal to 0 and less than the length of the media clip.

UserData UserData UserData UserData

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

public : IMap<string, string> UserData { get; }public IDictionary<string, string> UserData { get; }Public ReadOnly Property UserData As IDictionary<string, string>// You can use this property in JavaScript.
Value
IMap<PlatForm::String, PlatForm::String> IDictionary<string, string> IDictionary<string, string> IDictionary<string, string>

The values stored in the IMap must be strings. These values are app-defined and are not used by the operating system. You can use this collection to store, for example, a clip name, an application-related clip identifier, or a clip description.

VideoEffectDefinitions VideoEffectDefinitions VideoEffectDefinitions VideoEffectDefinitions

Gets the list of video effect definitions for processing the media clip.

public : IVector<IVideoEffectDefinition> VideoEffectDefinitions { get; }public IList<IVideoEffectDefinition> VideoEffectDefinitions { get; }Public ReadOnly Property VideoEffectDefinitions As IList<IVideoEffectDefinition>// You can use this property in JavaScript.
Value
IVector<IVideoEffectDefinition> IList<IVideoEffectDefinition> IList<IVideoEffectDefinition> IList<IVideoEffectDefinition>

The list of video effect definitions for processing the media clip.

Volume Volume Volume Volume

Gets or sets the volume of the media clip.

public : double Volume { get; set; }public double Volume { get; set; }Public ReadWrite Property Volume As double// You can use this property in JavaScript.
Value
double double double double

A value between 0 and 1 represents a reduction in the volume level of the media clip where 0 is silence and 1 is normal volume. A value greater than 1 represents a boost in the volume of the media clip.

Methods

Clone() Clone() Clone() Clone()

Creates a MediaClip object that is identical to this instance.

public : MediaClip Clone()public MediaClip Clone()Public Function Clone() As MediaClip// You can use this method in JavaScript.
Returns

A MediaClip object that is a copy of this instance.

CreateFromColor(Color, TimeSpan) CreateFromColor(Color, TimeSpan) CreateFromColor(Color, TimeSpan) CreateFromColor(Color, TimeSpan)

Creates a solid color video clip that displays a single color for a specified length of time. Solid color video clips are typically used to create an explicit gap between video segments.

public : static MediaClip CreateFromColor(Color color, TimeSpan originalDuration)public static MediaClip CreateFromColor(Color color, TimeSpan originalDuration)Public Static Function CreateFromColor(color As Color, originalDuration As TimeSpan) As MediaClip// You can use this method in JavaScript.
Parameters
color
Color Color Color Color

The color to display in the video clip.

originalDuration
TimeSpan TimeSpan TimeSpan TimeSpan

How long to display the color in the video clip.

Returns

A new media clip object containing the color-based video clip.

CreateFromFileAsync(IStorageFile) CreateFromFileAsync(IStorageFile) CreateFromFileAsync(IStorageFile) CreateFromFileAsync(IStorageFile)

Creates a video clip from a video file.

public : static IAsyncOperation<MediaClip> CreateFromFileAsync(IStorageFile file)public static IAsyncOperation<MediaClip> CreateFromFileAsync(IStorageFile file)Public Static Function CreateFromFileAsync(file As IStorageFile) As IAsyncOperation( Of MediaClip )// You can use this method in JavaScript.
Parameters
file
IStorageFile IStorageFile IStorageFile IStorageFile

A StorageFile object representing the source video file.

Returns

A new media clip object containing a video clip of the video file.

CreateFromImageFileAsync(IStorageFile, TimeSpan) CreateFromImageFileAsync(IStorageFile, TimeSpan) CreateFromImageFileAsync(IStorageFile, TimeSpan) CreateFromImageFileAsync(IStorageFile, TimeSpan)

Creates a video clip that displays a single image for a specified length of time.

public : static IAsyncOperation<MediaClip> CreateFromImageFileAsync(IStorageFile file, TimeSpan originalDuration)public static IAsyncOperation<MediaClip> CreateFromImageFileAsync(IStorageFile file, TimeSpan originalDuration)Public Static Function CreateFromImageFileAsync(file As IStorageFile, originalDuration As TimeSpan) As IAsyncOperation( Of MediaClip )// You can use this method in JavaScript.
Parameters
file
IStorageFile IStorageFile IStorageFile IStorageFile

A StorageFile object representing the source image file.

originalDuration
TimeSpan TimeSpan TimeSpan TimeSpan

How long to display the image in the video clip.

Returns

CreateFromSurface(IDirect3DSurface, TimeSpan) CreateFromSurface(IDirect3DSurface, TimeSpan) CreateFromSurface(IDirect3DSurface, TimeSpan) CreateFromSurface(IDirect3DSurface, TimeSpan)

Creates a video clip from a Microsoft Direct3D surface.

public : static MediaClip CreateFromSurface(IDirect3DSurface surface, TimeSpan originalDuration)public static MediaClip CreateFromSurface(IDirect3DSurface surface, TimeSpan originalDuration)Public Static Function CreateFromSurface(surface As IDirect3DSurface, originalDuration As TimeSpan) As MediaClip// You can use this method in JavaScript.
Parameters
surface
IDirect3DSurface IDirect3DSurface IDirect3DSurface IDirect3DSurface

The Microsoft Direct3D surface.

originalDuration
TimeSpan TimeSpan TimeSpan TimeSpan

The initial duration of the created video clip.

Returns

A new media clip object containing the video clip.

GetVideoEncodingProperties() GetVideoEncodingProperties() GetVideoEncodingProperties() GetVideoEncodingProperties()

Gets the VideoEncodingProperties for the media clip.

public : VideoEncodingProperties GetVideoEncodingProperties()public VideoEncodingProperties GetVideoEncodingProperties()Public Function GetVideoEncodingProperties() As VideoEncodingProperties// You can use this method in JavaScript.
Returns

See Also