TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
thuan hoang
NA
1
1.5k
MeidaPlayer on winphone 7
Jun 7 2013 4:51 AM
I want to do something similar to the media player in windows phone 7 where the next several song is shown. What approach I would take to accomplish this?
but it only runs on a virtual machine, when I installed it on the phone, play only 1 song
Example: previous song previous song CURRENT SONG next song next song
my code currently like this:
int i;
public MainPage()
{
InitializeComponent();
var library = new MediaLibrary();
lstSongs.ItemsSource = library.Songs;
var timer = new DispatcherTimer { Interval = TimeSpan.FromTicks(333333) };
timer.Tick += delegate { try { FrameworkDispatcher.Update(); } catch { } }; timer.Start();
timer.Tick += new EventHandler(currentPosition_Tick);
}
void currentPosition_Tick(object sender, EventArgs e)
{
switch (MediaPlayer.State)
{
case MediaState.Playing:
if (MediaPlayer.PlayPosition >= MediaPlayer.Queue.ActiveSong.Duration)
{
MediaPlayer.Stop();
i += 1;
MediaLibrary mediaLibrary = new MediaLibrary();
MediaPlayer.Play(mediaLibrary.Songs[i]);
lstSongs.SelectedIndex = lstSongs.SelectedIndex + 1;
}
break;
case MediaState.Paused:
break;
case MediaState.Stopped:
break;
}
}
private void SongSelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
{
MediaLibrary mediaLibrary = new MediaLibrary();
MediaPlayer.Play(mediaLibrary.Songs[lstSongs.SelectedIndex]);
}
Reply
Answers (
0
)
equation simplifier in c#
Get and Set propriety