Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 1.34 KB

backgroundmediaplayer_sendmessagetoforeground_577822813.md

File metadata and controls

29 lines (20 loc) · 1.34 KB
-api-id -api-type
M:Windows.Media.Playback.BackgroundMediaPlayer.SendMessageToForeground(Windows.Foundation.Collections.ValueSet)
winrt method

Windows.Media.Playback.BackgroundMediaPlayer.SendMessageToForeground

-description

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.

-parameters

-param value

Set of values representing the message.

-remarks

Apps should only call SendMessageToForeground while the foreground app is running. Attempting to call this method while the foreground app is not running will throw an exception. An app is responsible for communicating the foreground app state to the background process. This can be done using app lifecycle events, state values kept in local storage, and messages between processes.

Calls to SendMessageToForeground should always be made within a try block so that the exception thrown can be caught if the system is unable to send the message.

-examples

-see-also