문제

I am using silverlight 4 with smf and I want to create a play , pause toggle button. So if the media is playing and if the button is clicked it will pause the video. But if the media is paused, it will restart playing video. How can I do that

 private void btnPlay_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {



        }
도움이 되었습니까?

해결책

I don't know anything about silverlight, but you could use a boolean.

private void btnPlay_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
     if(isPlaying)
     {
         music.pause();
         isPlaying = FALSE;
         return;
     }

     music.play();
     isPlaying = TRUE;
     return;
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top