com.google.android.exoplayer2.drm.UnsupportedDrmException Java Examples

The following examples show how to use com.google.android.exoplayer2.drm.UnsupportedDrmException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MediaPlayerFragment.java    From PowerFileExplorer with GNU General Public License v3.0 6 votes vote down vote up
private DrmSessionManager<FrameworkMediaCrypto> buildDrmSessionManager(UUID uuid,
																	   String licenseUrl, String[] keyRequestPropertiesArray) throws UnsupportedDrmException {
	if (Util.SDK_INT < 18) {
		return null;
	}
	HttpMediaDrmCallback drmCallback = new HttpMediaDrmCallback(licenseUrl,
																buildHttpDataSourceFactory(false));
	if (keyRequestPropertiesArray != null) {
		for (int i = 0; i < keyRequestPropertiesArray.length - 1; i += 2) {
			drmCallback.setKeyRequestProperty(keyRequestPropertiesArray[i],
											  keyRequestPropertiesArray[i + 1]);
		}
	}
	return new DefaultDrmSessionManager<FrameworkMediaCrypto>(uuid,
										  FrameworkMediaDrm.newInstance(uuid), drmCallback, null, mainHandler, eventLogger);
}
 
Example #2
Source File: DashTest.java    From ExoPlayer-Offline with Apache License 2.0 6 votes vote down vote up
@Override
protected final DefaultDrmSessionManager<FrameworkMediaCrypto> buildDrmSessionManager(
    final String userAgent) {
  DefaultDrmSessionManager<FrameworkMediaCrypto> drmSessionManager = null;
  if (parameters.isWidevineEncrypted) {
    try {
      MediaDrmCallback drmCallback = new HttpMediaDrmCallback(parameters.widevineLicenseUrl,
          new DefaultHttpDataSourceFactory(userAgent));
      drmSessionManager = DefaultDrmSessionManager.newWidevineInstance(drmCallback, null,
          null, null);
      if (!parameters.useL1Widevine) {
        drmSessionManager.setPropertyString(SECURITY_LEVEL_PROPERTY, WIDEVINE_SECURITY_LEVEL_3);
      }
      if (offlineLicenseKeySetId != null) {
        drmSessionManager.setMode(DefaultDrmSessionManager.MODE_PLAYBACK,
            offlineLicenseKeySetId);
      }
    } catch (UnsupportedDrmException e) {
      throw new IllegalStateException(e);
    }
  }
  return drmSessionManager;
}
 
Example #3
Source File: PlayerActivity.java    From leafpicrevived with GNU General Public License v3.0 5 votes vote down vote up
private DrmSessionManager<FrameworkMediaCrypto> buildDrmSessionManagerV18(UUID uuid,
                                                                              String licenseUrl, String[] keyRequestPropertiesArray, boolean multiSession)
            throws UnsupportedDrmException {
        HttpMediaDrmCallback drmCallback = new HttpMediaDrmCallback(licenseUrl,
                buildHttpDataSourceFactory(false));
        if (keyRequestPropertiesArray != null) {
            for (int i = 0; i < keyRequestPropertiesArray.length - 1; i += 2) {
                drmCallback.setKeyRequestProperty(keyRequestPropertiesArray[i],
                        keyRequestPropertiesArray[i + 1]);
            }
        }
//        return new DefaultDrmSessionManager<FrameworkMediaCrypto>(uuid, FrameworkMediaDrm.newInstance(uuid), drmCallback,
//                null, mainHandler, null, multiSession);
        return null;
    }
 
Example #4
Source File: PlayerActivity.java    From ExoPlayer-Offline with Apache License 2.0 5 votes vote down vote up
private DrmSessionManager<FrameworkMediaCrypto> buildDrmSessionManager(UUID uuid,
                                                                       String licenseUrl, Map<String, String> keyRequestProperties) throws UnsupportedDrmException {
    if (Util.SDK_INT < 18) {
        return null;
    }
    HttpMediaDrmCallback drmCallback = new HttpMediaDrmCallback(licenseUrl,
            buildHttpDataSourceFactory(false), keyRequestProperties);
    return new DefaultDrmSessionManager<>(uuid,
            FrameworkMediaDrm.newInstance(uuid), drmCallback, null, mainHandler, eventLogger);
}
 
