0

I'm working on implementing a streaming client that takes audio and video streamed from a server on the user's local network and renders it in real-time. I've been using a MediaElement to handle receiving the stream:

<MediaElement x:Name="mediaElement"
              AutoPlay="True"
              Source="{Binding StreamUri}" />

We need this MediaElement to be as responsive as possible. The user on the client can send commands to the streaming server that can alter the contents of the stream, and we would like to be able to show the user the results of their change immediately. However, there seems to be a hard-coded buffer length of five seconds, resulting in a constant 5-second delay between a user's action and the result.

Is there a way that we can reduce or eliminate this buffering time? I've found a MediaElement.BufferingTime property, but that seems to only exist in Silverlight and Windows Phone 7.

(For legacy reasons, we have to use Windows 8 instead of upgrading to Windows 8.1.)

blastron
  • 13
  • 4

1 Answers1

0

The property RealTimePlayback of the MediaElement reduces the delay of the stream playback:

MediaElement media = new MediaElement();
media.RealTimePlayback = true;

or

<MediaElement RealTimePlayback="True" />

(Minimum supported client: Windows 8)

https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh871376.aspx

HHenn
  • 309
  • 3
  • 4