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

OnPlayerErrorChanged never cleared with MediaController #449

@StaehliJ

Description

@StaehliJ

Why when adding a Player.Listener to a MediaController or MediaBrowser the onPlayerErrorChanged has not the same behavior as if it was added on a Exoplayer instance ?

Behavior of Exoplayer:

  • Play a item that throw an error
  • onPlayerErrorChanged(newError)
  • Play other item that doesn't throw an error
  • onPlayerErrorChanged(null)

Behavior of MediaController / MediaBrowser:

  • Play a item that throw an error
  • onPlayerErrorChanged(newError)
  • Play other item that doesn't throw an error
  • Expect a onPlayerErrorChanged(null) but the callback is never called!

Tested on release : 1.0.0, 1.0.2, 1.1.0-beta01

Test / reproduce the issue

To test the behavior you just have to modify and run the demo-session with this modifications

add in assets/catalog.json

 {
      "id": "video_04",
      "title": "Video with error",
      "album": "Mango Open Movie project",
      "artist": "Blender Foundation",
      "genre": "Video",
      "source": "https://storage.googleapis.com/wvmedia/clear/h264/tears/unknow.mpd",
      "image": "https://storage.googleapis.com/wvmedia/clear/h264/tears/unknow.mpd"
    },

And add onPlayerErrorChanged callback from the Player.Listener in PlayerActivity.kt

override fun onPlayerErrorChanged(error: PlaybackException?) {
    Log.i("MyTag", "error = $error")
    val errorMessage = error?.message
    playerView.setCustomErrorMessage(errorMessage)
}

The custom message is never clear and it will be showed after playing another media item that play correctly.
image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions