LiveStreamRequest.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using MediaBrowser.Model.Dlna;
  3. namespace MediaBrowser.Model.MediaInfo
  4. {
  5. public class LiveStreamRequest
  6. {
  7. public string OpenToken { get; set; }
  8. public Guid UserId { get; set; }
  9. public string PlaySessionId { get; set; }
  10. public long? MaxStreamingBitrate { get; set; }
  11. public long? StartTimeTicks { get; set; }
  12. public int? AudioStreamIndex { get; set; }
  13. public int? SubtitleStreamIndex { get; set; }
  14. public int? MaxAudioChannels { get; set; }
  15. public Guid ItemId { get; set; }
  16. public DeviceProfile DeviceProfile { get; set; }
  17. public bool EnableDirectPlay { get; set; }
  18. public bool EnableDirectStream { get; set; }
  19. public MediaProtocol[] DirectPlayProtocols { get; set; }
  20. public LiveStreamRequest()
  21. {
  22. EnableDirectPlay = true;
  23. EnableDirectStream = true;
  24. DirectPlayProtocols = new MediaProtocol[] { MediaProtocol.Http };
  25. }
  26. public LiveStreamRequest(AudioOptions options)
  27. {
  28. MaxStreamingBitrate = options.MaxBitrate;
  29. ItemId = options.ItemId;
  30. DeviceProfile = options.Profile;
  31. MaxAudioChannels = options.MaxAudioChannels;
  32. DirectPlayProtocols = new MediaProtocol[] { MediaProtocol.Http };
  33. var videoOptions = options as VideoOptions;
  34. if (videoOptions != null)
  35. {
  36. AudioStreamIndex = videoOptions.AudioStreamIndex;
  37. SubtitleStreamIndex = videoOptions.SubtitleStreamIndex;
  38. }
  39. }
  40. }
  41. }