PlayTo Progressreporting

pull/702/head
7illusions 11 years ago
parent c60103df64
commit 871a3cb52c

@ -167,25 +167,28 @@ namespace MediaBrowser.Dlna.PlayTo
if (_currentItem == null || _device.IsStopped) if (_currentItem == null || _device.IsStopped)
return; return;
if (!_playbackStarted) var playlistItem = Playlist.FirstOrDefault(p => p.PlayState == 1);
if (playlistItem != null)
{ {
await _sessionManager.OnPlaybackStart(new PlaybackInfo if (!_playbackStarted)
{ {
Item = _currentItem, await _sessionManager.OnPlaybackStart(new PlaybackInfo
SessionId = _session.Id, {
CanSeek = true, Item = _currentItem,
QueueableMediaTypes = new List<string> { _currentItem.MediaType } SessionId = _session.Id,
CanSeek = true,
}).ConfigureAwait(false); QueueableMediaTypes = new List<string> { _currentItem.MediaType },
MediaSourceId = playlistItem.MediaSourceId,
AudioStreamIndex = playlistItem.AudioStreamIndex,
SubtitleStreamIndex = playlistItem.SubtitleStreamIndex
_playbackStarted = true; }).ConfigureAwait(false);
}
if ((_device.IsPlaying || _device.IsPaused)) _playbackStarted = true;
{ }
var playlistItem = Playlist.FirstOrDefault(p => p.PlayState == 1);
if (playlistItem != null) if ((_device.IsPlaying || _device.IsPaused))
{ {
var ticks = _device.Position.Ticks; var ticks = _device.Position.Ticks;
@ -487,7 +490,7 @@ namespace MediaBrowser.Dlna.PlayTo
return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';'); return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';');
} }
private PlaylistItem GetPlaylistItem(BaseItem item, List<MediaStream> mediaStreams, DeviceProfile profile) private PlaylistItem GetPlaylistItem(BaseItem item, List<MediaStream> mediaStreams, DeviceProfile profile)
{ {
var video = item as Video; var video = item as Video;
@ -563,10 +566,10 @@ namespace MediaBrowser.Dlna.PlayTo
_logger.Debug("{0} - SetAvTransport Uri: {1} DlnaHeaders: {2}", _device.Properties.Name, nextTrack.StreamUrl, dlnaheaders); _logger.Debug("{0} - SetAvTransport Uri: {1} DlnaHeaders: {2}", _device.Properties.Name, nextTrack.StreamUrl, dlnaheaders);
await _device.SetAvTransport(nextTrack.StreamUrl, dlnaheaders, nextTrack.Didl); await _device.SetAvTransport(nextTrack.StreamUrl, dlnaheaders, nextTrack.Didl);
if (nextTrack.StartPositionTicks > 0 && !nextTrack.Transcode) if (nextTrack.StartPositionTicks > 0 && !nextTrack.Transcode)
await _device.Seek(TimeSpan.FromTicks(nextTrack.StartPositionTicks)); await _device.Seek(TimeSpan.FromTicks(nextTrack.StartPositionTicks));
return true; return true;
} }

Loading…
Cancel
Save