MediaCenter Object
Enables HTML applications to access various Windows Media Center features and functionality that occur outside of the HTML host. For example, an HTML application can use the object to add songs to the playlist, display Windows Media Center dialog boxes, and play a particular type of media.
Note Hosted HTML has been deprecated. To use the new features of the Windows Media Center SDK, you must develop a Windows Media Center Presentation Layer application. However, if you still want to develop a hosted HTML application or update an existing application, you can download and use the previous version of the Windows Media Center SDK from the Microsoft Download Center.
The MediaCenter object exposes the following properties:
Property | Description |
AudioMixer | Gets the AudioMixer object representing the current mute state and volume level. |
BGColor | Sets the background color of the areas of Windows Media Center that are visible when an HTML application is running. |
Capabilities | Gets the Capabilities object representing the current capabilities of the system. |
Context | Gets an application-defined string that is associated with an application entry point. |
CustomViewPort | Gets the CustomViewPort object representing the current state of the custom view port. |
DirectXExclusive | Gets a value that indicates whether Windows Media Center is running in the DirectX exclusive mode. |
EnableOnLoadOnReturnFromMediaCenter | Gets a value that indicates whether an HTML page receives the onLoad event when the user returns to the page after having navigated away from it. |
Experience | Gets the Experience object representing the state of the currently playing media. |
HighContrast | Gets a value that indicates whether Windows Media Center is running on a computer for which the Windows high-contrast accessibility option is currently selected. |
IsForegroundApplication | Gets a value that indicates whether the calling application is the current foreground application in the Windows Media Center shell. |
IsMediaFullScreen | Gets a value that indicates whether the current Windows Media Center experience is in full-screen mode. |
MajorVersion | Gets the major version number of the MediaCenter object. |
MediaCenterControlLevel | Gets the current settings that determine the level of control that HTML applications have over Windows Media Center. |
MediaChangers | Gets a list of disc changers. |
MediaContext | Gets a MediaContext object representing the context from which the user selected an application's More With This entry point. |
MinorVersion | Gets the minor version number of the MediaCenter object. |
ParentalControl | Gets a ParentalControlSelector object used to select the type of parental control settings to query. |
PostalCode | Gets the user's postal code. |
ScreenSaverEnabledHint | Gets or sets a value indicating whether the current HTML page allows the screen saver to interrupt the media experience. |
SharedViewPort | Gets the SharedViewPort object representing the shared view port. |
The MediaCenter object exposes the following methods:
Method | Description |
AddSongToQueue | Adds a specified song the user's song queue |
CloseApplication | Closes the HTML application. |
CreateDesktopShortcut | Displays a dialog box explaining that the user has invoked an operation that must be performed from the web browser on the Windows Media Center PC, and not from within the Windows Media Center shell. |
CreateEntryPointShortcut | Adds an entry point shortcut to Windows Media Center. |
CreateMCL | Creates a Windows Media Center link (MCL) shortcut file. |
DeleteEntryPointShortcut | Removes an entry point shortcut from Windows Media Center. |
Dialog | Displays a Windows Media Center-style dialog box that has a caption, body text, buttons, and a time-out duration. |
DialogEx | Displays a Windows Media Center-style dialog box that can contain custom buttons and images, and can pass a result code to an application-defined event handler. |
DialogNotification | Shows a modeless notification dialog box. |
DoesMCLExist | Indicates whether an MCL file already exists for a particular HTML application category. |
FindProgram | Finds TV programs that are currently being broadcast. |
FindService | Finds TV services by call sign or description. |
IsEntryPointRegistered | Returns a value that indicates whether the calling application already has a particular entry point registered with Windows Media Center. |
NavigateToPage | Directs Windows Media Center to navigate to the specified page in the Windows Media Center user interface. |
PlayMedia | Loads a new media item into Windows Media Center as the current media experience. |
PlayMediaEx | Loads a new media item into Windows Media Center. This method can place the item into the queue or immediately begin playing the item as the current media experience. |
RegisterApplication | Registers or unregisters an HTML application. |
ReturnToApplication | Returns Windows Media Center to the HTML application that calls this method. |
ScheduleRecording | Issues a request to Windows Media Center to record a TV program. |
The MediaCenter object supports the following events:
Event | Description |
HideCustomViewPort | Raised when Windows Media Center loads an HTML page. |
IsMCEEnabled | Raised when Windows Media Center loads an HTML page. |
onAPMResume | Raised when the system resumes operation after being suspended. |
onPlayStateChange | Raised when the state of the current media changes. |
onRemoteEvent | Raised when the user presses a navigation key on the remote control. |
onReturnFromMediaCenter | Raised when the user navigates back to a page in an HTML application after having previously navigated away from the application. |
onScaleEvent | Raised whenever an HTML application is resized. |
onTVRecordStateChange | Raised when the status of a TV recording session is changed. |
ReEnterDirectXExclusiveMode | Raised when Windows Media Center loads an HTML page. |
See Also