I have a full length movie file on the server. I want to create a wall of media clips from that one file. I can create the clip functionality by setting the position for the start of the clip and listening for a marker telling me when to stop playing. However, I would like to have the Media Element stop download the rest of the file at the point I stop the clip from playing for obvious performance and design implications.
views:
451answers:
1Unfortunately, you cannot control what the MediaElement downloads directly, other than setting the Source to null (which I am assuming is not what you want).
You might be able to download part of the file using HTTPWebRequest, making a copy of the returned Stream and setting it to the MediaElement (via SetSource), but that would only work if the clip is close to the beginning of the file.
There might also be server-side solutions: - Save each clip as a separate file (work up front, but will minimize unneeded downloads). Tools like Expression Encoder may be able to help you do this quickly and in batch. - Create a server entry point that accepts a file range, and only sends data up to a certain point. This is a non-trivial amount of work, but it makes the client completely unaware that not the entire file is sent.
Hope this helps, and sorry I don't have a better answer. Ed