Media Player in Windows Phone 7

I am trying to use a media player to play music from a collection of songs .

Is it possible to encode that the music being played cannot be paused?

Below is my code:

private void songListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { songSelectedIndex = songListBox.SelectedIndex; using (var ml = new MediaLibrary()) { FrameworkDispatcher.Update(); MediaPlayer.Play(ml.Songs[songSelectedIndex]); MediaPlayer.IsRepeating = true; MediaPlayer.Volume = 20.0f; } } 

I tried using CanPauseProperty but there is an error

MediaElement.CanPauseProperty = false;

Error: Unable to implicitly convert type 'bool' to 'System.Windows.DependencyProperty'

+4
source share
1 answer

MediaPlayer does not support this feature.

If you used BackgroundAudioPlayer (in Mango), you can control which navigation options are available.

+1
source

All Articles