use of com.google.android.exoplayer2.Format in project ExoPlayer by google.
the class DefaultHlsExtractorFactoryTest method createExtractor_onFailedSniff_fallsBackOnFormatInferred.
@Test
public void createExtractor_onFailedSniff_fallsBackOnFormatInferred() throws Exception {
ExtractorInput emptyExtractorInput = new FakeExtractorInput.Builder().build();
BundledHlsMediaChunkExtractor result = new DefaultHlsExtractorFactory().createExtractor(URI_WITH_MP4_EXTENSION, webVttFormat, /* muxedCaptionFormats= */
null, timestampAdjuster, ac3ResponseHeaders, emptyExtractorInput, PlayerId.UNSET);
// The format indicates WebVTT so we expect a WebVTT extractor.
assertThat(result.extractor.getClass()).isEqualTo(WebvttExtractor.class);
}
use of com.google.android.exoplayer2.Format in project ExoPlayer by google.
the class DefaultHlsExtractorFactoryTest method createExtractor_onFailedSniff_fallsBackOnHttpContentType.
@Test
public void createExtractor_onFailedSniff_fallsBackOnHttpContentType() throws Exception {
ExtractorInput emptyExtractorInput = new FakeExtractorInput.Builder().build();
BundledHlsMediaChunkExtractor result = new DefaultHlsExtractorFactory().createExtractor(URI_WITH_MP4_EXTENSION, new Format.Builder().build(), /* muxedCaptionFormats= */
null, timestampAdjuster, ac3ResponseHeaders, emptyExtractorInput, PlayerId.UNSET);
// No format info, so we expect an AC-3 Extractor, as per HTTP Content-Type header.
assertThat(result.extractor.getClass()).isEqualTo(Ac3Extractor.class);
}
use of com.google.android.exoplayer2.Format in project ExoPlayer by google.
the class DefaultHlsExtractorFactoryTest method createExtractor_onFailedSniff_fallsBackOnFileExtension.
@Test
public void createExtractor_onFailedSniff_fallsBackOnFileExtension() throws Exception {
ExtractorInput emptyExtractorInput = new FakeExtractorInput.Builder().build();
BundledHlsMediaChunkExtractor result = new DefaultHlsExtractorFactory().createExtractor(URI_WITH_MP4_EXTENSION, new Format.Builder().build(), /* muxedCaptionFormats= */
null, timestampAdjuster, /* responseHeaders= */
ImmutableMap.of(), emptyExtractorInput, PlayerId.UNSET);
// No format info, and no HTTP headers, so we expect an fMP4 extractor, as per file extension.
assertThat(result.extractor.getClass()).isEqualTo(FragmentedMp4Extractor.class);
}
use of com.google.android.exoplayer2.Format in project ExoPlayer by google.
the class HlsMultivariantPlaylistParserTest method parseMultivariantPlaylist_withCc_cCIdPropagated.
@Test
public void parseMultivariantPlaylist_withCc_cCIdPropagated() throws IOException {
HlsMultivariantPlaylist playlist = parseMultivariantPlaylist(PLAYLIST_URI, PLAYLIST_WITH_CC);
Format firstTextFormat = playlist.muxedCaptionFormats.get(0);
assertThat(firstTextFormat.id).isEqualTo("cc1:Eng");
}
use of com.google.android.exoplayer2.Format in project ExoPlayer by google.
the class HlsMultivariantPlaylistParserTest method parseMultivariantPlaylist_withAudio_audioIdPropagated.
@Test
public void parseMultivariantPlaylist_withAudio_audioIdPropagated() throws IOException {
HlsMultivariantPlaylist playlist = parseMultivariantPlaylist(PLAYLIST_URI, PLAYLIST_WITH_AUDIO_MEDIA_TAG);
Format firstAudioFormat = playlist.audios.get(0).format;
assertThat(firstAudioFormat.id).isEqualTo("aud1:English");
Format secondAudioFormat = playlist.audios.get(1).format;
assertThat(secondAudioFormat.id).isEqualTo("aud2:English");
}
Aggregations