Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1db1e8a9
authored
Mar 22, 2023
by
tofunmi
Committed by
Tianyi Feng
Mar 30, 2023
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Transformer Demo: Hide playback views during transformation
PiperOrigin-RevId: 518560945
parent
36e92918
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
demos/transformer/src/main/java/com/google/android/exoplayer2/transformerdemo/TransformerActivity.java
demos/transformer/src/main/res/layout/transformer_activity.xml
demos/transformer/src/main/java/com/google/android/exoplayer2/transformerdemo/TransformerActivity.java
View file @
1db1e8a9
...
@@ -118,6 +118,7 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -118,6 +118,7 @@ public final class TransformerActivity extends AppCompatActivity {
private
@MonotonicNonNull
ImageView
inputImageView
;
private
@MonotonicNonNull
ImageView
inputImageView
;
private
@MonotonicNonNull
StyledPlayerView
inputPlayerView
;
private
@MonotonicNonNull
StyledPlayerView
inputPlayerView
;
private
@MonotonicNonNull
StyledPlayerView
outputPlayerView
;
private
@MonotonicNonNull
StyledPlayerView
outputPlayerView
;
private
@MonotonicNonNull
TextView
outputVideoTextView
;
private
@MonotonicNonNull
TextView
debugTextView
;
private
@MonotonicNonNull
TextView
debugTextView
;
private
@MonotonicNonNull
TextView
informationTextView
;
private
@MonotonicNonNull
TextView
informationTextView
;
private
@MonotonicNonNull
ViewGroup
progressViewGroup
;
private
@MonotonicNonNull
ViewGroup
progressViewGroup
;
...
@@ -141,6 +142,7 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -141,6 +142,7 @@ public final class TransformerActivity extends AppCompatActivity {
inputImageView
=
findViewById
(
R
.
id
.
input_image_view
);
inputImageView
=
findViewById
(
R
.
id
.
input_image_view
);
inputPlayerView
=
findViewById
(
R
.
id
.
input_player_view
);
inputPlayerView
=
findViewById
(
R
.
id
.
input_player_view
);
outputPlayerView
=
findViewById
(
R
.
id
.
output_player_view
);
outputPlayerView
=
findViewById
(
R
.
id
.
output_player_view
);
outputVideoTextView
=
findViewById
(
R
.
id
.
output_video_text_view
);
debugTextView
=
findViewById
(
R
.
id
.
debug_text_view
);
debugTextView
=
findViewById
(
R
.
id
.
debug_text_view
);
informationTextView
=
findViewById
(
R
.
id
.
information_text_view
);
informationTextView
=
findViewById
(
R
.
id
.
information_text_view
);
progressViewGroup
=
findViewById
(
R
.
id
.
progress_view_group
);
progressViewGroup
=
findViewById
(
R
.
id
.
progress_view_group
);
...
@@ -171,6 +173,7 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -171,6 +173,7 @@ public final class TransformerActivity extends AppCompatActivity {
checkNotNull
(
inputImageView
);
checkNotNull
(
inputImageView
);
checkNotNull
(
inputPlayerView
);
checkNotNull
(
inputPlayerView
);
checkNotNull
(
outputPlayerView
);
checkNotNull
(
outputPlayerView
);
checkNotNull
(
outputVideoTextView
);
checkNotNull
(
debugTextView
);
checkNotNull
(
debugTextView
);
checkNotNull
(
progressViewGroup
);
checkNotNull
(
progressViewGroup
);
checkNotNull
(
debugFrame
);
checkNotNull
(
debugFrame
);
...
@@ -201,12 +204,13 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -201,12 +204,13 @@ public final class TransformerActivity extends AppCompatActivity {
}
}
@RequiresNonNull
({
@RequiresNonNull
({
"displayInputButton"
,
"inputCardView"
,
"inputCardView"
,
"inputTextView"
,
"inputTextView"
,
"inputImageView"
,
"inputImageView"
,
"inputPlayerView"
,
"inputPlayerView"
,
"outputPlayerView"
,
"outputPlayerView"
,
"
displayInputButton
"
,
"
outputVideoTextView
"
,
"debugTextView"
,
"debugTextView"
,
"informationTextView"
,
"informationTextView"
,
"progressIndicator"
,
"progressIndicator"
,
...
@@ -236,8 +240,11 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -236,8 +240,11 @@ public final class TransformerActivity extends AppCompatActivity {
}
catch
(
PackageManager
.
NameNotFoundException
e
)
{
}
catch
(
PackageManager
.
NameNotFoundException
e
)
{
throw
new
IllegalStateException
(
e
);
throw
new
IllegalStateException
(
e
);
}
}
displayInputButton
.
setVisibility
(
View
.
GONE
);
inputCardView
.
setVisibility
(
View
.
GONE
);
inputCardView
.
setVisibility
(
View
.
GONE
);
outputPlayerView
.
setVisibility
(
View
.
GONE
);
outputPlayerView
.
setVisibility
(
View
.
GONE
);
outputVideoTextView
.
setVisibility
(
View
.
GONE
);
debugTextView
.
setVisibility
(
View
.
GONE
);
informationTextView
.
setText
(
R
.
string
.
export_started
);
informationTextView
.
setText
(
R
.
string
.
export_started
);
progressViewGroup
.
setVisibility
(
View
.
VISIBLE
);
progressViewGroup
.
setVisibility
(
View
.
VISIBLE
);
Handler
mainHandler
=
new
Handler
(
getMainLooper
());
Handler
mainHandler
=
new
Handler
(
getMainLooper
());
...
@@ -281,6 +288,7 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -281,6 +288,7 @@ public final class TransformerActivity extends AppCompatActivity {
"inputImageView"
,
"inputImageView"
,
"inputPlayerView"
,
"inputPlayerView"
,
"outputPlayerView"
,
"outputPlayerView"
,
"outputVideoTextView"
,
"displayInputButton"
,
"displayInputButton"
,
"debugTextView"
,
"debugTextView"
,
"informationTextView"
,
"informationTextView"
,
...
@@ -643,8 +651,9 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -643,8 +651,9 @@ public final class TransformerActivity extends AppCompatActivity {
"inputImageView"
,
"inputImageView"
,
"inputPlayerView"
,
"inputPlayerView"
,
"outputPlayerView"
,
"outputPlayerView"
,
"
displayInputButton
"
,
"
outputVideoTextView
"
,
"debugTextView"
,
"debugTextView"
,
"displayInputButton"
,
"informationTextView"
,
"informationTextView"
,
"progressViewGroup"
,
"progressViewGroup"
,
"debugFrame"
,
"debugFrame"
,
...
@@ -658,6 +667,8 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -658,6 +667,8 @@ public final class TransformerActivity extends AppCompatActivity {
debugFrame
.
removeAllViews
();
debugFrame
.
removeAllViews
();
inputCardView
.
setVisibility
(
View
.
VISIBLE
);
inputCardView
.
setVisibility
(
View
.
VISIBLE
);
outputPlayerView
.
setVisibility
(
View
.
VISIBLE
);
outputPlayerView
.
setVisibility
(
View
.
VISIBLE
);
outputVideoTextView
.
setVisibility
(
View
.
VISIBLE
);
debugTextView
.
setVisibility
(
View
.
VISIBLE
);
displayInputButton
.
setVisibility
(
View
.
VISIBLE
);
displayInputButton
.
setVisibility
(
View
.
VISIBLE
);
playMediaItems
(
inputMediaItem
,
MediaItem
.
fromUri
(
"file://"
+
filePath
));
playMediaItems
(
inputMediaItem
,
MediaItem
.
fromUri
(
"file://"
+
filePath
));
Log
.
d
(
TAG
,
"Output file path: file://"
+
filePath
);
Log
.
d
(
TAG
,
"Output file path: file://"
+
filePath
);
...
...
demos/transformer/src/main/res/layout/transformer_activity.xml
View file @
1db1e8a9
...
@@ -114,6 +114,7 @@
...
@@ -114,6 +114,7 @@
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
<TextView
<TextView
android:id=
"@+id/output_video_text_view"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"8dp"
android:layout_margin=
"8dp"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment