示例#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);
            }
        }
示例#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);
            }
        }