Search code examples
silverlightmediaelement

Virtual Trim of MediaElement


I have both a 20 second audio file and a 60 second video file. I only want to include these once, but need different start/end times for them in various <MediaElement>s.

For example, on my page one I need the seconds 2-13 of the audio file and on page two I need the first 10 seconds (0-9). On page three I need seconds 12-18. I'd really prefer not to have 3 different audio files, just a set of start/end values for the portion of audio/video file.

I see .Position for a start time, but what about an end time that doesn't have to hook an event to stop itself? Also, I'm not sure what the XAML for .Position would look like as there is no sample of that on MSDN.

Any thoughts?


Solution

  • Found a great way to do this on this thread: Silverlight: Expose audio with specific start and stop times