mirror of
https://github.com/samsonjs/media.git
synced 2026-04-09 11:55:46 +00:00
Make demo app ready for multi-window environment coming with N.
* Do not stop playback onPause but onStop in N and greater. * Fix back navigation after app has been put to background. * Make VIEW intent work when PlaybackActitivty is already launched. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=118022964
This commit is contained in:
parent
d5c80a31e8
commit
454b3e896c
2 changed files with 31 additions and 3 deletions
|
|
@ -41,8 +41,8 @@
|
|||
</activity>
|
||||
|
||||
<activity android:name="com.google.android.exoplayer.demo.PlayerActivity"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
|
||||
android:launchMode="singleInstance"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize|uiMode"
|
||||
android:launchMode="singleTop"
|
||||
android:label="@string/application_name"
|
||||
android:theme="@style/PlayerTheme">
|
||||
<intent-filter>
|
||||
|
|
|
|||
|
|
@ -180,9 +180,23 @@ public class PlayerActivity extends Activity implements SurfaceHolder.Callback,
|
|||
setIntent(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (Util.SDK_INT > 23) {
|
||||
onShown();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (Util.SDK_INT <= 23 || player == null) {
|
||||
onShown();
|
||||
}
|
||||
}
|
||||
|
||||
private void onShown() {
|
||||
Intent intent = getIntent();
|
||||
contentUri = intent.getData();
|
||||
contentType = intent.getIntExtra(CONTENT_TYPE_EXTRA,
|
||||
|
|
@ -197,9 +211,23 @@ public class PlayerActivity extends Activity implements SurfaceHolder.Callback,
|
|||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
if (Util.SDK_INT <= 23) {
|
||||
onHidden();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
if (Util.SDK_INT > 23) {
|
||||
onHidden();
|
||||
}
|
||||
}
|
||||
|
||||
private void onHidden() {
|
||||
shutterView.setVisibility(View.VISIBLE);
|
||||
releasePlayer();
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
// OnClickListener methods
|
||||
|
|
|
|||
Loading…
Reference in a new issue