Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Possible to tell MediaElement to only play a range of an MP3?
3 replies. Latest Post by neopocott on April 23, 2009.
(0)
jemiller
Member
445 points
237 Posts
04-21-2009 7:35 PM |
Hi all,
MediaElement has a Position property which allows you to start playing at a specific position in a media file. I'm wondering there is a way to tell it to stop playing at a specific position? i.e. say I have a 3 minute MP3 file. I want to tell it to play starting at 1:55 and stop at 2:15. I'm thinking maybe I could use a timer to stop the playback, but, that seems imprecise.
Jon
neopocott
368 points
82 Posts
04-22-2009 1:49 AM |
Hi,
You could add a Marker on the MP3 file at the time position that is interesting for you. In the MarkerReached event, just call the Stop() function to end the playback.
04-22-2009 5:19 PM |
Cool, thanks. I was wondering if the Markers collection might be able to be used for something like that. I'll give it a try.
04-23-2009 1:30 AM |
Yes, I guess Markers were actually designed for that kind of scenarios.
Do not forget to mark my reply as the answer if it helps you.