Ejemplo n.º 1
0
        async void Device_PlaybackChanged(object sender, TransportStateEventArgs e)
        {
            if (_currentItem == null)
            {
                return;
            }

            if (e.Stopped == false)
            {
                await ReportProgress().ConfigureAwait(false);
            }

            else if (e.Stopped && _playbackStarted)
            {
                _playbackStarted = false;

                await _sessionManager.OnPlaybackStopped(new PlaybackStopInfo
                {
                    Item          = _currentItem,
                    SessionId     = _session.Id,
                    PositionTicks = _device.Position.Ticks
                }).ConfigureAwait(false);

                await SetNext().ConfigureAwait(false);
            }
        }
Ejemplo n.º 2
0
        async void Device_PlaybackChanged(object sender, TransportStateEventArgs e)
        {
            if (_currentItem == null)
                return;

            if (e.Stopped == false)
                await ReportProgress().ConfigureAwait(false);

            else if (e.Stopped && _playbackStarted)
            {
                _playbackStarted = false;

                await _sessionManager.OnPlaybackStopped(new PlaybackStopInfo
                {
                    Item = _currentItem,
                    SessionId = _session.Id,
                    PositionTicks = _device.Position.Ticks

                }).ConfigureAwait(false);

                await SetNext().ConfigureAwait(false);
            }
        }