0

See code below, very simple stuff. The media.Source is correct and valid - other players only ever send a single request. The media plays fine.

XAML:

<MediaElement x:Name="media" Height="393" Width="700" />

Code behind:

media.LoadedBehavior = MediaState.Manual;
media.UnloadedBehavior = MediaState.Manual;
media.Source = new Uri("http://192.168.255.192:22215/api/media/stream/2015_07_14_13_34_07?position=0&duration=17");
media.Play();

The two requests sent (in order).

1

enter image description here

2

enter image description here

You'll see they have different User-agents. If anyone can help explain the double request, it would be highly appreciated.

Community
  • 1
  • 1
James Harcourt
  • 6,017
  • 4
  • 22
  • 42
  • What is the response to the first request? It might expect a certain HTTP header before proceeding, hence the need to send a second, slightly altered request. – aergistal Jul 16 '15 at 14:02

1 Answers1

0

This is evidently known behavior, and is a result of Windows Media Player's internal workings.

NSPlayer stands for Netshow Media Player, which is what Windows Media Player was formerly known as.

According to this, WMP hands the request off to its Internet Explorer component. Maybe you can verify using WireShark that the total transfer size is only the size of the single file?

At any rate, since it's playing fine for you, there's nothing to worry about. Since it's internal WMP behavior, there's nothing you can do on your end.

Community
  • 1
  • 1
kojak
  • 236
  • 1
  • 2
  • 9
  • Problem I have is that we are also managing the server side code that serves the stream back. Using VLC player, one request is received - however when two are received, two streams are opened. This is double the amount of bandwidth being used. – James Harcourt Jul 16 '15 at 14:34
  • Oh, I see. Can you simply ignore the first request? The second one (NSPlayer) seems to be the important one. – kojak Jul 16 '15 at 14:48