I want the EventListener method that works with this player = new SimpleExoPlayer.Builder(this).build();

20 Views Asked by At

I used this but the app freezes.

player.addListener(new Player.Listener() {

        @Override

        public void onPlaybackStateChanged(int playbackState) {

            switch (playbackState) {

                case Player.STATE_IDLE:

                    prg.setVisibility(View.GONE);

                    break;

                case Player.STATE_BUFFERING:

                    prg.setVisibility(View.VISIBLE);

                    break;

                case Player.STATE_READY:

                    prg.setVisibility(View.GONE);

                    break;

                case Player.STATE_ENDED:

                    prg.setVisibility(View.GONE);

                    break;

            }

        }

    });

Because I use this. player = new SimpleExoPlayer.Builder(this).build();

0

There are 0 best solutions below