I have a set of mp3s I want to play through the media player.
They are defined through a collection, like so:
System.Collections.Generic.List<SongTitlePath> SongTitlePaths = new List<SongTitlePath>();
SongTitlePaths.Add(new SongTitlePath("Song Title", "Path"));
As you can see, the List is generic and is of type SongTitlePath, which takes the title and path parameters like so:
public class SongTitlePath
{
public string Song, Path;
public SongTitlePath(string song, string path )
{
this.Song = song;
this.Path = path;
// Insert code required on object creation below this point.
}
However, whenever I click play, the song does not play (no song can be heard) and of course the play head does not move.
My paths are correct as I have pasted them into windows explorer to see their validity. My slashes are \ (backslash). Each song is on the local filesystem.
Here is the code to add each collection entry to my media player:
foreach (SongTitlePath s in SongTitlePaths)
{
var item = new Telerik.Windows.Controls.RadMediaItem();
item.Title = s.Song;
item.Source = new Uri(s.Path, UriKind.RelativeOrAbsolute);
this.radMediaPlayer.Items.Add(item);
}
What gives?
Thanks
They are defined through a collection, like so:
System.Collections.Generic.List<SongTitlePath> SongTitlePaths = new List<SongTitlePath>();
SongTitlePaths.Add(new SongTitlePath("Song Title", "Path"));
As you can see, the List is generic and is of type SongTitlePath, which takes the title and path parameters like so:
public class SongTitlePath
{
public string Song, Path;
public SongTitlePath(string song, string path )
{
this.Song = song;
this.Path = path;
// Insert code required on object creation below this point.
}
However, whenever I click play, the song does not play (no song can be heard) and of course the play head does not move.
My paths are correct as I have pasted them into windows explorer to see their validity. My slashes are \ (backslash). Each song is on the local filesystem.
Here is the code to add each collection entry to my media player:
foreach (SongTitlePath s in SongTitlePaths)
{
var item = new Telerik.Windows.Controls.RadMediaItem();
item.Title = s.Song;
item.Source = new Uri(s.Path, UriKind.RelativeOrAbsolute);
this.radMediaPlayer.Items.Add(item);
}
What gives?
Thanks