Пример #1
0
 void GetMvInfo()
 {
     Task.Run(() =>
     {
         var mvinfo = CloudMusicApiHelper.GetMusicVideo(mvid);
         Artists    = new ObservableCollection <ArtistsInfo>();
         if (mvinfo != null)
         {
             if (mvinfo.code == 200)
             {
                 Device.BeginInvokeOnMainThread(() => MvInfo = mvinfo);
                 string videourl = string.Empty;
                 if (!string.IsNullOrWhiteSpace(mvinfo.data.brs._1080))
                 {
                     videourl = mvinfo.data.brs._1080;
                 }
                 else if (!string.IsNullOrWhiteSpace(mvinfo.data.brs._720))
                 {
                     videourl = mvinfo.data.brs._720;
                 }
                 else if (!string.IsNullOrWhiteSpace(mvinfo.data.brs._480))
                 {
                     videourl = mvinfo.data.brs._480;
                 }
                 else if (!string.IsNullOrWhiteSpace(mvinfo.data.brs._240))
                 {
                     videourl = mvinfo.data.brs._240;
                 }
                 if (!string.IsNullOrWhiteSpace(videourl))
                 {
                     UriSource = new UriVideoSource {
                         Uri = videourl
                     }
                 }
                 ;
             }
         }
         var _artists = new ObservableCollection <ArtistsInfo>();
         foreach (var q in mvinfo.data.artists)
         {
             var artistsInfo = CloudMusicApiHelper.GetArtist(q.id.ToString());
             if (artistsInfo != null)
             {
                 if (artistsInfo.code == 200)
                 {
                     _artists.Add(artistsInfo);
                 }
             }
         }
         Artists = _artists;
     });
     GetMiSiMv();
     ListViewLoadMore();
 }