I'm making a media player in wpf using c#. I had 3 questions.
I tried making a seeker
XAML:
<Slider Name="timelineSlider" Margin="40,91,26,0" ValueChanged="SeekToMediaPosition" Height="32" VerticalAlignment="Top" />
Code:
private void Element_MediaOpened(object sender, EventArgs e) { timelineSlider.Maximum = ply.NaturalDuration.TimeSpan.TotalMilliseconds; } private void SeekToMediaPosition(object sender, RoutedPropertyChangedEventArgs<double> e) { int SliderValue = (int)timelineSlider.Value; TimeSpan ts = new TimeSpan(SliderValue, SliderValue, SliderValue, SliderValue, SliderValue); ply.Position = ts; }
When I run the program, I open the mp3 and play it but the seeker won't move. When I click on the seeker to move it to a certain position, the song stops playing but the seeker moves. What's the problem and how do I fix it?
How do I create a volume increase/decrease bar?
How can I open several mp3s and queue them up like a playlist?