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
3
votes
0 answers

Multiple ExoPlayer Video Player in Recyclerview to play simultaneously

I have implemented Exoplayer in recyclerview. Every 3rd item in the recyclerview is the video view while others are just images. What i needed is to play the videos automatically as the videos are muted. So there are chances to show 2 players at the…
Rick Robin
  • 101
  • 1
  • 7
3
votes
1 answer

ExoPlayer notification re-appearing when player is paused and App is killed

I am facing a very strange issue while using exoplayer's PlayerNotificationManager for showing player notification. I am using following code for showing notification in foreground: class AudioPlayerService : LifecycleService() { private val…
ahsanali274
  • 471
  • 2
  • 14
3
votes
2 answers

Exo player add raise/send analytics event total time spent

I Want to add analytics events to exo player need following data total time spent on video total play time total pause time how many time paused How this can be done Tried following callbacks but not able to find exact solution to…
alphanso
  • 409
  • 5
  • 22
3
votes
1 answer

CacheDataSource vs SimpleCache in exoplayer?

I am very confused with ExoPlayer and their documentation. Can please explain me What purpose and when we should use CacheDataSource and when SimpleCache?
nirazverma
  • 1,001
  • 10
  • 15
3
votes
2 answers

Exoplayer gives errorcode 401

I am using exoplayer 2.7.3 and when i am trying to play some url i get below error: E/ExoPlayerImplInternal: Source error. com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 401 I can able to play…
vivek
  • 141
  • 3
  • 18
3
votes
1 answer

ExoPlayer not playing onViewRecycled when I back to the previous view ViewPager2

I am working with ViewPager2 with recycler view adapter and setup following things as shown below When i swipe the screen and change the index its works fine for new index but when I go to previous index it wont play any video whY? any…
3
votes
1 answer

Exoplayer how can you detect if someone clicks on the Play Button?

I know I could test with PlayerStateChanged if something is playing or not but I need the moment someone presses the play button... Does somebody know the code for this ?
Lucas Goldner
  • 617
  • 9
  • 29
3
votes
1 answer

how to play hardcoded content uri of local media file in exoplayer

Initially I choose a Intent chooser to pick up a media file, and in onActivityResult i got the uri fun openVideo(view: View) { val intent = Intent(Intent.ACTION_PICK, MediaStore.Video.Media.EXTERNAL_CONTENT_URI) intent.type =…
Vikas Acharya
  • 3,550
  • 4
  • 19
  • 52
3
votes
0 answers

DefaultTrackSelector in ExoPlayer not working ! (other way?)

I am developing a live stream and movie player application. I chose ExoPlayer 2. The movie has two different tracks include (English and Persian). In others i found these solutiones but not working for me. I want sth like a button in playing movie…
3
votes
1 answer

ExoPlayer - How to get source code for the default layout?

I'm reading this tutorial on configuring the default exoplayer view's layout: https://exoplayer.dev/ui-components.html However it doesn't display the source code for the default player layout exo_player_control_view.xml I've tried searching the…
DIRTY DAVE
  • 2,523
  • 2
  • 20
  • 83
3
votes
2 answers

How display thumbnail image in Exoplayer video?

I want to assign a preview image of the video from a URL. After pressing Play, it should disappear and show the video. I have searched for info but I have not found anything, please if anyone has any more extensive information on the subject. Thank…
Andy
  • 751
  • 1
  • 12
  • 25
3
votes
0 answers

Load Dash Manifest with DRM content with ExoPlayer

I have a dash manifest which needs to be loaded in ExoPlayer, which is also DRM protected. I can't seem to find any example as to how to achieve that other than using JWPlayer Android which did not work. executeProvisionRequest or executeKeyRequest…
Veeresh Charantimath
  • 4,641
  • 5
  • 27
  • 36
3
votes
0 answers

How do I switch to a specific track by index in Exoplayer?

I am creating a music player using Exoplayer. If the user clicks on a specific track from recyclerview I want to play all tracks but switch to clicked index. I am using ConcatenatingMediaSource to play the playlist. val concatenatedSource =…
Jeeva
  • 3,975
  • 3
  • 23
  • 47
3
votes
2 answers

Expand card view height to height of contained exoplayer, crop only left and right sides of expoplayer

I have an ex0player in a RecyclerView of CardViews. The height of the exoplayer needs to be changed programmatically based on the height of the video contained. This height value is passed returned from the API call in pixels. Here is the layout of…
andrewedgar
  • 797
  • 1
  • 12
  • 46
3
votes
2 answers

Let's Encrypt + Hitch: Android OkHttp java.security.cert.CertPathValidatorException: Response is unreliable: its validity interval is out-of-date

Hi and thank you for helping! Very infrequently on our Android application, we get errors that start as java.security.cert.CertificateException: Chain validation failed with then traces to the exception of Response is unreliable: its validity…
PradatiusD
  • 31
  • 2