コード例 #1
0
 @Override
 public void onPause() {
   super.onPause();
   if (!enableBackgroundAudio) {
     releasePlayer();
   } else {
     player.setBackgrounded(true);
   }
   shutterView.setVisibility(View.VISIBLE);
 }
コード例 #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);
 }
コード例 #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);
   }
 }