BackgroundMediaPlayer BackgroundMediaPlayer BackgroundMediaPlayer BackgroundMediaPlayer BackgroundMediaPlayer Class

Definition

Provides access to the media player while it is running in the background.

Note

Starting with Windows, version 1703, BackgroundMediaPlayer is deprecated and may not be available in future versions of Windows. Use the MediaPlayer class instead. For more information, see Play media in the background.

public : static class BackgroundMediaPlayer
static struct winrt::Windows::Media::Playback::BackgroundMediaPlayer
public static class BackgroundMediaPlayer
Public Shared Class BackgroundMediaPlayer
// This class does not provide a public constructor.
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Starting with Windows 10, version 1607, apps should use the MediaPlayer for media playback. The MediaPlayer object allows you to play media in the background seamlessly, using a single process. For information on using MediaPlayer, see Play audio and video with MediaPlayer. For information on playing media in the background with MediaPlayer, see Play media in the background. For information on the legacy, two-process background playback model, which is still supported for backwards compatibility, see Legacy background media playback.

Properties

Current Current Current Current Current

Gets the current instance of the background media player.

Note

Starting with Windows, version 1703, BackgroundMediaPlayer is deprecated and may not be available in future versions of Windows. Use the MediaPlayer class instead. For more information, see Play media in the background.

Methods

IsMediaPlaying() IsMediaPlaying() IsMediaPlaying() IsMediaPlaying() IsMediaPlaying()

Returns a Boolean value indicating if other media is currently playing on the device.

Note

Starting with Windows, version 1703, BackgroundMediaPlayer is deprecated and may not be available in future versions of Windows. Use the MediaPlayer class instead. For more information, see Play media in the background.

SendMessageToBackground(ValueSet) SendMessageToBackground(ValueSet) SendMessageToBackground(ValueSet) SendMessageToBackground(ValueSet) SendMessageToBackground(ValueSet)

Sends a message to the background media player.

Note

Starting with Windows, version 1703, BackgroundMediaPlayer is deprecated and may not be available in future versions of Windows. Use the MediaPlayer class instead. For more information, see Play media in the background.

SendMessageToForeground(ValueSet) SendMessageToForeground(ValueSet) SendMessageToForeground(ValueSet) SendMessageToForeground(ValueSet) SendMessageToForeground(ValueSet)

Sends a message to the foreground task.

Note

Starting with Windows, version 1703, BackgroundMediaPlayer is deprecated and may not be available in future versions of Windows. Use the MediaPlayer class instead. For more information, see Play media in the background.

Shutdown() Shutdown() Shutdown() Shutdown() Shutdown()

Shuts down the current background media player.

Note

Starting with Windows, version 1703, BackgroundMediaPlayer is deprecated and may not be available in future versions of Windows. Use the MediaPlayer class instead. For more information, see Play media in the background.

Events

MessageReceivedFromBackground MessageReceivedFromBackground MessageReceivedFromBackground MessageReceivedFromBackground MessageReceivedFromBackground

Occurs when a message is received from the background task.

Note

Starting with Windows, version 1703, BackgroundMediaPlayer is deprecated and may not be available in future versions of Windows. Use the MediaPlayer class instead. For more information, see Play media in the background.

MessageReceivedFromForeground MessageReceivedFromForeground MessageReceivedFromForeground MessageReceivedFromForeground MessageReceivedFromForeground

Occurs when a message is received from the foreground task.

Note

Starting with Windows, version 1703, BackgroundMediaPlayer is deprecated and may not be available in future versions of Windows. Use the MediaPlayer class instead. For more information, see Play media in the background.

See also