Comments (11)
Closing ticket. This issue is resolved with 1.2.0
from media.
Sorry, for the confusion. When updating to version 1.2.0 our workaround was re-enabled so it appeared to be fixed but after removing the workaround we are seeing the issue in version 1.2.0 as well.
from media.
Hi @charlesEnigma,
Starting from 1.2.0, MediaSession.Callback.onMediaButtonEvent
has been added so you can override the default implementation and handle media buttons in a custom way. Could you please try this and see if it can solve your problem?
from media.
I'm re-tagging it as "bug" as we should figure out why the remote device doesn't resolve the double tap as next, because if it does, the remote device can define the behaviour of the tapping rather than the library or apps.
from media.
I think the issue is related to TV remotes that sends key events over Bluetooth. This may be a GoogleTV remote or a generic D-pad TV remote like for instance for a Sony Bravia.
The double-click detection seems to be most useful on mobile devices when a user has connected a BT headset to the device. I think it's justifiable to simply disable double-click detection on TV devices.
@charlesEnigma Any thoughts whether this would help for your case?
from media.
I will try overriding MediaSession.Callback.onMediaButtonEvent and see if we can handle the media buttons in a custom way.
@marcbaechinger,
Yes, disabling double-click detection on TV devices would help our use case. By disabling double-click detection on TV devices we would simply be preventing the users from rapidly pressing buttons correct? For example, the user presses the "play/pause" button waits at least 2 seconds, and presses the "play/pause" button again triggering the "play/pause" functionality.
from media.
By disabling double-click detection on TV devices we would simply be preventing the users from rapidly pressing buttons correct?
The library doesn't swallow events after this change. All events will be delivered but the events won't be translated to a skip next event but the events arrive at the player resulting in pausing then playing again which is what the user intended to do with pressing twice.
from media.
I'm closing this issue as it is fixed with the commit above. Please open a new issue if required.
from media.
@tianyif and @marcbaechinger ,
I was able to override KEYCODE_MEDIA_PLAY_PAUSE using [MediaSession.Callback.onMediaButtonEvent].
override fun onMediaButtonEvent(
session: MediaSession,
controllerInfo: MediaSession.ControllerInfo,
intent: Intent
): Boolean {
val keyEvent: KeyEvent? = intent.getParcelableExtra<KeyEvent>(Intent.EXTRA_KEY_EVENT)
val keyCode = keyEvent?.keyCode
when (keyCode) {
KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE -> {
if(keyEvent.action == KeyEvent.ACTION_UP) {
if (session.player.playWhenReady) {
session.player.pause()
} else {
session.player.play()
}
}
return true
}
else -> return super.onMediaButtonEvent(session, controllerInfo, intent)
}
}
Questions:
- Disable double-click detection on TV devices is this something the developer is expected to implement or will this be included in future versions of media3?
from media.
The commit referenced above implements this and this will be part of the next release.
from media.
Awesome and thank you. The team will be looking forward to the next release. :-)
from media.
Related Issues (20)
- Videos filmed vertically are rotated 90 degrees on Android 9
- Problem with skippable pre-roll ads when seeking the player to resume a playback HOT 2
- Is it possible with media3 to replace the MediaMetadataRetriever thumbnail extraction functionality? HOT 1
- last frame is black when show VAST ads HOT 13
- DecoderCounters reset before `onVideoDisabled()` is delivered. HOT 1
- Broken playback resumption HOT 1
- Workaround fix to handle 416 HOT 8
- Fire TV - Google DAI ad playback errors on CMAF streams HOT 2
- Approaches to lazily loading content and building a playlist HOT 2
- How to prevent HDR tracks from being selected when connected to a non-HDR display HOT 1
- CMCD data as query parameter is url-encoded twice HOT 1
- How to pass request headers for HttpDataSource dynamically HOT 3
- How to set a playback error with media 3 HOT 1
- Two tracks are getting downloaded by Exoplayer and IMA SDK HOT 4
- Not able to play files from local cache
- Shaders applied as GLEffects in transformer have different results than applying them directly to a GLSurfaceView HOT 9
- [media3-1.1.0] Codec, Bitrate and version info @ Playing audio/mpeg HOT 2
- Media3 ExoPlayer PlayerView UI - seekbar doesn't work (to change position) and rewind/fast forward buttons are disabled HOT 1
- Opening the app, when notification is clicked HOT 4
- Video playback is not smooth on Mi Box S HOT 5
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.