Ejemplo n.º 1
0
        public async Task SetTrackAsync(Track track)
        {
            try
            {
                this.m_currentTrack = track;
                if (this.m_currentTrack != null)
                {
                    Guid guid = this.m_currentTrack.Guid;
                    if (guid != null && !guid.Equals(Guid.Empty))
                    {
                        string strUrl = string.Format("{0}/api/files/audio/{1}", this.m_dataService.ServiceUrl, guid.ToString());

                        this.m_audioStreamDownloader = new AudioStreamDownloader(this.m_dataService);
                        this.m_audioStreamDownloader.DownloadProgessStarted += OnDownloadProgessStarted;
                        await m_audioStreamDownloader.DownloadAsync(new Uri(strUrl), guid);
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Ejemplo n.º 2
0
 public async Task PrepareTrack(Track track)
 {
     try
     {
         Guid guid = track.Guid;
         if (guid != null && !guid.Equals(Guid.Empty))
         {
             string strUrl = string.Format("{0}/api/files/audio/{1}", m_dataService.ServiceUrl, guid.ToString());
             m_audioStreamPreloader = new AudioStreamDownloader(this.m_dataService);
             m_audioStreamPreloader.PreloadComplete += OnPreloadComplete;
             await m_audioStreamPreloader.PreloadAsync(new Uri(strUrl), guid);
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }