mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Make back button pause player instead of quitting app
PiperOrigin-RevId: 700282443
This commit is contained in:
parent
f257e5511f
commit
e357629400
1 changed files with 12 additions and 0 deletions
|
|
@ -191,6 +191,18 @@ public final class CompositionPreviewActivity extends AppCompatActivity {
|
||||||
exportStopwatch.reset();
|
exportStopwatch.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("MissingSuperCall")
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
if (compositionPlayer != null) {
|
||||||
|
compositionPlayer.pause();
|
||||||
|
}
|
||||||
|
if (exportStopwatch.isRunning()) {
|
||||||
|
cancelExport();
|
||||||
|
exportStopwatch.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Composition prepareComposition() {
|
private Composition prepareComposition() {
|
||||||
String[] presetUris = getResources().getStringArray(/* id= */ R.array.preset_uris);
|
String[] presetUris = getResources().getStringArray(/* id= */ R.array.preset_uris);
|
||||||
int[] presetDurationsUs = getResources().getIntArray(/* id= */ R.array.preset_durations);
|
int[] presetDurationsUs = getResources().getIntArray(/* id= */ R.array.preset_durations);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue