private async Task <object> GetAsync(GetMasterManifest request, string method) { if (string.Equals(request.AudioCodec, "copy", StringComparison.OrdinalIgnoreCase)) { throw new ArgumentException("Audio codec copy is not allowed here."); } if (string.Equals(request.VideoCodec, "copy", StringComparison.OrdinalIgnoreCase)) { throw new ArgumentException("Video codec copy is not allowed here."); } if (string.IsNullOrEmpty(request.MediaSourceId)) { throw new ArgumentException("MediaSourceId is required"); } var state = await GetState(request, CancellationToken.None).ConfigureAwait(false); var playlistText = string.Empty; if (string.Equals(method, "GET", StringComparison.OrdinalIgnoreCase)) { playlistText = GetManifestText(state); } return(ResultFactory.GetResult(playlistText, MimeTypes.GetMimeType("playlist.mpd"), new Dictionary <string, string>())); }
private async Task<object> GetAsync(GetMasterManifest request, string method) { if (string.Equals(request.AudioCodec, "copy", StringComparison.OrdinalIgnoreCase)) { throw new ArgumentException("Audio codec copy is not allowed here."); } if (string.Equals(request.VideoCodec, "copy", StringComparison.OrdinalIgnoreCase)) { throw new ArgumentException("Video codec copy is not allowed here."); } if (string.IsNullOrEmpty(request.MediaSourceId)) { throw new ArgumentException("MediaSourceId is required"); } var state = await GetState(request, CancellationToken.None).ConfigureAwait(false); var playlistText = string.Empty; if (string.Equals(method, "GET", StringComparison.OrdinalIgnoreCase)) { playlistText = GetManifestText(state); } return ResultFactory.GetResult(playlistText, Common.Net.MimeTypes.GetMimeType("playlist.mpd"), new Dictionary<string, string>()); }
public object Head(GetMasterManifest request) { var result = GetAsync(request, "HEAD").Result; return(result); }
public object Get(GetMasterManifest request) { var result = GetAsync(request, "GET").Result; return(result); }
public object Head(GetMasterManifest request) { var result = GetAsync(request, "HEAD").Result; return result; }
public object Get(GetMasterManifest request) { var result = GetAsync(request, "GET").Result; return result; }