diff --git a/app/views/master_files/hls_manifest.m3u8.erb b/app/views/master_files/hls_manifest.m3u8.erb index 6dc4bd3965..47eb8c5f18 100644 --- a/app/views/master_files/hls_manifest.m3u8.erb +++ b/app/views/master_files/hls_manifest.m3u8.erb @@ -15,7 +15,9 @@ Unless required by applicable law or agreed to in writing, software distributed %> #EXTM3U <% if @master_file.has_captions? %> -<% @master_file.supplemental_file_captions.append(@master_file.captions).each_with_index do |caption, index| %> +<% captions_list = @master_file.supplemental_file_captions %> +<% captions_list.append(@master_file.captions) if @master_file.captions.content %> +<% captions_list.each_with_index do |caption, index| %> <% label = caption.is_a?(SupplementalFile) ? caption.label : 'English' %> <% language = caption.is_a?(SupplementalFile) ? caption.language : 'en' %> <% id = caption.is_a?(SupplementalFile) ? caption.id : 'master_file_caption' %>