MediaControl Class
[MediaControl kann in Versionen nach Windows 8.1 geändert oder nicht mehr verfügbar sein. Verwenden Sie stattdessen SystemMediaTransportControls.]
Beschreibt das Objekt, bei dem sich Anwendungen registrieren, um Medienfokus und Übertragungskontrollbenachrichtigungen zu erhalten.
Syntax
var mediaControl = Windows.Media.MediaControl;
Attribute
- [Deprecated()]
- [MarshalingBehavior(Agile)]
- [Threading(MTA)]
- [Version(0x06020000)]
Member
MediaControlKlasse hat diese Membertypen:
Ereignisse
MediaControlKlasse hat diese Ereignisse.
Ereignis | Beschreibung |
---|---|
ChannelDownPressed | Event raised when a ChannelDown command is issued to the application. |
ChannelUpPressed | Event raised when a ChannelUp command is issued to the application. |
FastForwardPressed | Event raised when a FastForward command is issued to the application. |
NextTrackPressed | Event raised when a NextTrack command is issued to the application. |
PausePressed | Event raised when a Pause command is issued to the application. |
PlayPauseTogglePressed | Event raised when a PlayPauseToggle command is issued to the application. |
PlayPressed | Event raised when a Play command is issued to the application. |
PreviousTrackPressed | Event raised when a PreviousTrack command is issued to the application. |
RecordPressed | Event raised when a Record command is issued to the application. |
RewindPressed | Event raised when a Rewind command is issued to the application. |
SoundLevelChanged | Event raised when the sound level changes. |
StopPressed | Event raised when a Stop command is issued to the application. |
Methoden
The MediaControl Klasse erbt Methoden von Object Klasse (C#/VB/C++).
Eigenschaften
Der MediaControlKlasse hat diese Eigenschaften.
Eigenschaft | Zugriffstyp | Beschreibung |
---|---|---|
Lese-/Schreibzugriff | Gets or sets the path to the artwork for the album cover. | |
Lese-/Schreibzugriff | Gets or sets the name of the artist. | |
Lese-/Schreibzugriff | Gets or sets the state of the Play button. | |
Schreibgeschützt | Gets the current sound level. | |
Lese-/Schreibzugriff | Gets or sets the track name. |
Hinweise
Die MediaControl-Klasse ermöglicht den Zugriff auf Ereignisse zum Drücken von Schaltflächen. Diese Ereignisse können überwacht werden und die Reaktion und das Verhalten einer audiosensiblen App ändern. Dies ist ein JavaScript-Codeausschnitt, der anzeigt, wie einem Ereignislistener ein MediaControl-Objekt hinzugefügt wird. Dann wird gezeigt, wie im Code diese Ereignisse zu behandeln sind.
// Assign the Windows.Media.MediaControl button object to // the user-defined mediaControls variable mediaControls = Windows.Media.MediaControl; // Add event listeners for the buttons mediaControls.addEventListener(“PlayPressed”, play, false); mediaControls.addEventListener(“PausePressed”, pause, false); mediaControls.addEventListener(“PlayPauseTogglePressed”, playpausetoggle, false); mediaControls.addEventListener(“NextTrackPressed”, nexttrack, false); mediaControls.addEventListener(“PreviousTrackPressed”, previoustrack, false); mediaControls.addEventListener(“SoundLevelChanged”, soundlevelchanged, false); // Add code for event handlers for the events function play() { document.getElementById(“audiotag”).play(); } function pause() { document.getElementById(“audiotag”).pause(); } function playpausetoggle() { //<code goes here to handle the PlayPauseToggle event> } ... // Additional code to handle the other events
Die vollständige Auflistung für dieses Beispiel erhalten Sie unter Konfigurieren von Schlüsseln für Mediensteuerelemente.
Anforderungen
Mindestens unterstützter Client | Windows 8 [Nur Windows Store-Apps] |
---|---|
Mindestens unterstützter Server | Windows Server 2012 [Nur Windows Store-Apps] |
Ende der Clientunterstützung | Windows 8.1 |
Ende der Serverunterstützung | Windows Server 2012 R2 |
Namespace |
|
Metadaten |
|
Siehe auch