Hello, I read Google, but did not find a solution to my problem.
The application uses hls-broadcasts, chose ExoPlayer as the player, since the full guides are an excellent demo. Everything works perfectly.
But there is a complaint from the tester that the sound of the broadcast continues after the screen is turned off. Catch this defect, he was able to rightly catching him once every two weeks. I didn’t manage to catch him at all.
At first I sinned on the player, but after long attempts to fix it, nothing has changed. Perhaps something needs to be fixed in the application itself, which it did not find, and therefore ask the question.
ExoPlayer latest version, the devices on which the defect was caught: Highscreen Prime Mini and Prestigio MultiPad.
The code that should work when minimized:

@Override public void onPause() { super.onPause(); FlurryAgent.onStartSession(getContext()); Map<String, String> Params = new HashMap<String, String>(); Params.put("test echo sound", "OnlinePlayerGragment onPause enableBackgroundAudio = "+enableBackgroundAudio); FlurryAgent.logEvent("TestEchoSound ",Params); try {//test Logi.d("OPF onPause"); if (!enableBackgroundAudio) { audioCapabilitiesReceiver.unregister(); releasePlayer(); } else { player.setBackgrounded(false);//was true } shutterView.setVisibility(View.VISIBLE); } catch (Exception e) { //тест } } private void releasePlayer() { // Logi.d("releasePlayer"); try { FlurryAgent.onStartSession(getContext()); Map<String, String> Params = new HashMap<String, String>(); Params.put("test echo sound", String.valueOf("OnlinePlayerGragment releasyPlayer "+ (player!= null))); FlurryAgent.logEvent("TestEchoSound ",Params); if (player != null) { debugViewHelper.stop(); debugViewHelper = null; playerPosition = player.getCurrentPosition(); player.release(); player = null; eventLogger.endSession(); eventLogger = null; } } catch (Exception e) { //тест } } 
  • At least you would attach the code as you try to stop playback when going into sleep mode. - xkor
  • wrap audioCapabilitiesReceiver.unregister(); in a separate try...catch string audioCapabilitiesReceiver.unregister(); If exception appears on it, playback will not stop. - Vladyslav Matviienko

0