|
|
Rank: Member Groups: Member
Joined: 11/13/2008 Posts: 26 Points: 78 Location: New York
|
If i play a track clicking on the buttonlink and then stop and press play, the selected track goes back to initial setup, first track, and that one is played. I have an event handler for the trackchangeEvent since i need to change the cover art for each track and i even tried to setup the selected track from there, but still, same problem. This is my even handler:
protected void PlayList1_TrackChangeEvent(object sender, ASPNetMediaGUI.TrackChangeEventArgs e) {
int trackIndex = e.NewTrackNumber - 1; string urlToPlay = PlayList1.PlayListTracks[trackIndex].URL.ToString(); DataTable dtPL = (DataTable)Cache["playlist"]; DataRow dr = dtPL.Rows[a]; Image img = (Image)UpdatePanel1.ContentTemplateContainer.FindControl("coverart"); img.ImageUrl = dr["imgURL"].ToString(); MediaPlayer1.AudioURL = urlToPlay; MediaPlayer1.AutoPlay = true; // PlayList1.SelectedTrack = e.NewTrackNumber; txtbactivetrack.Text = dr["artist"].ToString().Trim() + " - " + dr["trackname"].ToString().Trim(); } Is SelectedTrack a readonly property or something? Looks like it doenst change when i select a track. Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 7/26/2007 Posts: 676 Points: 1,728 Location: USA
|
You should use the function PlayList1.PlayTrack()Sorry - documentation is weak. Functions for PlayList are: PlayTrack StopPlayList PreviousTrack NextTrack http://www.aspnetmedia.com
|
|
Rank: Member Groups: Member
Joined: 11/13/2008 Posts: 26 Points: 78 Location: New York
|
It's not documentation it's what IntelliSense is giving me. I needed an event to catch the change of track and that was the only one i got. What you gave me are javascript functions, they are not listed as events for playslist object and that's what i have to handle. Please be a little more explicit. Thanks.
|
|
Rank: Member Groups: Member
Joined: 11/13/2008 Posts: 26 Points: 78 Location: New York
|
I have to use PlayList1.PlayTrack(e.NewTrackNumber) instead of PlayList1.SelectedTrack(e.NewTrackNumber). Got it. Thanks. Maybe this will solve the mistery with stop button not working well too. I'll let you know.
|
|
Rank: Administration Groups: Administration
Joined: 7/26/2007 Posts: 676 Points: 1,728 Location: USA
|
|
|
|
Guest |