3

I have a MediaElement that plays video. I have my video stored, in binary, in my SQL Server database.

The way this works out for me is that the Silverlight app reads ALL the binary data from a web service. The web service returns a byte[] that I turn into a stream, and set as source for the MediaElement.

The big problem with this is that it needs to read all the data before the MediaElement's source can be set. With large videos, this takes a long time.

So, I was hoping to somehow take chunks, and buffer as I go, like any online video player does.

Any clues on how I can actually do that?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Nicolai
  • 2,835
  • 7
  • 42
  • 52

2 Answers2

1

I ended up doing this a bit different. I couldn't figure out buffering from the DB, so we setup a mediaserver, and used the silverlight app, to stream from that instead.

Nicolai
  • 2,835
  • 7
  • 42
  • 52
  • Hi
    Could you please explain what did you do ? Because I have a similar problem.
    There are a lot of films on a server which clients should watch them via Silverlight's MediaElement. Is that possible to have a MediaElement like : The problem is that we don't want to have the whole film being burst into the client. I have tested **Mezzmo** and **IIS Live Smooth Streaming** but I can't find the mms addresses which they represent their content.
    – Spongebob Comrade Aug 05 '13 at 08:10
0

I found this article on the Silverlight Forums, which has a similar question (audio instead of video).

The solution states: "You can try to create a ASX file to hold the playlist and set the ASX file as the source of the MediaElement."

One of the links provided in the solution goes on to say: "An ASX file is simply an XML file that specifies the media files in the playlist. Playlists provide, among other things, a central entry point for a group of media."

It sounds like you should be able set the source of your MediaElement to a Silverlight Playlist, or ASX File, and then download your video, in chunks (possibly as separate "files"), to that Playlist.

Hope this helps!

lhan
  • 4,585
  • 11
  • 60
  • 105
  • But this needs files placed somewhere, if I understand correctly. I have it stored in a DB. – Nicolai Mar 22 '12 at 13:47
  • Hmm.. I wonder if it would be possible to store other MediaElement objects within a Silverlight Playlist? Then maybe you could create the MediaElement objects dynamically as you download your video from the DB? Then still have your "main" MediaElement reference the Playlist? Just a shot in the dark... I haven't done this before. – lhan Mar 22 '12 at 14:22