ClosedCaption.SAMIStyle
[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 SAMIStyle property specifies or retrieves the closed captioning style.
player.closedCaption.SAMIStyle
Possible Values
This property is a read/write String.
Remarks
A SAMI file can contain several format style definitions. SAMI styles are defined between the <STYLE> and tags in the SAMI file. A style is defined with a text string preceded by a # character. For example:
#Emphasis1 {Name: Big Bold Italic; font-size: 14pt; text-align: center;
color: blue; font-family: sans-serif; font-weight: bold;
font-style: italic;}
This specifies a style that produces a particular font.
If no SAMI style is specified, the first style defined in the SAMI file is used by default.
Windows Media Player 10 Mobile: This property is read only, and always returns an empty string.
Examples
The following JScript example creates an HTML SELECT element that uses closedCaption.SAMIStyle to change the appearance of the closed caption text. The Player object was created with ID = "Player".
<!-- Create the SELECT element. -->
<SELECT ID = CCMode NAME = "CCMode" LANGUAGE = "JScript"
/* Change the text style when the SELECT element changes. */
onChange = "Player.closedCaption.SAMIStyle = CCMode.value;
">
/* Fill the SELECT list with options, set the default to Strong. */
<OPTION VALUE = "Normal">Normal
<OPTION VALUE = "Small">Small
<OPTION VALUE = "Big Bold Italic" SELECTED>Strong
</SELECT>
Requirements
Requirement | Value |
---|---|
Version |
Windows Media Player version 7.0 or later. |
DLL |
|