Example #5
Source File: DashTest.java    From ExoPlayer-Offline with Apache License 2.0 5 votes vote down vote up
public TestOfflineLicenseHelper(DashHostedTestEncParameters parameters)
    throws UnsupportedDrmException {
  this.parameters = parameters;
  httpDataSourceFactory = new DefaultHttpDataSourceFactory("ExoPlayerPlaybackTests");
  offlineLicenseHelper = OfflineLicenseHelper.newWidevineInstance(
      parameters.widevineLicenseUrl, httpDataSourceFactory);
}
 
Example #6
Source File: FrameworkMediaDrmCreator.java    From no-player with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("PMD.PreserveStackTrace")  // We just unwrap the exception because we don't care about the UnsupportedDrmException itself
FrameworkMediaDrm create(UUID uuid) {
    try {
        return FrameworkMediaDrm.newInstance(uuid);
    } catch (UnsupportedDrmException e) {
        throw new FrameworkMediaDrmException(e.getMessage(), e.getCause());
    }
}
 
Example #7
Source File: RendererErrorMapper.java    From no-player with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({"PMD.StdCyclomaticComplexity", "PMD.CyclomaticComplexity", "PMD.ModifiedCyclomaticComplexity", "PMD.NPathComplexity"})
static NoPlayer.PlayerError map(Exception rendererException, String message) {
    if (rendererException instanceof AudioSink.ConfigurationException) {
        return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.AUDIO_SINK_CONFIGURATION_ERROR, message);
    }

    if (rendererException instanceof AudioSink.InitializationException) {
        return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.AUDIO_SINK_INITIALISATION_ERROR, message);
    }

    if (rendererException instanceof AudioSink.WriteException) {
        return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.AUDIO_SINK_WRITE_ERROR, message);
    }

    if (rendererException instanceof AudioProcessor.UnhandledFormatException) {
        return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.AUDIO_UNHANDLED_FORMAT_ERROR, message);
    }

    if (rendererException instanceof AudioDecoderException) {
        return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.AUDIO_DECODER_ERROR, message);
    }

    if (rendererException instanceof MediaCodecRenderer.DecoderInitializationException) {
        MediaCodecRenderer.DecoderInitializationException decoderInitializationException =
                (MediaCodecRenderer.DecoderInitializationException) rendererException;
        String fullMessage = "decoder-name:" + decoderInitializationException.decoderName + ", "
                + "mimetype:" + decoderInitializationException.mimeType + ", "
                + "secureCodeRequired:" + decoderInitializationException.secureDecoderRequired + ", "
                + "diagnosticInfo:" + decoderInitializationException.diagnosticInfo + ", "
                + "exceptionMessage:" + message;
        return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.INITIALISATION_ERROR, fullMessage);
    }

    if (rendererException instanceof MediaCodecUtil.DecoderQueryException) {
        return new NoPlayerError(PlayerErrorType.DEVICE_MEDIA_CAPABILITIES, DetailErrorType.UNKNOWN, message);
    }

    if (rendererException instanceof SubtitleDecoderException) {
        return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.DECODING_SUBTITLE_ERROR, message);
    }

    if (rendererException instanceof UnsupportedDrmException) {
        return mapUnsupportedDrmException((UnsupportedDrmException) rendererException, message);
    }

    if (rendererException instanceof DefaultDrmSessionManager.MissingSchemeDataException) {
        return new NoPlayerError(PlayerErrorType.DRM, DetailErrorType.CANNOT_ACQUIRE_DRM_SESSION_MISSING_SCHEME_FOR_REQUIRED_UUID_ERROR, message);
    }

    if (rendererException instanceof DrmSession.DrmSessionException) {
        return new NoPlayerError(PlayerErrorType.DRM, DetailErrorType.DRM_SESSION_ERROR, message);
    }

    if (rendererException instanceof KeysExpiredException) {
        return new NoPlayerError(PlayerErrorType.DRM, DetailErrorType.DRM_KEYS_EXPIRED_ERROR, message);
    }

    if (rendererException instanceof DecryptionException) {
        return new NoPlayerError(PlayerErrorType.CONTENT_DECRYPTION, DetailErrorType.FAIL_DECRYPT_DATA_DUE_NON_PLATFORM_COMPONENT_ERROR, message);
    }

    if (rendererException instanceof MediaCodec.CryptoException) {
        return mapCryptoException((MediaCodec.CryptoException) rendererException, message);
    }

    if (rendererException instanceof IllegalStateException) {
        return new NoPlayerError(PlayerErrorType.DRM, DetailErrorType.MEDIA_REQUIRES_DRM_SESSION_MANAGER_ERROR, message);
    }

    return new NoPlayerError(PlayerErrorType.UNKNOWN, DetailErrorType.UNKNOWN, message);
}
 
