这是indexloc提供的服务,不要输入任何密码
Skip to content

ForwardingPlayer removeListener() doesn't work if Player uses object sameness instead of equality #2675

@nift4

Description

@nift4

Version

Media3 main branch

More version details

bd2b1a4

Devices that reproduce the issue

Android 16 emulator

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

If a Player implements removeListeners() by using == operator, it will never be possible to remove a listener using ForwardingPlayer.

Expected result

ForwardingPlayer doing bookkeeping to be able to remove the listener

Actual result

Listener never gets removed because a new object is created:

public void removeListener(Listener listener) {
    player.removeListener(new ForwardingListener(this, listener));
  }

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