Windows Dev Center

MediaHistory.NowPlaying Property

Gets the most recent MediaHistoryItem in the media history, or sets the supplied MediaHistoryItem into the Now Playing section of the Music + Videos Hub.

Namespace:  Microsoft.Devices
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)

Public Property NowPlaying As MediaHistoryItem

When setting this property, the supplied MediaHistoryItem cannot be null.

When getting this property, only the most recent MediaHistoryItem set by your application is returned. For example, if the user has played a more recent MediaHistoryItem through a different application, that item will not be returned with this property. Instead, the most recent item set by your own application is returned.

You must wait until the media stream has been opened before setting the NowPlaying property; otherwise, your data could be silently discarded. Applications MediaElement, wait for the MediaOpened event before setting NowPlaying. For applications using the XNA Game Studio MediaPlayer APIs, wait until the MediaStateChanged event is raised and the State property returns Playing. For applications using BackgroundAudioPlayer, there is no need to set the NowPlaying information because it is handled by the system automatically.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2015 Microsoft