androidx / androidx/media

Exoplayer cannot play some videos on ChromeOS devices.

Open
#1,263 2 comments 0 reactions 1 assignee View on GitHub

@marcbaechinger is already working on this.

Since Apr 11, 2024.

wont fix: infeasible
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Version

Media3 1.3.1

More version details

No response

Devices that reproduce the issue

Google Corsola Chromebook
ChromeOS Version 123.0.6312.94 (Official Build) (64-bit)

Devices that do not reproduce the issue

Smart phones and tablets in general.

Reproducible in the demo app?

Not tested

Reproduction steps

Try to play the attached file through Exoplayer on a Chromebook.

The code used:

Uri video = Uri.parse(videoUrl);
MediaItem mediaItem = MediaItem.fromUri(video);
 player = new ExoPlayer.Builder(getContext()).build();

playerView.setPlayer(player);
player.setMediaItem(mediaItem);
player.setSeekParameters(SeekParameters.EXACT);

player.addListener(new Player.Listener() {
            @Override
            public void onIsPlayingChanged(boolean isPlaying) {
                updatePlayButtonState(true);
                scrubberView.updateProgressBar();
            }

 @Override
            public void onIsLoadingChanged(boolean isLoading) {
                scrubberView.updateProgressBar();
            }

@Override
            public void onPlaybackStateChanged(@Player.State int state) {
                if (state == Player.STATE_READY) {
                    // update positions of time stamps and maximum value of rotary scrubber
                    if (!mScrubbersReady) {
                        scrubberView.setUpScrubbers();
                        mScrubbersReady = true;
                    }
                }
                else if (state == Player.STATE_ENDED) {
                    pauseVideoPlayer();
                }
                else if (state == Player.STATE_BUFFERING) {
                    //Log.d("BUFFERING", "position: " + player.getCurrentPosition());
                }
            }

            @Override
            public void onSurfaceSizeChanged(int width, int height) {
                // ToDo: figure out what to do with the size of the draw view.
                setupView();
            }
        });

        player.setPlaybackSpeed(SettingsManager.getPlaybackSpeedFloat(getContext()));
        player.setPlayWhenReady(viewModel.getPlayWhenReady());
        player.seekTo(currentItem, playbackPosition);
        player.prepare();

        scrubberView.setPosition(playbackPosition);

Expected result

Like with Android smartphones and tablets, it should play just fine. For example using the Google Pixel Tablet, Galaxy Note 5, Pixel 4a, Pixel 7 pro, etc. all work.

Actual result

The screen remains black, the video never plays, even though it finds the video file. The duration it finds is also incorrect (saying it is 8 seconds long when the video is actually 13 seconds). There is no crash log or stacktrace.

EDIT: On some occasions it does call Exoplayer's onPlayerError. The PlaybackExceptionError reads

androidx.media3.exoplayer.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.640032, -1, null, [1080, 2340, 61.20777, ColorInfo(BT709, Limited range, SDR SMPTE 170M, false, 8bit Luma, 8bit Chroma)], [-1, -1]), format_supported=NO_EXCEEDS_CAPABILITIES

Media

https://github.com/androidx/media/assets/166638079/66b4aa73-9033-47b4-8130-5a12a4820aa6

This is just a video I had downloaded off of Youtube for testing purposes. There's other videos that end up having the same issue.

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.