c# - 如何在 Windows Phone 8 中使用诺基亚音乐 API

标签 c# windows-phone-7 windows-phone-8

我使用以下代码使用 Nokia Music API 获取流派。

 client.GetGenres((ListResponse<Genre> response) =>
 {
 Dispatcher.BeginInvoke(() =>
     {
       this.Generic.ItemsSource = response.Result.ToList();
       if (response.Result == null || response.Result.Count() == 0)
           MessageBox.Show("No Result available");
     });
  });

我已成功获取流派 和所有详细信息,但如何检索所有轨道并播放选定的轨道。

最佳答案

根据Nokia Developer API Documentation

要播放特定艺术家,请使用诺基亚 API 音乐启动器

The following method from Music Explorer's MusicApi shows how simple it is to launch Nokia Music application to play artist mix. Nokia Music app can be launched just as easily into a product or artist state using Nokia Music API. Some of the launcher methods in Nokia Music API require unique ids of artists, mixes and products. These ids are received in responses from Nokia Music API's other services.

using Nokia.Music.Phone;
using Nokia.Music.Phone.Tasks;

...

namespace MusicExplorer
{
    ...

    public class MusicApi
    {
        ...

        public void LaunchArtistMix(string artistName)
        {
            ...

            PlayMixTask task = new PlayMixTask();
            task.ArtistName = artistName;
            task.Show();
        }

        ...
    }
}

我没有看到任何关于列出专辑内容的具体信息,但您可以利用 GetArtistProducts() 来执行此操作

client.GetArtistProducts(
  (ListResponse<Product> response) =>
  {
    // Use results
  },

关于c# - 如何在 Windows Phone 8 中使用诺基亚音乐 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19181420/

相关文章:

c# - 如何避免在执行 C# Azure Function 期间出现 SqlClient 超时错误?

listbox - WP7 列表框分组

windows-phone-7 - DVLUP 类似网站 - Windows Phone 应用程序

c# - 如何在按下时更改应用程序栏按钮的颜色

c# - 在 Pivot 中使用 WebBrowser 时在生产中崩溃

c# - 将数据从 CSVReader 传递到循环内的方法

c# - 如何将纯文本发布到 WCF 服务,即不包含在 XML 标记中?

c# - 我应该测试 ASP MVC 项目中的属性吗?

binding - wp7 SoundEffect 播放绑定(bind)到滚动条

c# - 多线程windows phone应用程序