Questions tagged [exoplayer2.x]

ExoPlayer 2.x is a major iteration of the ExoPlayer (an open source, application level media player built on top of Android’s low level media APIs) library with significant API and architectural improvements.

ExoPlayer 2.x includes significant architectural improvements of ExoPlayer and new features.

Key architectural changes:

  • Late binding between rendering and media source components. Allows the same rendering components to be re-used from one playback to another. Enables features such as gapless playback through playlists and DASH multi-period support.

  • Improved track selection design. More details can be found here.

  • LoadControl now used to control buffering and loading across all playback types.

  • Media source components given additional structure. A new MediaSource class has been introduced. MediaSources expose Timelines that describe the media they expose, and can consist of multiple MediaPeriods. This enables features such as seeking in live playbacks and DASH multi-period support.

  • Responsibility for loading the initial DASH/SmoothStreaming/HLS manifest is promoted to the corresponding MediaSource components and is no longer the application's responsibility.

  • Higher level abstractions such as SimpleExoPlayer have been added to the library. These make the library easier to use for common use cases. The demo app is halved in size as a result, whilst at the same time gaining more functionality. Read more here.

  • Enhanced library support for implementing audio extensions.

  • Format and MediaFormat are replaced by a single Format class.

Key new features:

  • Playlist support. Includes support for gapless playback between playlist items and consistent application of LoadControl and TrackSelector policies when transitioning between items.

  • Seeking in live playbacks for DASH and SmoothStreaming.

  • DASH multi-period support.

  • MediaSource composition allows MediaSources to be concatenated into a playlist, merged and looped.

  • Looping support.

  • Ability to query information about all tracks in a piece of media (including those not supported by the device).

  • Improved player controls.

  • Support for PSSH in fMP4 moof atoms.

  • Support for Opus in Ogg.

  • CacheDataSource support for standalone media file playbacks (mp3, mp4 etc).

  • FFMPEG extension (for audio only).

In case of building a new media app, recommend building it on ExoPlayer 2.X. For those who are using ExoPlayer 1.X, you can include both 1.X and 2.X in your app (due to a different package name), allowing you to test and migrate your users with minimal impact.

800 questions
8
votes
1 answer

Is it possible to change resolution of exoplayer manually?

I'm working on a project that use Exoplayer2 for HLS video streaming. Adaptive streaming is working well in my exoplayer, but i want to implement a feature that user can change the resolution (144p,240p,480p..)of the video manually from UI. I got…
Sarath Sasi
  • 93
  • 1
  • 1
  • 6
7
votes
3 answers

Sometime video buffering very slowly in exoplayer?

I don't know why, but sometimes Exoplayer buffers my video very slowly. My server is responding properly and the internet is also fast but sometimes Exoplayer buffers my video slowly for less than 1 second. And it buffering always after every 1-2…
M DEV
  • 763
  • 1
  • 7
  • 20
7
votes
1 answer

Video flashes black just before playing (ExoPlayer)

I'm using ExoPlayer in a RecyclerView. The way I have it working now is: Using only one ExoPlayer instance When the RecyclerView item comes into view, it prepares the player and attaches the PlayerView to the layout When the RecyclerView item goes…
7
votes
0 answers

Android ExoPlayer What Does "prepare()" Exactly Do?

The only difference I notice is that, if I call prepare() before play(), I will see the the process indicator and it pre-loads data in the PlayerView, besides that I can't tell the difference if I just call play() without prepare(). Also the…
Sam Chen
  • 7,597
  • 2
  • 40
  • 73
7
votes
0 answers

How to prevent Error inflating class com.google.android.exoplayer2.ui.PlayerView?

Exoplayer2 is working fine in devices like Samsung, Vivo, Xiaomi, etc on both release and debug build. But when I have released my app on the play store, it is throwing errors on some devices like nexus, pixel phones. Crashlytics showing this error:…
7
votes
0 answers

seekTo restarting playback on exoplayer

While trying to call seekTo function of exoplayer instance the playback is getting reset and playing from start after buffering live audio stream. As some blogs and gists suggest tried calling seekto after pausing exoplayer and then starting the…
MDT
  • 1,535
  • 3
  • 16
  • 29
7
votes
2 answers

Exoplayer cannot catch error - Input does not start with the #EXTM3U header

Like the title above, I can't catch the error Input does not start with the #EXTM3U header. I tried to catch the error in this way: exoPlayer.addListener(new ExoPlayer.EventListener() { @Override public void…
Espada
  • 173
  • 1
  • 10
7
votes
1 answer

Prevent re-buffering on changing max bit rate in ExoPlayer

I am using setMaxBitrate provided by DefaultTrackSelector to set max bit rate when user changes video quality. val parameters = defaultTrackSelector.buildUponParameters() .setMaxVideoBitrate(bitrate) …
Abhishek V
  • 12,488
  • 6
  • 51
  • 63
7
votes
2 answers

Is there an ExoPlayer + Leanback library example for using captions?

I have found a few examples that work with Leanback and ExoPlayer and I have all that working but I can't get subtitles/captions to work. The newest Google example I could find (https://github.com/android/tv-samples) has a captions button on the…
casolorz
  • 8,486
  • 19
  • 93
  • 200
7
votes
1 answer

Exoplayer: Loop creates OutOfMemoryError when playing video from local file

When I try to play a video from a local file (I assume it's .mp4) in the ExoPlayer 2.10.6, I get a OutOfMemoryError. I download the video from a firebase DB and then load it with Exoplayer. The fragment with the Exoplayer exists twice, but I release…
murkr
  • 634
  • 5
  • 27
7
votes
0 answers

UnrecognizedInputFormatException: None of the available extractors could read the stream

I have a default .mp4 file that I want to view using ExoPlayer (on Android). I use this small video: http://techslides.com/demos/sample-videos/small.mp4 In the App I get a base64 string that is the video. When I paste in the above video in this…
Jim Clermonts
  • 1,694
  • 8
  • 39
  • 94
7
votes
1 answer

Why can't I locate ProgressiveMediaSource?

Looking at the ExoPlayer documentation, the "Hello World" example suggests that to play a standard video you should use a ProgressiveMediaSource (compared to many online tutorials I've seen suggesting you use an ExtractorMediaSource) Looking at the…
stevendesu
  • 15,753
  • 22
  • 105
  • 182
7
votes
0 answers

android.media.MediaCodec$CodecException: Failed to initialize OMX.qcom.video.decoder.avc, error 0xfffffff4

On Device Lenovo K33a42, Getting below given error, screen is black and not playing the video com.google.android.exoplayer2.ExoPlaybackException: com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder…
Amrit Chakradhari
  • 270
  • 1
  • 4
  • 15
7
votes
2 answers

Can I send exoplayer buffered data to other activity exoplayer

I have a exoplayer my first activity and when I click full screen button, I open a new VideoActivity full screen. I just only send my current position and start VideoActivity that position. TrackSelector trackSelector = new…
6155031
  • 4,171
  • 6
  • 27
  • 56
7
votes
1 answer

Increasing brightness of ExoPlayer 2 just like MxPlayer

I went through the entire documentation of ExoPlayer2, but couldn't find how to increase the brightness of exoplayer. I found a similar question on github My xml is as follows
BraveEvidence
  • 53
  • 11
  • 45
  • 119
1 2
3
53 54