This project is read-only.

Show poster when audio only stream playing

Topics: Windows Phone 8
Jun 16, 2014 at 1:34 PM
Edited Jun 16, 2014 at 2:01 PM
We need to be able to show the poster frame instead of a black screen, whenever audio only content is playing.

Is it possible to show the poster image when the playing audio only media or when a smooth stream drops to an audio only rendition? Do we have to insert our own image in the visual tree between the MediaContainer and InteractivityContainer or is this possible with the existing framework?

So far I am inserting an image bound to the PosterSource into the ControlTemplate between the MediaContainer and the InteractivityContainer and using a VisualState to switch the visibility of the image. This works but feels a little heavy handed, especially if the framework can do this already.
Jun 17, 2014 at 4:32 PM
You would need to insert something in the visual tree. For example:
var uri = new Uri("");
var mediaContainer = (Panel)player.Containers[0];
mediaContainer.Children.Add(new Image() { Source = new BitmapImage(uri) });
The PosterSource property is passed along to the MediaElement but according to the docs, it only display in these scenarios:
  • When a valid source is not set. For example, Source is not set, Source was set to Null, or the source is invalid (as is the case when a MediaFailed event fires).
  • While media is loading. For example, a valid source is set, but the MediaOpened event has not fired yet.
  • During Play To streaming.