Comments (1)
Thanks for your question.
That sounds not right to me actually. The intention of the library is to eventually route all these commands to the player.
So I don't think you need/should override onMediaButtonEvent
. Instead, the default implementation will dispatch the key event to Player.seekToNext
or Player.seekToPrevious
respectively. The forwarding player isn't bypassed and that's where you should await commands for interception.
There is a test case that asserts this behaviour for KeyEvent.KEYCODE_MEDIA_NEXT
and KeyEvent.KEYCODE_MEDIA_PREVIOUS
.
If everything works as intended (and the unit test above suggests this works), then you just have to override ForwardingPlayer.seekToNext()
and ForwardingPlayer.seekToPrevious()
where all the commands arrive and you can act accordingly.
from media.
Related Issues (20)
- Support working bandwidth estimator in blocking media segment of LL-HLS
- How do I detect if media item transition has been triggered from next or previous seek? HOT 2
- IMA DAI SDK indicates AD_BREAK_ENDED before ad playback completes HOT 4
- Black screen displayed for DRM content HOT 2
- Allow changing SNTP client timeout HOT 2
- Player gets stuck in the "loading" state after seekToNext/Prev MediaItem HOT 7
- PlayerControlView will show as minimal mode when height is set to wrap_content HOT 2
- How to play downloaded content with a player in a MediaSession(Service)? HOT 2
- Is there support of sleep timer? HOT 2
- player.addMediaItems or player.setMediaItems takes too much time HOT 3
- "onSurfaceTextureSizeChanged" will not called with new size when use Video Effects.
- NetworkTypeObserver makes binding calls on mainthread by default HOT 2
- Getting the decoded from ExoPlayer in advance HOT 2
- Playing a song using MediaSessionService randomly turns on and off bluetooth for some reason on Android 11. HOT 2
- Render subtitles (Cue objects) via an Effect HOT 2
- Current application thread check for player.createMessage
- Creating a perpetually loading MediaItem
- HttpMediaDrmCallback setKeyRequestProperty PSSH name for header request
- Media resumption results in DeadObjectException
- Libflac decoder crash: flac_jni.cc (NewStringUTF)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from media.