WPF media element play and pause
C#
1
Posts
1
Posters
0
Views
1
Watching
-
From the code below, I am trying to get my media player to play or pause. When I click on the button the media plays fine, however the pause does not work it simply starts playing from the start again. How to I get it to pause athen resume? try { if (btnPlay.Content.ToString() == "Play") { //Play the media... mediaElement1.LoadedBehavior = MediaState.Play; btnPlay.Content = "Pause"; } else { //Pause play back mediaElement1.LoadedBehavior = MediaState.Pause; btnPlay.Content = "Play"; } } catch (System.IO.FileNotFoundException err)