コード例 #1
0
ファイル: PlayToController.cs プロジェクト: Ivan-L/Emby
        async void _device_PlaybackStart(object sender, PlaybackStartEventArgs e)
        {
            try
            {
                var info = await StreamParams.ParseFromUrl(e.MediaInfo.Url, _libraryManager, _mediaSourceManager).ConfigureAwait(false);

                if (info.Item != null)
                {
                    var progress = GetProgressInfo(e.MediaInfo, info);

                    await _sessionManager.OnPlaybackStart(progress).ConfigureAwait(false);
                }
            }
            catch (Exception ex)
            {
                _logger.ErrorException("Error reporting progress", ex);
            }
        }
コード例 #2
0
        private async void OnDevicePlaybackStart(object sender, PlaybackStartEventArgs e)
        {
            if (_disposed)
            {
                return;
            }

            try
            {
                var info = StreamParams.ParseFromUrl(e.MediaInfo.Url, _libraryManager, _mediaSourceManager);

                if (info.Item != null)
                {
                    var progress = GetProgressInfo(info);

                    await _sessionManager.OnPlaybackStart(progress).ConfigureAwait(false);
                }
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Error reporting progress");
            }
        }