Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

MediaSession play/pause events not propagated to LeanbackPlayerAdapter #10420

Copy link
Copy link
@TheBeastLT

Description

@TheBeastLT
Issue body actions

ExoPlayer Version

2.18.0

Devices that reproduce the issue

Any Android TV

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

Connect player with a MediaSession and try to play/pause the video using mobile.

Expected result

When clicking play/pause the controls overlay should be triggered and their state updated.

It seems that the LeanbackPlayerAdapter listens to onPlaybackStateChanged player events, but play/pause action called from MediaSessionConnector. directly on a Player instance triggers only onPlayWhenReadyChanged event, which is not handled in the LeanbackPlayerAdapter.
By using ForwadingPlayer when setting player for the MediaSessionConnector. you can workaround this issue:

mediaSessionConnector.setPlayer(object : ForwardingPlayer(player) {
    override fun play() {
        playerAdapter.play()
    }

    override fun pause() {
        playerAdapter.pause()
    }

    override fun stop() {
        playerAdapter.pause()
    }
})

Actual result

Controls overlay is not triggered and play/pause action stays in previous incorrect state.

Media

Not applicable

Bug Report

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.