Share via


MediaPlayer.EnableCaptions Property

Gets or sets a value that indicates whether to enable closed captioning.

Namespace:  System.Web.UI.SilverlightControls
Assembly:  System.Web.Silverlight (in System.Web.Silverlight.dll)

Syntax

'Declaration
<ThemeableAttribute(True)> _
Public Overridable Property EnableCaptions As Boolean
    Get
    Set
'Usage
Dim instance As MediaPlayer
Dim value As Boolean

value = instance.EnableCaptions

instance.EnableCaptions = value
[ThemeableAttribute(true)]
public virtual bool EnableCaptions { get; set; }

Property Value

Type: System.Boolean
true if captions are displayed; otherwise, false. The default is true.

Remarks

When the EnableCaptions property is set to true, captions encoded in a media file appear in the CaptionArea element (if present) of the media player skin.

A caption has a position in the media file when its display starts. A caption is displayed until another caption is encountered during playback or the caption is set to an empty string.

Captions can be embedded in a media file when that file is encoded with a product such as Microsoft Expression Encoder. You can define captions in a media file using a Script Command with the name caption and the command value set to the text you wish to display as a caption.

The Script Command in the media file is detected as a marker when that position is reached as the media file is playing in the MediaPlayer control.

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference

MediaPlayer Class

MediaPlayer Members

System.Web.UI.SilverlightControls Namespace

OnClientMarkerReached

Other Resources

XAML Elements of the MediaPlayer Skin