hls progress

pull/702/head
LukePulverenti 12 years ago
parent 38946150e7
commit 5591e05fdb

@ -675,10 +675,30 @@ namespace MediaBrowser.Api.Playback
{ {
return AudioCodecs.Aac; return AudioCodecs.Aac;
} }
if (string.Equals(ext, ".wam", StringComparison.OrdinalIgnoreCase)) if (string.Equals(ext, ".wma", StringComparison.OrdinalIgnoreCase))
{ {
return AudioCodecs.Wma; return AudioCodecs.Wma;
} }
if (string.Equals(ext, ".ogg", StringComparison.OrdinalIgnoreCase))
{
return AudioCodecs.Vorbis;
}
if (string.Equals(ext, ".oga", StringComparison.OrdinalIgnoreCase))
{
return AudioCodecs.Vorbis;
}
if (string.Equals(ext, ".ogv", StringComparison.OrdinalIgnoreCase))
{
return AudioCodecs.Vorbis;
}
if (string.Equals(ext, ".webm", StringComparison.OrdinalIgnoreCase))
{
return AudioCodecs.Vorbis;
}
if (string.Equals(ext, ".webma", StringComparison.OrdinalIgnoreCase))
{
return AudioCodecs.Vorbis;
}
return null; return null;
} }
@ -700,10 +720,14 @@ namespace MediaBrowser.Api.Playback
{ {
return VideoCodecs.Vpx; return VideoCodecs.Vpx;
} }
if (string.Equals(ext, ".ogg", StringComparison.OrdinalIgnoreCase)) if (string.Equals(ext, ".ogg", StringComparison.OrdinalIgnoreCase) || string.Equals(ext, ".ogv", StringComparison.OrdinalIgnoreCase))
{ {
return VideoCodecs.Theora; return VideoCodecs.Theora;
} }
if (string.Equals(ext, ".m3u8", StringComparison.OrdinalIgnoreCase) || string.Equals(ext, ".ts", StringComparison.OrdinalIgnoreCase))
{
return VideoCodecs.H264;
}
return null; return null;
} }

@ -84,12 +84,10 @@ namespace MediaBrowser.Api.Playback.Hls
// Get the current playlist text and convert to bytes // Get the current playlist text and convert to bytes
var playlistText = await GetPlaylistFileText(playlist, isPlaylistNewlyCreated).ConfigureAwait(false); var playlistText = await GetPlaylistFileText(playlist, isPlaylistNewlyCreated).ConfigureAwait(false);
var content = Encoding.UTF8.GetBytes(playlistText);
try try
{ {
Response.ContentType = MimeTypes.GetMimeType("playlist.m3u8"); Response.ContentType = MimeTypes.GetMimeType("playlist.m3u8");
return content; return playlistText;
} }
finally finally
{ {
@ -138,7 +136,7 @@ namespace MediaBrowser.Api.Playback.Hls
var playlistType = fileText.IndexOf("#EXT-X-ENDLIST", StringComparison.OrdinalIgnoreCase) == -1 ? "EVENT" : "VOD"; var playlistType = fileText.IndexOf("#EXT-X-ENDLIST", StringComparison.OrdinalIgnoreCase) == -1 ? "EVENT" : "VOD";
// Add event type at the top // Add event type at the top
fileText = fileText.Replace("#EXT-X-ALLOWCACHE", "#EXT-X-PLAYLIST-TYPE:" + playlistType + Environment.NewLine + "#EXT-X-ALLOWCACHE"); fileText = fileText.Replace("#EXT-X-ALLOW-CACHE", "#EXT-X-PLAYLIST-TYPE:" + playlistType + Environment.NewLine + "#EXT-X-ALLOWCACHE");
return fileText; return fileText;
} }

Loading…
Cancel
Save