Example #8
Source File: RendererErrorMapper.java    From no-player with Apache License 2.0 5 votes vote down vote up
private static NoPlayer.PlayerError mapUnsupportedDrmException(UnsupportedDrmException unsupportedDrmException, String message) {
    switch (unsupportedDrmException.reason) {
        case UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME:
            return new NoPlayerError(PlayerErrorType.DRM, DetailErrorType.UNSUPPORTED_DRM_SCHEME_ERROR, message);
        case UnsupportedDrmException.REASON_INSTANTIATION_ERROR:
            return new NoPlayerError(PlayerErrorType.DRM, DetailErrorType.DRM_INSTANTIATION_ERROR, message);
        default:
            return new NoPlayerError(PlayerErrorType.DRM, DetailErrorType.DRM_UNKNOWN_ERROR, message);
    }
}
 
Example #9
Source File: PlayerActivity.java    From leafpicrevived with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Internal methods
 */
private void initializePlayer() {
    Intent intent = getIntent();
    boolean needNewPlayer = player == null;
    if (needNewPlayer) {

        TrackSelection.Factory adaptiveTrackSelectionFactory =
                new AdaptiveTrackSelection.Factory(BANDWIDTH_METER);

        trackSelector = new DefaultTrackSelector(adaptiveTrackSelectionFactory);
        trackSelectionHelper = new TrackSelectionHelper(trackSelector, adaptiveTrackSelectionFactory, getThemeHelper());
        lastSeenTrackGroupArray = null;

        UUID drmSchemeUuid = intent.hasExtra(DRM_SCHEME_UUID_EXTRA)
                ? UUID.fromString(intent.getStringExtra(DRM_SCHEME_UUID_EXTRA)) : null;
        DrmSessionManager<FrameworkMediaCrypto> drmSessionManager = null;
        if (drmSchemeUuid != null) {
            String drmLicenseUrl = intent.getStringExtra(DRM_LICENSE_URL);
            String[] keyRequestPropertiesArray = intent.getStringArrayExtra(DRM_KEY_REQUEST_PROPERTIES);
            boolean multiSession = intent.getBooleanExtra(DRM_MULTI_SESSION, false);
            int errorStringId = R.string.error_drm_unknown;
            try {
                drmSessionManager = buildDrmSessionManagerV18(drmSchemeUuid, drmLicenseUrl,
                        keyRequestPropertiesArray, multiSession);
            } catch (UnsupportedDrmException e) {
                errorStringId = e.reason == UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME
                        ? R.string.error_drm_unsupported_scheme : R.string.error_drm_unknown;
            }
            if (drmSessionManager == null) {
                showToast(errorStringId);
                return;
            }
        }
        DefaultRenderersFactory renderersFactory = new DefaultRenderersFactory(this,
                drmSessionManager, DefaultRenderersFactory.EXTENSION_RENDERER_MODE_PREFER);
        player = ExoPlayerFactory.newSimpleInstance(this.context, trackSelector);
        player.addListener(new PlayerEventListener());
        simpleExoPlayerView.setPlayer(player);
        player.setPlayWhenReady(shouldAutoPlay);
        if (Prefs.getLoopVideo()) {
            player.setRepeatMode(Player.REPEAT_MODE_ALL);
        } else {
            player.setRepeatMode(Player.REPEAT_MODE_OFF);
        }
    }

    String action = intent.getAction();
    Uri[] uris;
    String[] extensions;
    if (intent.getData() != null && intent.getType() != null) {
        uris = new Uri[]{intent.getData()};
        extensions = new String[]{intent.getType()};
    } else {
        // TODO: 12/7/16 asdasd
        showToast(getString(R.string.unexpected_intent_action, action));
        return;
    }

    MediaSource[] mediaSources = new MediaSource[uris.length];
    for (int i = 0; i < uris.length; i++) {
        mediaSources[i] = buildMediaSource(uris[i], extensions[i]);
    }
    MediaSource mediaSource = mediaSources.length == 1 ? mediaSources[0]
            : new ConcatenatingMediaSource(mediaSources);

    boolean haveResumePosition = resumeWindow != C.INDEX_UNSET;
    if (haveResumePosition) {
        player.seekTo(resumeWindow, resumePosition);
    }
    player.prepare(mediaSource, !haveResumePosition, false);
    inErrorState = false;
    supportInvalidateOptionsMenu();

}
 
