MediaBreak Class

Definition

Represents a set of one or more MediaPlaybackItem objects that are played before, after, or at specified points during the playback of another MediaPlaybackItem.

public ref class MediaBreak sealed
/// [Windows.Foundation.Metadata.Activatable(Windows.Media.Playback.IMediaBreakFactory, 196608, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class MediaBreak final
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Media.Playback.IMediaBreakFactory), 196608, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 196608)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class MediaBreak
function MediaBreak(insertionMethod, presentationPosition)
Public NotInheritable Class MediaBreak
Inheritance
Object Platform::Object IInspectable MediaBreak
Attributes

Windows requirements

Device family
Windows 10 Anniversary Edition (introduced in 10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v3.0)

Remarks

Get a reference to the currently playing MediaBreak using the constructor or by accessing the CurrentBreak property of the MediaBreakManager. When a media break begins playing, you can get a reference to the associated MediaBreak object by handling the BreakStarted event and accessing the MediaBreak property of the MediaBreakStartedEventArgs passed into the handler.

Get or set a pre-roll or post-roll media break for a media item by accessing the PrerollBreak or PostrollBreak property of the MediaBreakSchedule object associated with a MediaPlaybackItem.

For how-to guidance for working with media breaks, see Create, schedule, and manage media breaks.

Constructors

MediaBreak(MediaBreakInsertionMethod, TimeSpan)

Initializes a new instance of the MediaBreak class with the specified insertion method and presentation position.

MediaBreak(MediaBreakInsertionMethod)

Initializes a new instance of the MediaBreak class with the specified insertion method.

Properties

CanStart

Gets or sets a value indicating whether the MediaBreak can be played.

CustomProperties

Gets a map of key/value pairs that allow you to associate custom data with a MediaBreak.

InsertionMethod

Gets a value indicating whether the media break will interrupt the main content, causing the main content to pause while it is played, or if it will replace the main content.

PlaybackList

Gets the MediaPlaybackList containing the MediaPlaybackItem objects that will be played as part of the MediaBreak.

PresentationPosition

Gets the position within the playback of a MediaPlaybackItem at which the MediaBreak will be played.

Applies to

See also