1. Are you ready for the Galaxy S20? Here is everything we know so far!

Android ExoPlayer takes more time on buffering

Discussion in 'Android Development' started by makil, Nov 20, 2021.

  1. makil

    makil Lurker
    Thread Starter

    I want to load URL from server. But ExoPlayer takes more time on buffering. There is no error while playing video. My code is below
    Code (Java):
    1. try {
    2.             BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
    3.             TrackSelector trackSelector = new DefaultTrackSelector(new AdaptiveTrackSelection.Factory(bandwidthMeter));
    4.             exoPlayer = ExoPlayerFactory.newSimpleInstance(this, trackSelector);;
    5.             Uri videouri = Uri.parse(file);
    6.             DefaultHttpDataSourceFactory dataSourceFactory = new DefaultHttpDataSourceFactory("exoplayer_video");
    7.             ExtractorsFactory extractorsFactory = new DefaultExtractorsFactory();
    8.             MediaSource mediaSource = new ExtractorMediaSource(videouri, dataSourceFactory, extractorsFactory, null, null);
    9.             exoPlayerView.setPlayer(exoPlayer);
    10.             exoPlayer.prepare(mediaSource);
    11.             exoPlayer.setPlayWhenReady(true);
    12.         } catch (Exception e) {
    13.             Log.e("LOGTAG", "Error : " + e.toString());
    14.         }
     



    1. Download the Forums for Android™ app!


      Download

       
  2. Dannydet

    Dannydet Extreme Android User

    What exactly are you trying to accomplish here?
     
    ocnbrze likes this.
  3. makil

    makil Lurker
    Thread Starter

    My problem. ExoPlayer is taking much time in buffering, due to this video plays so slowly after some time.
    Buffering take much time
     
  4. Dannydet

    Dannydet Extreme Android User

    Solution : stop using Exoplayer
     
Loading...
Similar Threads - Android ExoPlayer takes
  1. Olda
    Replies:
    2
    Views:
    209
  2. prince214
    Replies:
    6
    Views:
    297
  3. brentc
    Replies:
    1
    Views:
    173
  4. hex1364
    Replies:
    0
    Views:
    212
  5. parthag
    Replies:
    0
    Views:
    190
  6. Ashok Rana
    Replies:
    0
    Views:
    230
  7. Francesco99
    Replies:
    8
    Views:
    337
  8. Francesco99
    Replies:
    1
    Views:
    233
  9. Sunny Rio
    Replies:
    24
    Views:
    641
  10. ora jackson
    Replies:
    2
    Views:
    2,673

Share This Page

Loading...