Example #10
Source File: MediaPlayerFragment.java    From PowerFileExplorer with GNU General Public License v3.0 4 votes vote down vote up
private void initializePlayer() {
	Intent intent = fragActivity.getIntent();
	boolean needNewPlayer = player == null;
	if (needNewPlayer) {
		boolean preferExtensionDecoders = intent.getBooleanExtra(PREFER_EXTENSION_DECODERS, false);
		UUID drmSchemeUuid = intent.hasExtra(DRM_SCHEME_UUID_EXTRA)
			? UUID.fromString(intent.getStringExtra(DRM_SCHEME_UUID_EXTRA)) : null;
		DrmSessionManager<FrameworkMediaCrypto> drmSessionManager = null;
		if (drmSchemeUuid != null) {
			String drmLicenseUrl = intent.getStringExtra(DRM_LICENSE_URL);
			String[] keyRequestPropertiesArray = intent.getStringArrayExtra(DRM_KEY_REQUEST_PROPERTIES);
			try {
				drmSessionManager = buildDrmSessionManager(drmSchemeUuid, drmLicenseUrl,
														   keyRequestPropertiesArray);
			} catch (UnsupportedDrmException e) {
				int errorStringId = Util.SDK_INT < 18 ? R.string.error_drm_not_supported
					: (e.reason == UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME
					? R.string.error_drm_unsupported_scheme : R.string.error_drm_unknown);
				showToast(errorStringId);
				return;
			}
		}

		@SimpleExoPlayer.ExtensionRendererMode int extensionRendererMode =
			((ExplorerApplication) fragActivity.getApplication()).useExtensionRenderers()
			? (preferExtensionDecoders ? SimpleExoPlayer.EXTENSION_RENDERER_MODE_PREFER
			: SimpleExoPlayer.EXTENSION_RENDERER_MODE_ON)
			: SimpleExoPlayer.EXTENSION_RENDERER_MODE_OFF;
		TrackSelection.Factory videoTrackSelectionFactory =
			new AdaptiveTrackSelection.Factory(BANDWIDTH_METER);
		trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);
		trackSelectionHelper = new TrackSelectionHelper(trackSelector, videoTrackSelectionFactory);
		player = ExoPlayerFactory.newSimpleInstance(fragActivity, trackSelector, new DefaultLoadControl(),
													drmSessionManager, extensionRendererMode);
		player.addListener(this);

		eventLogger = new EventLogger(trackSelector);
		player.addListener(eventLogger);
		player.setAudioDebugListener(eventLogger);
		player.setVideoDebugListener(eventLogger);
		player.setMetadataOutput(eventLogger);

		simpleExoPlayerView.setPlayer(player);
		player.setPlayWhenReady(shouldAutoPlay);
		debugViewHelper = new DebugTextViewHelper(player, debugTextView);
		debugViewHelper.start();
	}
	if (needNewPlayer || needRetrySource) {
		String action = intent.getAction();
		Uri[] uris;
		String[] extensions;
		if (Intent.ACTION_VIEW.equals(action)) {
			uris = new Uri[] {intent.getData()};
			extensions = new String[] {intent.getStringExtra(EXTENSION_EXTRA)};
		} else if (ACTION_VIEW.equals(action)) {
			uris = new Uri[] {intent.getData()};
			extensions = new String[] {intent.getStringExtra(EXTENSION_EXTRA)};
		} else if (ACTION_VIEW_LIST.equals(action)) {
			String[] uriStrings = intent.getStringArrayExtra(URI_LIST_EXTRA);
			uris = new Uri[uriStrings.length];
			for (int i = 0; i < uriStrings.length; i++) {
				uris[i] = Uri.parse(uriStrings[i]);
			}
			extensions = intent.getStringArrayExtra(EXTENSION_LIST_EXTRA);
			if (extensions == null) {
				extensions = new String[uriStrings.length];
			}
		} else {
			if (!Intent.ACTION_MAIN.equals(action)) {
				showToast(getString(R.string.unexpected_intent_action, action));
			}
			return;
		}
		if (Util.maybeRequestReadExternalStoragePermission(fragActivity, uris)) {
			// The player will be reinitialized if the permission is granted.
			return;
		}
		MediaSource[] mediaSources = new MediaSource[uris.length];
		for (int i = 0; i < uris.length; i++) {
			mediaSources[i] = buildMediaSource(uris[i], extensions[i]);
		}
		MediaSource mediaSource = mediaSources.length == 1 ? mediaSources[0]
			: new ConcatenatingMediaSource(mediaSources);
		boolean haveResumePosition = resumeWindow != C.INDEX_UNSET;
		if (haveResumePosition) {
			player.seekTo(resumeWindow, resumePosition);
		}
		player.prepare(mediaSource, !haveResumePosition, false);
		needRetrySource = false;
		updateButtonVisibilities();
	}
}
 
