google / google/ExoPlayer

Cast Extension: Errors after loadItems() when isCastSessionAvailable() is true

Open
#4,063 1 comment 0 reactions 1 assignee Claimed by @AquilesCanta View on GitHub
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Cast player doesn't work correct when I load create it and load items when I was connected to Chromecast before:
- When I try to set another with seekTo(window, msec) item from playlist I get: java.lang.ArrayIndexOutOfBoundsException: length=0; index=1
- When I disconnect I get wrong currentPosition
- getDuration() = -9223372036854775807

How to reporoduce:
1. Add some button to demo app
2. Move making PlayerManager.createPlayerManager to call when button is clicked
3. Connect to Cromecast by MediaRouteButton
4. Tap button to create PlayerManager
5. Change track or disconnect stop casting

I can send you the code. Is that approach wrong?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.