Пример #1
0
 private void HandleTimerFire(object sender, ElapsedEventArgs e)
 {
     if (!_manuallySettingPlaybackPosition)
     {
         MediaPositionChangedEvent?.Invoke(this, new PositionChangedEventArgs(_mediaItemId, GetPlaybackPosition()));
     }
 }
Пример #2
0
 private void HandlePositionChanged(object sender, PositionChangedEventArgs e)
 {
     // only fire every 60ms
     if ((e.Position - _lastPosition).TotalMilliseconds > 60)
     {
         _lastPosition = e.Position;
         MediaPositionChangedEvent?.Invoke(this, e);
     }
 }
Пример #3
0
        private void HandlePositionChanged(object?sender, OnlyMPositionChangedEventArgs e)
        {
            if (!_manuallySettingPlaybackPosition && (e.Position - _lastPosition).TotalMilliseconds > 60)
            {
                // only fire every 60ms
                _lastPosition = e.Position;
                MediaPositionChangedEvent?.Invoke(this, e);

                if (!_firedNearEndEvent &&
                    _mediaElement.NaturalDuration.HasTimeSpan &&
                    (_mediaElement.NaturalDuration.TimeSpan - e.Position).TotalMilliseconds < FreezeMillisecsFromEnd)
                {
                    _firedNearEndEvent = true;
                    MediaNearEndEvent?.Invoke(this, new MediaNearEndEventArgs {
                        MediaItemId = _mediaItemId
                    });
                }
            }
        }
Пример #4
0
 private void HandleMediaPositionChangedEvent(object sender, PositionChangedEventArgs e)
 {
     MediaPositionChangedEvent?.Invoke(this, e);
 }
 private void HandlePositionChanged(object sender, Unosquare.FFME.Events.PositionChangedRoutedEventArgs e)
 {
     MediaPositionChangedEvent?.Invoke(this, e);
 }