From 43fcb369249a61d9de6eea09637f5b02aa8dc007 Mon Sep 17 00:00:00 2001 From: olly Date: Tue, 12 Jan 2016 05:43:24 -0800 Subject: [PATCH] Use APPLICATION_M3U8 as the mimeType for media playlists. Given we need to do this in HlsPlaylistParser in the normal case (i.e. not MEDIA_TAG), we may as well just be consistent and do it everywhere. Issue: #151 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=111941335 --- .../java/com/google/android/exoplayer/hls/HlsChunkSource.java | 1 - .../com/google/android/exoplayer/hls/HlsPlaylistParser.java | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/library/src/main/java/com/google/android/exoplayer/hls/HlsChunkSource.java b/library/src/main/java/com/google/android/exoplayer/hls/HlsChunkSource.java index 7f39907c82..9426a3e0ec 100644 --- a/library/src/main/java/com/google/android/exoplayer/hls/HlsChunkSource.java +++ b/library/src/main/java/com/google/android/exoplayer/hls/HlsChunkSource.java @@ -212,7 +212,6 @@ public class HlsChunkSource implements HlsTrackSelector.Output { if (playlist.type == HlsPlaylist.TYPE_MASTER) { masterPlaylist = (HlsMasterPlaylist) playlist; } else { - // TODO: Infer the mime type from a chunk file extension. Format format = new Format("0", MimeTypes.APPLICATION_M3U8, -1, -1, -1, -1, -1, -1, null, null); List variants = new ArrayList<>(); diff --git a/library/src/main/java/com/google/android/exoplayer/hls/HlsPlaylistParser.java b/library/src/main/java/com/google/android/exoplayer/hls/HlsPlaylistParser.java index 75929fc7c3..432229fb28 100644 --- a/library/src/main/java/com/google/android/exoplayer/hls/HlsPlaylistParser.java +++ b/library/src/main/java/com/google/android/exoplayer/hls/HlsPlaylistParser.java @@ -158,8 +158,8 @@ public final class HlsPlaylistParser implements UriLoadable.Parser String subtitleName = HlsParserUtil.parseStringAttr(line, NAME_ATTR_REGEX, NAME_ATTR); String uri = HlsParserUtil.parseStringAttr(line, URI_ATTR_REGEX, URI_ATTR); String language = HlsParserUtil.parseOptionalStringAttr(line, LANGUAGE_ATTR_REGEX); - Format format = new Format(subtitleName, MimeTypes.TEXT_VTT, -1, -1, -1, -1, -1, -1, - language, codecs); + Format format = new Format(subtitleName, MimeTypes.APPLICATION_M3U8, -1, -1, -1, -1, -1, + -1, language, codecs); subtitles.add(new Variant(uri, format)); } else { // TODO: Support other types of media tag.