Skip to content

STATE_ENDED not sent for very short files, worked in version 1.0.2 and older #538

Closed
@faltiska

Description

@faltiska

Version

Media3 1.1.0

More version details

I use an ExoPlayer to play audio files of various lengths, some of them very short.
After updating to 1.1.0 I found that the STATE_ENDED event is no longer generated for the very short clips.
It still works fine for longer audio clips.

Events STATE_BUFFERING and STATE_READY are still generated, only ENDED is missing.

Devices that reproduce the issue

Any device.

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

No

Reproduction steps

    AudioAttributes attributes = new AudioAttributes.Builder().setContentType(AUDIO_CONTENT_TYPE_MUSIC).build();

    ExoPlayer player = new ExoPlayer.Builder(App.context)
            .setAudioAttributes(attributes, false)
            .build();
    player.setAudioSessionId(audioSessionId);
    player.setWakeMode(WAKE_MODE_NETWORK);
    player.setVolume(1f);
    player.setPlayWhenReady(true);


    player.addListener(new Player.Listener() {
        public void onPlaybackStateChanged(int state) {
            //print states or put a breakpoint here
        }
        @Override
        public void onPlayerError(@NonNull PlaybackException error) {
            //print error or put a breakpoint here
        }
    });
    player.setMediaItem(mediaItem); //use the clip I attached to the bug report
    player.prepare();

Expected result

The STATE_ENDED event should be generated.

Actual result

STATE_ENDED result never comes.

Media

very_short_audio.zip

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

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy