Exemplo n.º 1
0
 @Override
 public void onPause() {
   super.onPause();
   if (!enableBackgroundAudio) {
     releasePlayer();
   } else {
     player.setBackgrounded(true);
   }
   shutterView.setVisibility(View.VISIBLE);
 }
Exemplo n.º 2
0
 @Override
 public void onAudioCapabilitiesChanged(AudioCapabilities audioCapabilities) {
   if (player == null) {
     return;
   }
   boolean backgrounded = player.getBackgrounded();
   boolean playWhenReady = player.getPlayWhenReady();
   releasePlayer();
   preparePlayer(playWhenReady);
   player.setBackgrounded(backgrounded);
 }
Exemplo n.º 3
0
 @Override
 public void onResume() {
   super.onResume();
   Intent intent = getIntent();
   contentUri = intent.getData();
   contentType =
       intent.getIntExtra(
           CONTENT_TYPE_EXTRA,
           inferContentType(contentUri, intent.getStringExtra(CONTENT_EXT_EXTRA)));
   contentId = intent.getStringExtra(CONTENT_ID_EXTRA);
   configureSubtitleView();
   if (player == null) {
     preparePlayer(true);
   } else {
     player.setBackgrounded(false);
   }
 }