Exemplo n.º 1
0
 private void Current_PositionChanged(object sender, PositionChangedEventArgs e)
 {
     Device.BeginInvokeOnMainThread(() =>
     {
         SetupCurrentMediaPositionData(e.Position);
     });
 }
Exemplo n.º 2
0
 private void MediaManager_PositionChanged(object sender, MediaManager.Playback.PositionChangedEventArgs e)
 {
     if (!DragStarted)
     {
         TimeSpanPosition = e.Position;
         Position         = e.Position.TotalSeconds;
     }
     TimeSpanDuration = MediaManager.Duration;
     Duration         = MediaManager.Duration.TotalSeconds;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Event for when Song Position has been changed.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CurrentSong_PositionChanged(object sender, PositionChangedEventArgs e)
        {
            //Calculate maximum of the song
            var    song            = (MediaManagerBase)sender;
            int    maxTotalSeconds = (int)song.Duration.TotalSeconds;
            string maxMinutes      = Math.Floor(song.Duration.TotalMinutes).ToString("00");
            string maxSeconds      = song.Duration.Seconds.ToString("00");

            //Max song progress
            ViewModel.MaxLengthSong  = $"{maxMinutes}:{maxSeconds}";
            ViewModel.MaxSecondsSong = maxTotalSeconds;

            //Update progress if possible
            if (_canProgress)
            {
                int totalSeconds = (int)e.Position.TotalSeconds;
                ViewModel.ProgressSecondsSong = totalSeconds;
            }
        }