update live stream generation
This commit is contained in:
parent
a79962b7eb
commit
dd8dd1938a
|
@ -187,7 +187,7 @@ namespace MediaBrowser.Api
|
|||
|
||||
if (!string.IsNullOrWhiteSpace(deviceId))
|
||||
{
|
||||
var audioCodec = state.ActualOutputVideoCodec;
|
||||
var audioCodec = state.ActualOutputAudioCodec;
|
||||
var videoCodec = state.ActualOutputVideoCodec;
|
||||
|
||||
_sessionManager.ReportTranscodingInfo(deviceId, new TranscodingInfo
|
||||
|
|
|
@ -1513,6 +1513,10 @@ namespace MediaBrowser.Api.Playback
|
|||
{
|
||||
request.StreamId = val;
|
||||
}
|
||||
else if (i == 22)
|
||||
{
|
||||
request.LiveStreamId = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,6 +82,15 @@ namespace MediaBrowser.Controller.LiveTv
|
|||
/// <value><c>null</c> if [has image] contains no value, <c>true</c> if [has image]; otherwise, <c>false</c>.</value>
|
||||
public bool? HasProviderImage { get; set; }
|
||||
|
||||
public override LocationType LocationType
|
||||
{
|
||||
get
|
||||
{
|
||||
// TODO: This should be removed
|
||||
return LocationType.Remote;
|
||||
}
|
||||
}
|
||||
|
||||
protected override string CreateSortName()
|
||||
{
|
||||
double number = 0;
|
||||
|
|
|
@ -1486,5 +1486,12 @@ namespace MediaBrowser.Model.ApiClient
|
|||
/// <param name="query">The query.</param>
|
||||
/// <returns>Task<List<RecommendationDto>>.</returns>
|
||||
Task<List<RecommendationDto>> GetMovieRecommendations(MovieRecommendationQuery query);
|
||||
/// <summary>
|
||||
/// Opens the live stream.
|
||||
/// </summary>
|
||||
/// <param name="request">The request.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task<LiveStreamResponse>.</returns>
|
||||
Task<LiveStreamResponse> OpenLiveStream(LiveStreamRequest request, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
|
@ -210,6 +210,9 @@ namespace MediaBrowser.Model.Dlna
|
|||
list.Add(new NameValuePair("StreamId", streamId ?? string.Empty));
|
||||
list.Add(new NameValuePair("api_key", accessToken ?? string.Empty));
|
||||
|
||||
string liveStreamId = item.MediaSource == null ? null : item.MediaSource.LiveStreamId;
|
||||
list.Add(new NameValuePair("LiveStreamId", liveStreamId ?? string.Empty));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,5 +12,24 @@ namespace MediaBrowser.Model.MediaInfo
|
|||
public int? SubtitleStreamIndex { get; set; }
|
||||
public string ItemId { get; set; }
|
||||
public DeviceProfile DeviceProfile { get; set; }
|
||||
|
||||
public LiveStreamRequest()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public LiveStreamRequest(AudioOptions options)
|
||||
{
|
||||
MaxStreamingBitrate = options.MaxBitrate;
|
||||
ItemId = options.ItemId;
|
||||
DeviceProfile = options.Profile;
|
||||
|
||||
VideoOptions videoOptions = options as VideoOptions;
|
||||
if (videoOptions != null)
|
||||
{
|
||||
AudioStreamIndex = videoOptions.AudioStreamIndex;
|
||||
SubtitleStreamIndex = videoOptions.SubtitleStreamIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,5 +78,10 @@ namespace MediaBrowser.Model.Session
|
|||
/// </summary>
|
||||
/// <value>The play method.</value>
|
||||
public PlayMethod PlayMethod { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the live stream identifier.
|
||||
/// </summary>
|
||||
/// <value>The live stream identifier.</value>
|
||||
public string LiveStreamId { get; set; }
|
||||
}
|
||||
}
|
|
@ -36,5 +36,10 @@ namespace MediaBrowser.Model.Session
|
|||
/// </summary>
|
||||
/// <value>The position ticks.</value>
|
||||
public long? PositionTicks { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the live stream identifier.
|
||||
/// </summary>
|
||||
/// <value>The live stream identifier.</value>
|
||||
public string LiveStreamId { get; set; }
|
||||
}
|
||||
}
|
|
@ -356,8 +356,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
_logger.Info("Opening channel stream from {0}, external channel Id: {1}", service.Name, channel.ExternalId);
|
||||
info = await service.GetChannelStream(channel.ExternalId, null, cancellationToken).ConfigureAwait(false);
|
||||
info.RequiresClosing = true;
|
||||
|
||||
if (info.RequiresClosing)
|
||||
{
|
||||
info.LiveStreamId = info.Id;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var recording = await GetInternalRecording(id, cancellationToken).ConfigureAwait(false);
|
||||
|
@ -367,8 +371,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
_logger.Info("Opening recording stream from {0}, external recording Id: {1}", service.Name, recording.RecordingInfo.Id);
|
||||
info = await service.GetRecordingStream(recording.RecordingInfo.Id, null, cancellationToken).ConfigureAwait(false);
|
||||
info.RequiresClosing = true;
|
||||
|
||||
if (info.RequiresClosing)
|
||||
{
|
||||
info.LiveStreamId = info.Id;
|
||||
}
|
||||
}
|
||||
|
||||
_logger.Info("Live stream info: {0}", _jsonSerializer.SerializeToString(info));
|
||||
Normalize(info, isVideo);
|
||||
|
|
|
@ -679,6 +679,18 @@ namespace MediaBrowser.Server.Implementations.Session
|
|||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(info.LiveStreamId))
|
||||
{
|
||||
try
|
||||
{
|
||||
await _mediaSourceManager.PingLiveStream(info.LiveStreamId, CancellationToken.None).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error closing live stream", ex);
|
||||
}
|
||||
}
|
||||
|
||||
EventHelper.FireEventIfNotNull(PlaybackProgress, this, new PlaybackProgressEventArgs
|
||||
{
|
||||
Item = libraryItem,
|
||||
|
@ -769,6 +781,18 @@ namespace MediaBrowser.Server.Implementations.Session
|
|||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(info.LiveStreamId))
|
||||
{
|
||||
try
|
||||
{
|
||||
await _mediaSourceManager.CloseLiveStream(info.LiveStreamId, CancellationToken.None).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error closing live stream", ex);
|
||||
}
|
||||
}
|
||||
|
||||
EventHelper.QueueEventIfNotNull(PlaybackStopped, this, new PlaybackStopEventArgs
|
||||
{
|
||||
Item = libraryItem,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common.Internal</id>
|
||||
<version>3.0.603</version>
|
||||
<version>3.0.606</version>
|
||||
<title>MediaBrowser.Common.Internal</title>
|
||||
<authors>Luke</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<description>Contains common components shared by Emby Theater and Emby Server. Not intended for plugin developer consumption.</description>
|
||||
<copyright>Copyright © Emby 2013</copyright>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.603" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.606" />
|
||||
<dependency id="NLog" version="3.2.0.0" />
|
||||
<dependency id="SimpleInjector" version="2.7.0" />
|
||||
</dependencies>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common</id>
|
||||
<version>3.0.603</version>
|
||||
<version>3.0.606</version>
|
||||
<title>MediaBrowser.Common</title>
|
||||
<authors>Emby Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Model.Signed</id>
|
||||
<version>3.0.603</version>
|
||||
<version>3.0.606</version>
|
||||
<title>MediaBrowser.Model - Signed Edition</title>
|
||||
<authors>Emby Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Server.Core</id>
|
||||
<version>3.0.603</version>
|
||||
<version>3.0.606</version>
|
||||
<title>Media Browser.Server.Core</title>
|
||||
<authors>Emby Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<description>Contains core components required to build plugins for Emby Server.</description>
|
||||
<copyright>Copyright © Emby 2013</copyright>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.603" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.606" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
|
Loading…
Reference in New Issue
Block a user