fix media streaming in apiclient

This commit is contained in:
LukePulverenti 2013-02-27 13:25:00 -05:00
parent c4e505c062
commit 1c9eb1911a
3 changed files with 13 additions and 7 deletions

View File

@ -660,7 +660,12 @@ namespace MediaBrowser.ApiInteraction
throw new ArgumentNullException("options");
}
var handler = "audio." + options.OutputFileExtension.TrimStart('.');
var handler = "Audio/" + options.ItemId + "/stream";
if (!string.IsNullOrEmpty(options.OutputFileExtension))
{
handler += "." + options.OutputFileExtension.TrimStart('.');
}
return GetMediaStreamUrl(handler, options, new QueryStringDictionary());
}
@ -678,7 +683,12 @@ namespace MediaBrowser.ApiInteraction
throw new ArgumentNullException("options");
}
var handler = "video." + options.OutputFileExtension.TrimStart('.');
var handler = "Videos/" + options.ItemId + "/stream";
if (!string.IsNullOrEmpty(options.OutputFileExtension))
{
handler += "." + options.OutputFileExtension.TrimStart('.');
}
return GetVideoStreamUrl(handler, options);
}
@ -768,8 +778,6 @@ namespace MediaBrowser.ApiInteraction
throw new ArgumentNullException("queryParams");
}
queryParams.Add("id", options.ItemId);
if (options.AudioCodec.HasValue)
{
queryParams["audioCodec"] = options.AudioCodec.Value.ToString();

View File

@ -40,7 +40,6 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>

View File

@ -11,7 +11,6 @@ using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Web;
namespace MediaBrowser.Common.Net.Handlers
{
@ -108,7 +107,7 @@ namespace MediaBrowser.Common.Net.Handlers
get
{
// HttpListenerContext.Request.QueryString is not decoded properly
return _queryString ?? (_queryString = HttpUtility.ParseQueryString(HttpListenerContext.Request.Url.Query));
return _queryString;
}
}