Exemplo n.º 1
0
 public static void RefetchTrack(AudioTrack track, Action <AudioTrack> callback)
 {
     if (track != null && track.Source != null)
     {
         Uri currentSource = track.Source;
         AudioTrackHelper.EnsureAppGlobalStateInitialized();
         AudioService  instance = AudioService.Instance;
         List <string> ids      = new List <string>();
         ids.Add(track.GetTagId());
         Action <BackendResult <List <AudioObj>, ResultCode> > callback1 = (Action <BackendResult <List <AudioObj>, ResultCode> >)(res =>
         {
             if (res.ResultCode == ResultCode.Succeeded && res.ResultData != null && (res.ResultData.Count > 0 && currentSource.OriginalString != res.ResultData[0].url))
             {
                 callback(AudioTrackHelper.CreateTrack(res.ResultData[0]));
             }
             else
             {
                 callback(null);
             }
         });
         instance.GetAudio(ids, callback1);
     }
     else
     {
         callback(null);
     }
 }
Exemplo n.º 2
0
 public static AudioTrack GetNextTrack(BackgroundAudioPlayer player, bool next, out bool startedNewCycle, PlaybackSettings settings = null, bool allowCache = false)
 {
     startedNewCycle = false;
     return(AudioTrackHelper.CreateTrack(AudioTrackHelper.GetNextAudio(player, next, out startedNewCycle, settings, allowCache)));
 }