Search in sources :

Example 16 with HlsMultivariantPlaylist

use of com.google.android.exoplayer2.source.hls.playlist.HlsMultivariantPlaylist in project ExoPlayer by google.

the class HlsMultivariantPlaylistParserTest method testIFrameVariant.

@Test
public void testIFrameVariant() throws IOException {
    HlsMultivariantPlaylist playlist = parseMultivariantPlaylist(PLAYLIST_URI, PLAYLIST_WITH_IFRAME_VARIANTS);
    assertThat(playlist.variants).hasSize(5);
    for (int i = 0; i < 4; i++) {
        assertThat(playlist.variants.get(i).format.roleFlags).isEqualTo(0);
    }
    Variant iFramesOnlyVariant = playlist.variants.get(4);
    assertThat(iFramesOnlyVariant.format.bitrate).isEqualTo(1313400);
    assertThat(iFramesOnlyVariant.format.roleFlags & C.ROLE_FLAG_TRICK_PLAY).isEqualTo(C.ROLE_FLAG_TRICK_PLAY);
}
Also used : Variant(com.google.android.exoplayer2.source.hls.playlist.HlsMultivariantPlaylist.Variant) Test(org.junit.Test)

Aggregations

Format (com.google.android.exoplayer2.Format)9 Test (org.junit.Test)9 Variant (com.google.android.exoplayer2.source.hls.playlist.HlsMultivariantPlaylist.Variant)6 ArrayList (java.util.ArrayList)6 Uri (android.net.Uri)5 HlsMultivariantPlaylist (com.google.android.exoplayer2.source.hls.playlist.HlsMultivariantPlaylist)4 Nullable (androidx.annotation.Nullable)3 DrmInitData (com.google.android.exoplayer2.drm.DrmInitData)3 TrackGroup (com.google.android.exoplayer2.source.TrackGroup)3 Rendition (com.google.android.exoplayer2.source.hls.playlist.HlsMultivariantPlaylist.Rendition)3 SchemeData (com.google.android.exoplayer2.drm.DrmInitData.SchemeData)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 AndroidJUnit4 (androidx.test.ext.junit.runners.AndroidJUnit4)1 PlayerId (com.google.android.exoplayer2.analytics.PlayerId)1 DrmSessionEventListener (com.google.android.exoplayer2.drm.DrmSessionEventListener)1 DrmSessionManager (com.google.android.exoplayer2.drm.DrmSessionManager)1 Metadata (com.google.android.exoplayer2.metadata.Metadata)1 StreamKey (com.google.android.exoplayer2.offline.StreamKey)1 CompositeSequenceableLoaderFactory (com.google.android.exoplayer2.source.CompositeSequenceableLoaderFactory)1