Commit 8e1cdf32 authored by Geoffrey Métais's avatar Geoffrey Métais

Video player: delay first player call, prevent ANR

parent 470f1b5a
......@@ -2930,7 +2930,12 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
if (Permissions.checkReadStoragePermission(this, true) && !mSwitchingView)
mHandler.sendEmptyMessage(START_PLAYBACK);
mSwitchingView = false;
if (mService.getVolume() > 100 && !audioBoostEnabled) mService.setVolume(100);
mHandler.post(new Runnable() {
@Override
public void run() { // delay mediaplayer loading, prevent ANR
if (mService.getVolume() > 100 && !audioBoostEnabled) mService.setVolume(100);
}
});
mService.addCallback(this);
} else {
if (mService != null) mService.removeCallback(this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment