mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix debug frame showing through player on old devices
PiperOrigin-RevId: 428524300
This commit is contained in:
parent
29c0054a0a
commit
d9253c6f51
1 changed files with 7 additions and 0 deletions
|
|
@ -103,6 +103,7 @@ public final class TransformerActivity extends AppCompatActivity {
|
||||||
checkNotNull(playerView);
|
checkNotNull(playerView);
|
||||||
checkNotNull(debugTextView);
|
checkNotNull(debugTextView);
|
||||||
checkNotNull(progressViewGroup);
|
checkNotNull(progressViewGroup);
|
||||||
|
checkNotNull(debugFrame);
|
||||||
startTransformation();
|
startTransformation();
|
||||||
|
|
||||||
playerView.onResume();
|
playerView.onResume();
|
||||||
|
|
@ -131,6 +132,7 @@ public final class TransformerActivity extends AppCompatActivity {
|
||||||
"progressIndicator",
|
"progressIndicator",
|
||||||
"transformationStopwatch",
|
"transformationStopwatch",
|
||||||
"progressViewGroup",
|
"progressViewGroup",
|
||||||
|
"debugFrame",
|
||||||
})
|
})
|
||||||
private void startTransformation() {
|
private void startTransformation() {
|
||||||
requestTransformerPermission();
|
requestTransformerPermission();
|
||||||
|
|
@ -188,6 +190,7 @@ public final class TransformerActivity extends AppCompatActivity {
|
||||||
"informationTextView",
|
"informationTextView",
|
||||||
"transformationStopwatch",
|
"transformationStopwatch",
|
||||||
"progressViewGroup",
|
"progressViewGroup",
|
||||||
|
"debugFrame",
|
||||||
})
|
})
|
||||||
private Transformer createTransformer(@Nullable Bundle bundle, String filePath) {
|
private Transformer createTransformer(@Nullable Bundle bundle, String filePath) {
|
||||||
Transformer.Builder transformerBuilder = new Transformer.Builder(/* context= */ this);
|
Transformer.Builder transformerBuilder = new Transformer.Builder(/* context= */ this);
|
||||||
|
|
@ -261,12 +264,14 @@ public final class TransformerActivity extends AppCompatActivity {
|
||||||
@RequiresNonNull({
|
@RequiresNonNull({
|
||||||
"informationTextView",
|
"informationTextView",
|
||||||
"progressViewGroup",
|
"progressViewGroup",
|
||||||
|
"debugFrame",
|
||||||
"transformationStopwatch",
|
"transformationStopwatch",
|
||||||
})
|
})
|
||||||
private void onTransformationError(TransformationException exception) {
|
private void onTransformationError(TransformationException exception) {
|
||||||
transformationStopwatch.stop();
|
transformationStopwatch.stop();
|
||||||
informationTextView.setText(R.string.transformation_error);
|
informationTextView.setText(R.string.transformation_error);
|
||||||
progressViewGroup.setVisibility(View.GONE);
|
progressViewGroup.setVisibility(View.GONE);
|
||||||
|
debugFrame.removeAllViews();
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
TransformerActivity.this, "Transformation error: " + exception, Toast.LENGTH_LONG)
|
TransformerActivity.this, "Transformation error: " + exception, Toast.LENGTH_LONG)
|
||||||
.show();
|
.show();
|
||||||
|
|
@ -278,6 +283,7 @@ public final class TransformerActivity extends AppCompatActivity {
|
||||||
"debugTextView",
|
"debugTextView",
|
||||||
"informationTextView",
|
"informationTextView",
|
||||||
"progressViewGroup",
|
"progressViewGroup",
|
||||||
|
"debugFrame",
|
||||||
"transformationStopwatch",
|
"transformationStopwatch",
|
||||||
})
|
})
|
||||||
private void onTransformationCompleted(String filePath) {
|
private void onTransformationCompleted(String filePath) {
|
||||||
|
|
@ -286,6 +292,7 @@ public final class TransformerActivity extends AppCompatActivity {
|
||||||
getString(
|
getString(
|
||||||
R.string.transformation_completed, transformationStopwatch.elapsed(TimeUnit.SECONDS)));
|
R.string.transformation_completed, transformationStopwatch.elapsed(TimeUnit.SECONDS)));
|
||||||
progressViewGroup.setVisibility(View.GONE);
|
progressViewGroup.setVisibility(View.GONE);
|
||||||
|
debugFrame.removeAllViews();
|
||||||
playerView.setVisibility(View.VISIBLE);
|
playerView.setVisibility(View.VISIBLE);
|
||||||
playMediaItem(MediaItem.fromUri("file://" + filePath));
|
playMediaItem(MediaItem.fromUri("file://" + filePath));
|
||||||
Log.d(TAG, "Output file path: file://" + filePath);
|
Log.d(TAG, "Output file path: file://" + filePath);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue