private async void ReportPlaybackStopped(uBaseObject mediaInfo, StreamParams streamInfo, long?positionTicks) { try { await _sessionManager.OnPlaybackStopped(new PlaybackStopInfo { ItemId = streamInfo.ItemId, SessionId = _session.Id, PositionTicks = positionTicks, MediaSourceId = streamInfo.MediaSourceId }).ConfigureAwait(false); } catch (Exception ex) { _logger.ErrorException("Error reporting progress", ex); } }
private void OnPlaybackProgress(uBaseObject mediaInfo) { var mediaUrl = mediaInfo.Url; if (string.IsNullOrWhiteSpace(mediaUrl)) { return; } if (PlaybackProgress != null) { PlaybackProgress.Invoke(this, new PlaybackProgressEventArgs { MediaInfo = mediaInfo }); } }
private PlaybackStartInfo GetProgressInfo(uBaseObject mediaInfo, StreamParams info) { return(new PlaybackStartInfo { ItemId = info.ItemId, SessionId = _session.Id, PositionTicks = GetProgressPositionTicks(mediaInfo, info), IsMuted = _device.IsMuted, IsPaused = _device.IsPaused, MediaSourceId = info.MediaSourceId, AudioStreamIndex = info.AudioStreamIndex, SubtitleStreamIndex = info.SubtitleStreamIndex, VolumeLevel = _device.Volume, // TODO CanSeek = true, PlayMethod = info.IsDirectStream ? PlayMethod.DirectStream : PlayMethod.Transcode }); }