I have given you one code as follows which helps you to use the bit.ly to create a short URL containing the parameters which you would be able to use in the Song.FromUri but you have to register the name/key. You have to put the given code in an appropriate Silverlight app.
Code:
protected override void Init()
{
WebClient user = new WebClient();
user.DownloadStringCompleted += new DownloadStringCompletedEventHandler(user_DownloadStringCompleted);
string trueUrl = "yourfullurl;
string bitlyLoginname = "yourbitlyname";
string bitlyTokenNo = "yourbitlytoken";
string bitly = string.Format(
"http://api.bit.ly/shorten?version=2.0.1&longUrl={0}&login={1}&apiKey={2}&format=xml",
trueUrl, bitlyLoginname, bitlyTokenNo);
user.DownloadStringAsync(new Uri(bitly));
base.Init();
}
void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
if (e.Error != null)
return;
XDocument doc = XDocument.Parse(e.Result);
string shortUrl = doc.Descendants("shortUrl").First().Value;
MediaPlayer.Volume = 1f;
MediaPlayer.Play(Song.FromUri("My Song", new Uri(shortUrl + "?.mp3")));
}
Bookmarks