Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exo_play attribute seems not working propery #186

Closed
1 task
masah517 opened this issue Oct 15, 2022 · 6 comments
Closed
1 task

exo_play attribute seems not working propery #186

masah517 opened this issue Oct 15, 2022 · 6 comments
Assignees
Labels

Comments

@masah517
Copy link

masah517 commented Oct 15, 2022

Media3 Version

1.0.0-beta02

Devices that reproduce the issue

Pixexl6 running on Android 12

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

when overrides the default control panel by using
"app:controller_layout_id=~"
the play button and pause button seems not working properly by overriding following ids
"@id/exo_play"
"@id/exo_pause"

Expected result

The media can play and pause by overriding following layout ids

"@id/exo_play"
"@id/exo_pause"

Actual result

The media does not play and pause by overriding following layout ids

"@id/exo_play"
"@id/exo_pause"

Media

https://storage.googleapis.com/exoplayer-test-media-0/BigBuckBunny_320x180.mp4

Bug Report

@icbaker
Copy link
Collaborator

icbaker commented Oct 17, 2022

Are you asking about changing the drawable used to indicate play & pause? From the PlayerControlView javadoc:

The drawables used by PlayerControlView (with its default layout file) can be overridden by drawables with the same names defined in your application. The drawables that can be overridden are:

  • exo_styled_controls_play - The play icon.
  • exo_styled_controls_pause - The pause icon.

If you're not asking about this, please add more information so I can understand your question.

@masah517
Copy link
Author

masah517 commented Oct 18, 2022

@icbaker
Hi! Thank you for your prompt response.

Let me clarify my question as follows.

My question

Problems

  • The custom play button displayed on the player view is not functioning, and media doesn't get rendered when the play button is pressed

drawing

  • Additionally. the second problem is that the app layout attribute "show_timeout" is set as below in my sample project, but it seems the timeout duration only affects the views which get overridden, such as Progress bar. The custom view of full screen button does not hide according to the duration of show_timeout.

app:show_timeout="3000"

  • The play button and pause button are overlapped when using the custom player control panel

Media3 Version

1.0.0-beta02

Please let me know if there is any insufficiency. Thank you!

@icbaker
Copy link
Collaborator

icbaker commented Oct 18, 2022

Ah, I think this might be the issue. I'm afraid it's a bit confusing - when migrating from the exoplayer2 package to media3 we kept most of the class names the same, but we did rename a few. Specifically the PlayerView and PlayerControlView classes were renamed as follows:

exoplayer2 media3
PlayerView (deprecated) N/A (doesn't exist)
PlayerControlView LegacyPlayerControlView
StyledPlayerView PlayerView
StyledPlayerControlView PlayerControlView

So you're reading the javadoc for com.google.android.exoplayer2.ui.PlayerControlView which in media3 is called androidx.media3.ui.LegacyPlayerControlView.

I'm afraid we haven't got the media3 javadoc hosted yet, so you'll need to browse it in the source (either in your IDE or here on GitHub) - but you'll see that androidx.media3.ui.PlayerView and androidx.media3.ui.PlayerControlView don't recommend overriding the layout file, this type of customisation is not supported with these components.

@masah517
Copy link
Author

@icbaker
Noted about the name conversion of few classes. However, the "LegacyPlayerControlView" seems like having problem playing video too, which the video get progressed in black screen, even though using the default playerView control panel. (Please refer to the recording below, and my demo app if necessary)

Demo → https://github.com/masah517/Media3CustomPlayerController

device-2022-10-18-205605.mp4

Could you please give me some ideas about what I've done wrong, or what could be the better possible solution for custom playerView control panel implementation? Thank you.

@icbaker
Copy link
Collaborator

icbaker commented Oct 18, 2022

Customising the controller of androidx.media3.ui.PlayerView is not supported. androidx.media3.ui.LegacyPlayerControlView is not intended to be used with PlayerView, it's intended to be used on its own without a PlayerView.

The XML customisation of these components that is supported is documented in their javadoc. Anything else may or may not work today, but it's not supported and it may stop working in future versions of the library.

@masah517
Copy link
Author

Understood.
Will close this issue, and thanks for your time and response!

@androidx androidx locked and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants