As streaming video, with MediaElement, from the database, in chunks

I have MediaElement

one that plays video. I have my video stored in binary format in my SQL Server database.

The way this works for me is that the Silverlight application reads ALL binary data from the web service. The web service returns byte[]

, which I stream and set as the source for MediaElement


The big problem is that it needs to read all the data before setting the source MediaElement

. 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.

Any hints on how I can accomplish this?


source to share

2 answers

As a result, I changed a little. I couldn't figure out the buffering from the DB, so we set up a media server and used the silverlight app to stream from that.



I found this article on the Silverlight forums that have a similar question (audio instead of video).

The solution says, "You can try to create an ASX file to store the playlist and set the ASX file as the source of the MediaElement."

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

It looks like you have to set the source MediaElement

to Silverlight Playlist

or ASX File

, and then upload your video in chunks (possibly as separate "files") to this one Playlist


Hope this helps!



All Articles