Search in sources :

Example 1 with MediaQueue

use of com.google.android.gms.cast.framework.media.MediaQueue in project ExoPlayer by google.

the class CastTimelineTrackerTest method mockRemoteMediaClient.

private static RemoteMediaClient mockRemoteMediaClient(int[] itemIds, int currentItemId, long currentDurationMs) {
    RemoteMediaClient remoteMediaClient = Mockito.mock(RemoteMediaClient.class);
    MediaStatus status = Mockito.mock(MediaStatus.class);
    when(status.getQueueItems()).thenReturn(Collections.emptyList());
    when(remoteMediaClient.getMediaStatus()).thenReturn(status);
    when(status.getMediaInfo()).thenReturn(getMediaInfo(currentDurationMs));
    when(status.getCurrentItemId()).thenReturn(currentItemId);
    MediaQueue mediaQueue = mockMediaQueue(itemIds);
    when(remoteMediaClient.getMediaQueue()).thenReturn(mediaQueue);
    return remoteMediaClient;
}
Also used : MediaQueue(com.google.android.gms.cast.framework.media.MediaQueue) RemoteMediaClient(com.google.android.gms.cast.framework.media.RemoteMediaClient) MediaStatus(com.google.android.gms.cast.MediaStatus)

Example 2 with MediaQueue

use of com.google.android.gms.cast.framework.media.MediaQueue in project ExoPlayer by google.

the class CastTimelineTrackerTest method mockMediaQueue.

private static MediaQueue mockMediaQueue(int[] itemIds) {
    MediaQueue mediaQueue = Mockito.mock(MediaQueue.class);
    when(mediaQueue.getItemIds()).thenReturn(itemIds);
    return mediaQueue;
}
Also used : MediaQueue(com.google.android.gms.cast.framework.media.MediaQueue)

Aggregations

MediaQueue (com.google.android.gms.cast.framework.media.MediaQueue)2 MediaStatus (com.google.android.gms.cast.MediaStatus)1 RemoteMediaClient (com.google.android.gms.cast.framework.media.RemoteMediaClient)1