Exemplo n.º 1
0
        public WebResolution GetStreamSize(WebMediaType type, int?provider, string itemId, int?offset, string profile)
        {
            if (type == WebMediaType.TV)
            {
                try
                {
                    itemId = _timeshiftings[itemId].TimeShiftFileName;
                }
                catch (KeyNotFoundException)
                {
                    // WebMP requests the default stream size with an empty name. This shouldn't flood the logs with warnings as people misinterpret them,
                    // and it's a TODO item in WebMP anyway.
                    if (itemId != String.Empty)
                    {
                        Log.Warn("Client tried to get stream size for non-existing timeshifting {0}, using default aspectratio", itemId);
                    }
                    return(_stream.CalculateSize(Configuration.StreamingProfiles.GetTranscoderProfileByName(profile), MediaInfoHelper.DEFAULT_ASPECT_RATIO).ToWebResolution());
                }
            }

            return(_stream.CalculateSize(Configuration.StreamingProfiles.GetTranscoderProfileByName(profile), new MediaSource(type, provider, itemId, offset)).ToWebResolution());
        }
Exemplo n.º 2
0
 public WebResolution GetStreamSize(WebStreamMediaType type, int?provider, string itemId, string profile)
 {
     return(_stream.CalculateSize(Configuration.Streaming.GetTranscoderProfileByName(profile), new MediaSource(type, provider, itemId)).ToWebResolution());
 }