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
11
votes
1 answer

Binding PlayerView with SimpleExoPlayer from a service

I have implemented a Service to run the audio in background which runs perfectly but I am unable to get the instance of the SimpleExoPlayer from the service to the activity to update the UI and also the Audio plays twice in the background if I exit…
Akram Hussain
  • 472
  • 8
  • 23
11
votes
4 answers

ExoPlayer PlayerView OnClickListener not working

In my app, I want to handle user click on PlayerView however OnClickListener not being called and no exception is thrown. I added app:use_controller="false" to XML PlayerView. I tried to set OnTouchListener but I need MotionEvent.ACTION_UP to be…
Katy Colins
  • 533
  • 2
  • 8
  • 24
11
votes
3 answers

Quality selector for ExoPlayer 2

I am currently developing a live and movie player application. I chose ExoPlayer version 2 to play the movie and I do not know much about it. I want to let the user choose the quality of a movie on the player screen, for example, 720p or 1080p or…
Ali Soleimani
  • 301
  • 1
  • 4
  • 16
10
votes
3 answers

Exoplayer - How to prevent rebuffering when it's on Repeat mode?

I'm using exoplayer 2, and have Repeat mode on, meaning it will keep playing the video once it reaches the end. However, after the video ends and plays again, it keeps rebuffering (reloading the video). How do I prevent this from happening? player =…
DIRTY DAVE
  • 2,523
  • 2
  • 20
  • 83
10
votes
4 answers

How to implement Exoplayer 2.11.1 in android?

i am trying to implement exoplayer this is my exoplayer version implementation 'com.google.android.exoplayer:exoplayer:2.11.1' i am creating a music player app and i don't know anything about exoplayer i am trying to implement exoplayer from last 2…
10
votes
1 answer

Exoplayer playback error after interstitial ad

I am playing video with ExoPlayer and showing Google AdMob interstitial ad. After ad has been gone there was trouble to play video and show error like: Playback error.com.google.android.exoplayer2.ExoPlaybackException at…
Dinesh Shingadiya
  • 988
  • 1
  • 8
  • 23
9
votes
2 answers

Unable to catch ExoPlaybackException: Source error

No matter what I try, I am not able to catch "ExoPlaybackException: Source error" error. The video playback stops and I can see Exoplayer error thrown. The Stacktrace is below: 2021-02-09 22:36:51.917 27876-19080/com.... E/ExoPlayerImplInternal:…
Tomas Valenta
  • 171
  • 1
  • 1
  • 9
9
votes
2 answers

Unable to play MKV Matroska video with exoPlayer 2.11

In my video player when i try to play MKV Matroska file it stay still the video is not playing. i followed CodeLabs and ExoPlayer Dev and build player it can play .MP4 but unable to play .MKV here is my player:(exoplayer 2.11.5) private void…
sanoj lawrence
  • 951
  • 5
  • 29
  • 69
9
votes
1 answer

How to show downloading progress Exoplayer

I am trying to download a video for offline in exoplayer, I want to show downloading progress inside an activity. How can I bind to the DownloadService in exoplayer. so that I can update the current downloading progress in an activity? I try to…
Jeeva
  • 3,975
  • 3
  • 23
  • 47
9
votes
1 answer

Change quality of video streaming in ExoPlayer

i am creating IPTV app. In this use Exoplayer for video streaming and now requirement is change Quality of video at runtime (Auto, 720p, 1080p, HD) like Youtube. i have found 2-3 solution but i don't understand how to implement that.
Ankit Dubariya
  • 905
  • 2
  • 9
  • 22
9
votes
4 answers

Error inflating class com.google.android.exoplayer2.ui.SimpleExoPlayerView

One Strange thing: the code is working fine while using emulator, but crashes while running building an unsigned apk. when connected to android studio, it gives the following error: java.lang.RuntimeException: Unable to start activity…
Ayush Badraj
  • 111
  • 1
  • 1
  • 4
9
votes
3 answers

How to use TextureView instead of SurfaceView with PlayerView of ExoPlayer?

I know it is possible to use TextureView in ExoPlayer. But I cannot find any sample on how to implement this functionality in a proper way. Could you please help me on this issue?
Elnur Hajiyev
  • 464
  • 1
  • 4
  • 14
9
votes
3 answers

ExoPlayer2 - How to release from fragment

I have one activity with 2 fragments (not a ViewPager) & want to use ExoPlayer2 in one of the fragments to play content. The initial fragment shows a list of content & when clicked the second fragment is shown to play the selected content. However…
JC23
  • 1,248
  • 4
  • 18
  • 28
8
votes
1 answer

Exo-Player 2.10.1 says SimpleCache(File cacheDir, CacheEvictor evictor) deprecated

I am using ExoPlayer to play videos from online server. So, for better to save more internet or data for replay video I'm just caching all videos to Cache directory. But problem its saying that deprecated constructor of SimpleCache. See my…
Nick Bapu
  • 463
  • 1
  • 4
  • 14
8
votes
1 answer

how to add player control ui in google IO18 audio App demo

What am I trying to do: Using google exoPlayer to play music, foreground and background. Break into details: The app launches, google exoPlayer playback control UI should be visible and starts to play immediately. As soon as the player starts to…
Bizkit
  • 95
  • 1
  • 5
1
2
3
53 54