Example #11
Source File: PlayerActivity.java    From ExoPlayer-Offline with Apache License 2.0 4 votes vote down vote up
private DrmSessionManager<FrameworkMediaCrypto> buildOfflineDrmSessionManager(UUID uuid,
                                                                              String licenseUrl, Map<String, String> keyRequestProperties) throws UnsupportedDrmException, IOException, DrmSession.DrmSessionException, InterruptedException {
    if (Util.SDK_INT < 18) {
        return null;
    }

    customDrmCallback = new CustomDrmCallback(
            DemoApplication.getAppInstance().buildHttpDataSourceFactory(new DefaultBandwidthMeter()),
            licenseUrl
    );

    DefaultDrmSessionManager<FrameworkMediaCrypto> drmSessionManager = new DefaultDrmSessionManager<>(uuid,
            FrameworkMediaDrm.newInstance(uuid), customDrmCallback, null, mainHandler, eventLogger);

    String offlineAssetKeyIdStr = DemoApplication.getAppInstance().
            getSharedPreferences().getString(DemoApplication.KEY_OFFLINE_OFFSET_ID,DemoApplication.EMPTY);
    byte[] offlineAssetKeyId = Base64.decode(offlineAssetKeyIdStr, Base64.DEFAULT);
    this.offlineLicenseHelper = OfflineLicenseHelper.newWidevineInstance(customDrmCallback, null);
    Pair<Long, Long> remainingSecPair = offlineLicenseHelper.getLicenseDurationRemainingSec(offlineAssetKeyId);
    Log.e(TAG," License remaining Play time : "+remainingSecPair.first+", Purchase time : "+remainingSecPair.second);
    if(DemoApplication.EMPTY.equals(offlineAssetKeyIdStr) || ( remainingSecPair.first == 0 || remainingSecPair.second == 0)) {
        String path = getIntent().getStringExtra(EXTRA_OFFLINE_URI);
        File file = getUriForManifest(path);
        Uri uri = Uri.fromFile(file);
        InputStream is = new FileInputStream(file);
        Log.e(TAG, "will start download now");
        offlineAssetKeyId = offlineLicenseHelper.download(
                DemoApplication.getAppInstance().buildHttpDataSourceFactory(new DefaultBandwidthMeter()).createDataSource(),
                new DashManifestParser().parse(uri, is));
        Pair<Long, Long> p = offlineLicenseHelper.getLicenseDurationRemainingSec(offlineAssetKeyId);
        Log.e(TAG, "download done : " + p.toString());

        SharedPreferences sharedPreferences = DemoApplication.getAppInstance().getSharedPreferences();
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putString(DemoApplication.KEY_OFFLINE_OFFSET_ID,
                Base64.encodeToString(offlineAssetKeyId, Base64.DEFAULT));
        editor.commit();
    }


    drmSessionManager.setMode(DefaultDrmSessionManager.MODE_QUERY,offlineAssetKeyId);
    return drmSessionManager;
}
 
Example #12
Source File: ExoPlayerErrorMapperTest.java    From no-player with Apache License 2.0 4 votes vote down vote up
@Parameterized.Parameters(name = "{0} with detail {1} is mapped from {2}")
public static Collection<Object[]> parameters() {
    return Arrays.asList(
            new Object[]{SOURCE, SAMPLE_QUEUE_MAPPING_ERROR, createSource(new SampleQueueMappingException("mimetype-sample"))},
            new Object[]{SOURCE, READING_LOCAL_FILE_ERROR, createSource(new FileDataSource.FileDataSourceException(new IOException()))},
            new Object[]{SOURCE, UNEXPECTED_LOADING_ERROR, createSource(new Loader.UnexpectedLoaderException(new Throwable()))},
            new Object[]{SOURCE, LIVE_STALE_MANIFEST_AND_NEW_MANIFEST_COULD_NOT_LOAD_ERROR, createSource(new DashManifestStaleException())},
            new Object[]{SOURCE, DOWNLOAD_ERROR, createSource(new DownloadException("download-exception"))},
            new Object[]{SOURCE, AD_LOAD_ERROR_THEN_WILL_SKIP, createSource(AdsMediaSource.AdLoadException.createForAd(new Exception()))},
            new Object[]{SOURCE, AD_GROUP_LOAD_ERROR_THEN_WILL_SKIP, createSource(AdsMediaSource.AdLoadException.createForAdGroup(new Exception(), 0))},
            new Object[]{SOURCE, ALL_ADS_LOAD_ERROR_THEN_WILL_SKIP, createSource(AdsMediaSource.AdLoadException.createForAllAds(new Exception()))},
            new Object[]{SOURCE, ADS_LOAD_UNEXPECTED_ERROR_THEN_WILL_SKIP, createSource(AdsMediaSource.AdLoadException.createForUnexpected(new RuntimeException()))},
            new Object[]{SOURCE, MERGING_MEDIA_SOURCE_CANNOT_MERGE_ITS_SOURCES, createSource(new MergingMediaSource.IllegalMergeException(MergingMediaSource.IllegalMergeException.REASON_PERIOD_COUNT_MISMATCH))},
            new Object[]{SOURCE, CLIPPING_MEDIA_SOURCE_CANNOT_CLIP_WRAPPED_SOURCE_INVALID_PERIOD_COUNT, createSource(new ClippingMediaSource.IllegalClippingException(ClippingMediaSource.IllegalClippingException.REASON_INVALID_PERIOD_COUNT))},
            new Object[]{SOURCE, CLIPPING_MEDIA_SOURCE_CANNOT_CLIP_WRAPPED_SOURCE_NOT_SEEKABLE_TO_START, createSource(new ClippingMediaSource.IllegalClippingException(ClippingMediaSource.IllegalClippingException.REASON_NOT_SEEKABLE_TO_START))},
            new Object[]{SOURCE, CLIPPING_MEDIA_SOURCE_CANNOT_CLIP_WRAPPED_SOURCE_INVALID_PERIOD_COUNT, createSource(new ClippingMediaSource.IllegalClippingException(ClippingMediaSource.IllegalClippingException.REASON_INVALID_PERIOD_COUNT))},
            new Object[]{SOURCE, TASK_CANNOT_PROCEED_PRIORITY_TOO_LOW, createSource(new PriorityTaskManager.PriorityTooLowException(1, 2))},
            new Object[]{SOURCE, PARSING_MEDIA_DATA_OR_METADATA_ERROR, createSource(new ParserException())},
            new Object[]{SOURCE, CACHE_WRITING_DATA_ERROR, createSource(new Cache.CacheException("cache-exception"))},
            new Object[]{SOURCE, READ_LOCAL_ASSET_ERROR, createSource(new AssetDataSource.AssetDataSourceException(new IOException()))},
            new Object[]{SOURCE, DATA_POSITION_OUT_OF_RANGE_ERROR, createSource(new DataSourceException(DataSourceException.POSITION_OUT_OF_RANGE))},

            new Object[]{CONNECTIVITY, HTTP_CANNOT_OPEN_ERROR, createSource(new HttpDataSource.HttpDataSourceException(new DataSpec(Uri.EMPTY, 0), HttpDataSource.HttpDataSourceException.TYPE_OPEN))},
            new Object[]{CONNECTIVITY, HTTP_CANNOT_READ_ERROR, createSource(new HttpDataSource.HttpDataSourceException(new DataSpec(Uri.EMPTY, 0), HttpDataSource.HttpDataSourceException.TYPE_READ))},
            new Object[]{CONNECTIVITY, HTTP_CANNOT_CLOSE_ERROR, createSource(new HttpDataSource.HttpDataSourceException(new DataSpec(Uri.EMPTY, 0), HttpDataSource.HttpDataSourceException.TYPE_CLOSE))},
            new Object[]{CONNECTIVITY, READ_CONTENT_URI_ERROR, createSource(new ContentDataSource.ContentDataSourceException(new IOException()))},
            new Object[]{CONNECTIVITY, READ_FROM_UDP_ERROR, createSource(new UdpDataSource.UdpDataSourceException(new IOException()))},

            new Object[]{RENDERER_DECODER, AUDIO_SINK_CONFIGURATION_ERROR, createRenderer(new AudioSink.ConfigurationException("configuration-exception"))},
            new Object[]{RENDERER_DECODER, AUDIO_SINK_INITIALISATION_ERROR, createRenderer(new AudioSink.InitializationException(0, 0, 0, 0))},
            new Object[]{RENDERER_DECODER, AUDIO_SINK_WRITE_ERROR, createRenderer(new AudioSink.WriteException(0))},
            new Object[]{RENDERER_DECODER, AUDIO_UNHANDLED_FORMAT_ERROR, createRenderer(new AudioProcessor.UnhandledFormatException(0, 0, 0))},
            new Object[]{RENDERER_DECODER, AUDIO_DECODER_ERROR, createRenderer(new AudioDecoderException("audio-decoder-exception"))},
            new Object[]{RENDERER_DECODER, INITIALISATION_ERROR, createRenderer(new MediaCodecRenderer.DecoderInitializationException(Format.createSampleFormat("id", "sample-mimety[e", 0), new Throwable(), true, 0))},
            new Object[]{RENDERER_DECODER, DECODING_SUBTITLE_ERROR, createRenderer(new SubtitleDecoderException("metadata-decoder-exception"))},

            new Object[]{DRM, UNSUPPORTED_DRM_SCHEME_ERROR, createRenderer(new UnsupportedDrmException(UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME))},
            new Object[]{DRM, DRM_INSTANTIATION_ERROR, createRenderer(new UnsupportedDrmException(UnsupportedDrmException.REASON_INSTANTIATION_ERROR))},
            new Object[]{DRM, DRM_SESSION_ERROR, createRenderer(new DrmSession.DrmSessionException(new Throwable()))},
            new Object[]{DRM, DRM_KEYS_EXPIRED_ERROR, createRenderer(new KeysExpiredException())},
            new Object[]{DRM, MEDIA_REQUIRES_DRM_SESSION_MANAGER_ERROR, createRenderer(new IllegalStateException())},

            new Object[]{CONTENT_DECRYPTION, FAIL_DECRYPT_DATA_DUE_NON_PLATFORM_COMPONENT_ERROR, createRenderer(new DecryptionException(0, "decryption-exception"))},

            new Object[]{UNEXPECTED, MULTIPLE_RENDERER_MEDIA_CLOCK_ENABLED_ERROR, ExoPlaybackExceptionFactory.createForUnexpected(new IllegalStateException("Multiple renderer media clocks enabled."))},
            new Object[]{PlayerErrorType.UNKNOWN, DetailErrorType.UNKNOWN, ExoPlaybackExceptionFactory.createForUnexpected(new IllegalStateException("Any other exception"))}
            // DefaultAudioSink.InvalidAudioTrackTimestampException is private, cannot create
            // EGLSurfaceTexture.GlException is private, cannot create
            // PlaylistStuckException constructor is private, cannot create
            // PlaylistResetException constructor is private, cannot create
            // MediaCodecUtil.DecoderQueryException constructor is private, cannot create
            // DefaultDrmSessionManager.MissingSchemeDataException constructor is private, cannot create
            // Crypto Exceptions cannot be instantiated, it throws a RuntimeException("Stub!")
    );
}