Compatibility issue when calling method
We confirm a compatibility issue which might threaten the robustness of your app and give a detailed suggestion for you.
In ''com.owncloud.android.ui.preview.PreviewVideoActivity", you invoke the API "<com.google.android.exoplayer2.SimpleExoPlayer$Builder: com.google.android.exoplayer2.SimpleExoPlayer build()>" in "preparePlayer" method as shown in following. But actually, this API invoke the framwork API "<android.media.AudioManager: boolean isStreamMute(int)> ", which is introduced after API level 23 (https://developer.android.google.cn/reference/kotlin/android/os/BaseBundle?hl=en#getint_1).
// Video player internal methods
private void preparePlayer() {
AdaptiveTrackSelection.Factory videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory();
trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);
// Video streaming is only supported at Jelly Bean or higher Android versions (>= API 16)
// Create the player
player = new ExoPlayer.Builder(requireContext()).setTrackSelector(trackSelector).setLoadControl(new DefaultLoadControl()).build();
player.addListener(this);
// Bind the player to the view.
exoPlayerView.setPlayer(player);
// Prepare video player asynchronously
new PrepareVideoPlayerAsyncTask(getActivity(), this, getFile(), mAccount).execute();
}
So when the app try to invoke this API on devices before API level 23, your app will run with an unpredictable results. So we suggest you add an "if(SDK_INT >= 23)" to fix this potential issue.
Android device
- Device: [e.g. Emulator]
- OS: [e.g. API 21 22]
- Owncloud Version: [2.20]
We will implement https://github.com/owncloud/android/issues/3245 very soon. This should fix the problem.
Thanks a lot for your suggestion!