/// <summary> /// This updates Playstates and fires the Progress event /// </summary> protected virtual void OnProgress(PlaybackStateEventArgs args) { CurrentFileDurationTicks = args.DurationFromPlayer; CurrentFilePositionTicks = args.Position; // Set the current PlayableItem based on the incoming args CurrentPlayableItemId = args.Item == null ? Guid.Empty : args.Item.Id; Async.Queue("BasePlaybackController OnProgress", () => { NormalizeEventProperties(args); PlayableItem playable = args.Item; // Update PlayableItem progress event // Only report progress to the PlayableItem if the position is > 0, because the player may start with an initial position of 0, or reset to 0 when stopping // This could end up blowing away resume data if (playable != null && args.Position > 0) { // Fire it's progress event handler playable.OnProgress(this, args); } // Fire PlaybackController progress event if (_Progress != null) { try { _Progress(this, args); } catch (Exception ex) { Logger.ReportException("PlaybackController.Progress event listener had an error: ", ex); } } }); }