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
333ccedf
authored
Aug 17, 2020
by
insun
Committed by
kim-vde
Aug 17, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Improve error message and correct reference to proper layout
PiperOrigin-RevId: 326944292
parent
49bf83a1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
9 deletions
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerView.java
library/ui/src/main/res/drawable/exo_rounded_rectangle.xml
library/ui/src/main/res/layout/exo_styled_player_control_view.xml
library/ui/src/main/res/layout/exo_styled_player_view.xml
library/ui/src/main/res/values/colors.xml
library/ui/src/main/res/values/dimens.xml
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerView.java
View file @
333ccedf
...
...
@@ -192,10 +192,10 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
* <h3>Overriding the layout file</h3>
*
* To customize the layout of StyledPlayerView throughout your app, or just for certain
* configurations, you can define {@code exo_
player_view.xml} layout files in your application
*
{@code res/layout*} directories. These layouts will override the one provided by the ExoPlayer
*
library, and will be inflated for use by StyledPlayerView. The view identifies and binds its
* children by looking for the following ids:
* configurations, you can define {@code exo_
styled_player_view.xml} layout files in your
*
application {@code res/layout*} directories. These layouts will override the one provided by the
*
ExoPlayer library, and will be inflated for use by StyledPlayerView. The view identifies and
*
binds its
children by looking for the following ids:
*
* <ul>
* <li><b>{@code exo_content_frame}</b> - A frame whose aspect ratio is resized based on the video
...
...
@@ -365,7 +365,7 @@ public class StyledPlayerView extends FrameLayout implements AdsLoader.AdViewPro
boolean
shutterColorSet
=
false
;
int
shutterColor
=
0
;
int
playerLayoutId
=
R
.
layout
.
exo_player_view
;
int
playerLayoutId
=
R
.
layout
.
exo_
styled_
player_view
;
boolean
useArtwork
=
true
;
int
defaultArtworkId
=
0
;
boolean
useController
=
true
;
...
...
library/ui/src/main/res/drawable/exo_rounded_rectangle.xml
0 → 100644
View file @
333ccedf
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2020 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"@color/exo_styled_error_message_background"
/>
<corners
android:radius=
"16dp"
/>
</shape>
library/ui/src/main/res/layout/exo_styled_player_control_view.xml
View file @
333ccedf
...
...
@@ -26,7 +26,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"center"
android:background=
"@color/exo_
widget_center_view_background
"
/>
android:background=
"@color/exo_
black_opacity_30
"
/>
<include
android:id=
"@+id/exo_embedded_transport_controls"
...
...
library/ui/src/main/res/layout/exo_styled_player_view.xml
View file @
333ccedf
...
...
@@ -13,6 +13,62 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<merge>
<include
layout=
"@layout/exo_player_view"
/>
<merge
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<com.google.android.exoplayer2.ui.AspectRatioFrameLayout
android:id=
"@id/exo_content_frame"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"center"
>
<!-- Video surface will be inserted as the first child of the content frame. -->
<View
android:id=
"@id/exo_shutter"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@android:color/black"
/>
<ImageView
android:id=
"@id/exo_artwork"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:scaleType=
"fitXY"
/>
<com.google.android.exoplayer2.ui.SubtitleView
android:id=
"@id/exo_subtitles"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<ProgressBar
android:id=
"@id/exo_buffering"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:indeterminate=
"true"
android:layout_gravity=
"center"
/>
<TextView
android:id=
"@id/exo_error_message"
android:layout_width=
"wrap_content"
android:layout_height=
"@dimen/exo_error_message_height"
android:layout_gravity=
"center"
android:layout_marginBottom=
"@dimen/exo_error_message_margin_bottom"
android:gravity=
"center"
android:textColor=
"@color/exo_white"
android:textSize=
"@dimen/exo_error_message_text_size"
android:background=
"@drawable/exo_rounded_rectangle"
android:paddingLeft=
"@dimen/exo_error_message_text_padding_horizontal"
android:paddingRight=
"@dimen/exo_error_message_text_padding_horizontal"
android:paddingTop=
"@dimen/exo_error_message_text_padding_vertical"
android:paddingBottom=
"@dimen/exo_error_message_text_padding_vertical"
/>
</com.google.android.exoplayer2.ui.AspectRatioFrameLayout>
<FrameLayout
android:id=
"@id/exo_ad_overlay"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<FrameLayout
android:id=
"@id/exo_overlay"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<View
android:id=
"@id/exo_controller_placeholder"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</merge>
library/ui/src/main/res/values/colors.xml
View file @
333ccedf
...
...
@@ -20,6 +20,7 @@
<color
name=
"exo_white"
>
#ffffff
</color>
<color
name=
"exo_white_opacity_70"
>
#B3ffffff
</color>
<color
name=
"exo_black_opacity_70"
>
#B3000000
</color>
<color
name=
"exo_widget_center_view_background"
>
#90000000
</color>
<color
name=
"exo_black_opacity_30"
>
#4D000000
</color>
<color
name=
"exo_styled_error_message_background"
>
#80808080
</color>
<color
name=
"exo_bottom_bar_background"
>
#b0000000
</color>
</resources>
library/ui/src/main/res/values/dimens.xml
View file @
333ccedf
...
...
@@ -42,4 +42,10 @@
<dimen
name=
"exo_time_view_padding"
>
10dp
</dimen>
<dimen
name=
"exo_time_view_width"
>
170sp
</dimen>
<dimen
name=
"exo_error_message_height"
>
32dp
</dimen>
<dimen
name=
"exo_error_message_margin_bottom"
>
64dp
</dimen>
<dimen
name=
"exo_error_message_text_size"
>
14sp
</dimen>
<dimen
name=
"exo_error_message_text_padding_horizontal"
>
12dp
</dimen>
<dimen
name=
"exo_error_message_text_padding_vertical"
>
4dp
</dimen>
</resources>
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