Share via


ClosedCaption Object

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The ClosedCaption object provides a way to include captions with a media clip. The captioning text is in a Synchronized Accessible Media Interchange (SAMI) file.

The ClosedCaption object supports the following properties.

Property Description
captioningID Specifies or retrieves the name of the frame or control displaying the captioning.
SAMIFileName Specifies or retrieves the name of the file containing the information needed for closed captioning.
SAMILang Specifies or retrieves the language displayed for closed captioning.
SAMILangCount Retrieves the number of languages supported by the current SAMI file.
SAMIStyle Specifies or retrieves the closed captioning style.
SAMIStyleCount Retrieves the number of styles supported by the current SAMI file.

 

The ClosedCaption object supports the following methods.

Method Description
getSAMILangID Retrieves the locale identifier (LCID) of a language supported by the current SAMI file.
getSAMILangName Retrieves the name of a language supported by the current SAMI file.
getSAMIStyleName Retrieves the name of a style supported by the current SAMI file.

 

The ClosedCaption object is accessed through the following property.

Object Property
Player closedCaption

 

See also

Adding Closed Captions to Digital Media

Object Model Reference for Scripting