2

I recently updated my application from the old CastCompanionLibrary to Chromecast SDK3 and although play and seek work normally, I can't resume playback after pause. I am logging the error as follows

player.play().setResultCallback(new ResultCallbacks<RemoteMediaClient.MediaChannelResult>() {
                    @Override
                    public void onSuccess(@NonNull RemoteMediaClient.MediaChannelResult mediaChannelResult) {
                        Log.d("cast", "SUCCESS");
                    }

                    @Override
                    public void onFailure(@NonNull Status status) {
                        Log.d("cast", "FAILURE "+status.getStatusMessage());
                    }
                });

The failure reason is always 2100 FAILED, the in progress request failed. I also updated the receiver application to use the default Styled Media Receiver but it doesn't seem to make any difference.

SOLUTION

The problem was that I was calling

remoteClient.load(myMediaInfo, true, position);
remoteClient.play();

It turns out that if you load the MediaInfo with autoplay=true, you are not allowed to directly call play(). If you do, the video starts playing and can be paused and seeked but can never be resumed. Play always fails with the error above. I think the framework could handle this a bit better or at least give a decent error message, which can lead to some kind of conclusion, which is not the case with 2100 FAILED.

Katerina A.
  • 1,268
  • 10
  • 24
  • What sort of media is this? For example, is it live stream? And also, what do you see on the receiver logs? – Ali Naddaf Jan 26 '17 at 07:11
  • @AliNaddaf thank you but I found the problem (see above). It was a normal HLS stream and receiver logs didn't show anything abnormal. – Katerina A. Jan 26 '17 at 16:23

0 Answers0