Set Default height when AspectRatioFrameLayout couldn't load
See original GitHub issue[REQUIRED] Searched documentation and issues
ExoPlayer Doc, github issues and stackOverFlow
[REQUIRED] Question
I want to show controller on player in portrait orientation like youtube. My AspectRatioFrameLayout placed in center of page and it didn’t have specific height. When there is no network to play video or it needs to be recalculate again , … the controller will shown as full screen.I want to know is there a way to set default height for AspectRatioFrameLayout or any other way to don’t show controller full page when AspectRatioFrameLayout couldn’t be calculate?
Exo version:2.10.0 Youtube player screenShot My layout when error occur and controller shown full page
XML code :
<androidx.coordinatorlayout.widget.CoordinatorLayout
…>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true">
<com.google.android.exoplayer2.ui.AspectRatioFrameLayout
android:id="@id/exo_content_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
…
<View
android:id="@id/exo_controller_placeholder"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.google.android.exoplayer2.ui.AspectRatioFrameLayout>
</FrameLayout>
…
</FrameLayout>
<include layout="@layout/bottom_sheet_layout” />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
In Android, using exoplayer, how to fill surfaceview with a ...
Explanation: AspectRatioFrameLayout is setting the correct height of the view according to the real video ratio (calcuclating based on width, height and ...
Read more >Setting Height And Width On Images Is Important Again
To prevent layout shifts and improve performance scores, we need to always set width and height attributes on our images.
Read more >AspectRatioFrameLayout (ExoPlayer library)
Sets the aspect ratio that this view should satisfy. Parameters: widthHeightRatio - The width to height ratio. setAspectRatioListener. public void ...
Read more >Exoplayer - How To Get Source Code For The Default Layout?
ExoPlayer Doc github issues and stackOverFlow want to know is there a way to set default height for AspectRatioFrameLayout or any other.
Read more >Apply width and height attributes to allow responsive image ...
Why is Drupal core is not setting these attributes for lazy image loading which basically disable lazy loading for all responsive images? The ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing due to inactivity. Please feel free to re-open if required.
As a first try I’d use the
PlayerView
and customize its layout file. You can provide your ownexo_player_view.xml
and add your own elements within that.In case you want to continue with your approach, it seems that you need to calculate the dimensions yourself and set it programmatically.