From ecbec1f6fd26da204fa80bea171790f599975880 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 27 Mar 2013 11:08:02 -0400 Subject: [PATCH] one more allow cache fix --- MediaBrowser.Api/Playback/Hls/BaseHlsService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index 697f0feb43..6004129860 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -132,12 +132,14 @@ namespace MediaBrowser.Api.Playback.Hls // It's considered live while still encoding (EVENT). Once the encoding has finished, it's video on demand (VOD). var playlistType = fileText.IndexOf("#EXT-X-ENDLIST", StringComparison.OrdinalIgnoreCase) == -1 ? "EVENT" : "VOD"; + const string allowCacheAttributeName = "#EXT-X-ALLOW-CACHE"; + // fix this to make the media stream validator happy // https://ffmpeg.org/trac/ffmpeg/ticket/2228 - fileText = fileText.Replace("#EXT-X-ALLOWCACHE", "#EXT-X-ALLOW-CACHE"); + fileText = fileText.Replace("#EXT-X-ALLOWCACHE", allowCacheAttributeName); // Add event type at the top - fileText = fileText.Replace("#EXT-X-ALLOW-CACHE", "#EXT-X-PLAYLIST-TYPE:" + playlistType + Environment.NewLine + "#EXT-X-ALLOWCACHE"); + fileText = fileText.Replace(allowCacheAttributeName, "#EXT-X-PLAYLIST-TYPE:" + playlistType + Environment.NewLine + allowCacheAttributeName); return fileText; }