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

Android Exoplayer 2 UDP Decoding issue

I'm new on ExoPlayer , i'm currently heading to use it to play Native Udp Stream ( From french digital Television : 1080p 5-10 mbps in Variable bitrate ) I manage to play some udp stream with some tests videos from http://jell.yfish.us/ on…
4
votes
3 answers

Android - ExoPlayer 2 play DRM (widevine) offline

I'm trying to implement offline DRM support for ExoPlayer 2 but I have some problems. I found this conversation. There is some implementation for ExoPlayer 1.x and some steps how to work that implementation with ExoPlayer 2.x. I have I problem with…
Pepa Zapletal
  • 2,879
  • 3
  • 39
  • 69
3
votes
0 answers

ExoPlayer HLS stream AD insertion

I have HLS stream. When I trying insert VAST tag into stream : exoplayer not show AD with any errors and warnings in logcat exoplayer throwing exception, and after re-init with HlsMediaSource.Factory(..) works well How i build ExoPlayer…
3
votes
1 answer

Exoplayer with preroll and dynamic ad insertion

I want to make work my DASH stream with preroll and DAI. For now, I was able to make: DASH + preroll working and DASH + dai. But all three not dash + dai : val dashMediaSource = DashMediaSource.Factory(dashChunkSourceFactory,…
BejanCorneliu
  • 65
  • 3
  • 13
3
votes
1 answer

In ExoPlayer how do I show the thumbnail of the first frame after loading a media source and seeking to a position instead of it being blank?

How do I show the first frame of the video after the Fragment is resumed instead of the video player being blank?
Eric
  • 2,573
  • 1
  • 23
  • 19
3
votes
0 answers

Starting up the media2 MediaSessionService causing some random crashes (using MediaController and ExoPlayer)

I've got some strange crashes on Firebase (and I was unable to reproduce them), that occur at the launch of my MediaSessionService : Fatal Exception: android.app.ForegroundServiceDidNotStartInTimeException Context.startForegroundService() did not…
3
votes
1 answer

Android Kotlin - How to use ExoPlayer SimpleCache as of today

So far I found only deprecated stuff: val evictor = LeastRecentlyUsedCacheEvictor((100 * 1024 * 1024).toLong()) val databaseProvider: DatabaseProvider = ExoDatabaseProvider(context) val simpleCache = SimpleCache(File(context.cacheDir, "media"),…
user17027702
3
votes
0 answers

How to fix 2160p mkv video not running in Exoplayer

In my video player when i try to play 2160p MKV 4k video file in exoplayer. The video is not playing. Error message is ERROR_CODE_DECODING_FAILED Error code is 4003. Exoplayer version is 2.16.1 Same video file is playing using android video library…
Manchu
  • 31
  • 1
3
votes
1 answer

How to stop a video when the page is not visible in ViewPager2

I have a app where I make a API call and get a arraylist of videos, which I play in a viewpager using a adapter. When I scroll the viewpager, the video playing before still keeps playing and even after I scroll again. I want it so that the video…
3
votes
1 answer

How to extends PlayerNotificationManager with Builder to override for compact view controls Exo player 2.14

I am looking for a way to extends/inherit PlayerNotificationManager.Builder with new Builder approach in ExoPlayer version 2.14. since earlier methods to subclass, it is deprecated now. Problem Area - private class…
Ravi
  • 2,277
  • 3
  • 22
  • 37
3
votes
0 answers

ExoPlayer in RecyclerView still playing video that shouldn't be playing

I'm working on implementing ExoPlayer in a RecyclerView. I want to only use one instance of ExoPlayer for performance reasons. Right now, it only plays the first fully visible recyclerview item on screen, and I have that implemented. However, my…
user1695123
  • 103
  • 1
  • 14
3
votes
2 answers

A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 9500 (com.schonell), pid 9500

I'm getting this exact crash/error message from logcat for my Android app. A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 9500 (com.schonell), pid 9500 No more crash log details only this message showing. This…
Swapon
  • 409
  • 6
  • 16
3
votes
2 answers

Exoplayer notification not clearing

I have exoplayer integrated within my application based on this link. I have added a pending intent inside createCurrentContentIntent(). return PendingIntent.getActivity( context, 0, Intent(context, MyActivity::class.java), 0 …
Anju
  • 9,379
  • 14
  • 55
  • 94
3
votes
1 answer

Exoplayer2 change HLS http headers

I am trying to change the http headers sent when using HLS. This is what my current code looks like: private MediaSource buildMediaStore(String streamUrl) { Uri streamUri = Uri.parse(streamUrl); HttpDataSource.Factory dataSourceFactory =…
Slendi
  • 157
  • 1
  • 13
3
votes
1 answer

How to show VTT subtitles in ExoPlayer2?

How can I set and show subtitles from url with ExoPlayer2 in Android? Currently, I write in Kotlin, I'm using following code for setting up ExoPlayer with subtitles: exoPlayer = SimpleExoPlayer.Builder(this).build() val subtitle =…
grgg7
  • 91
  • 2
  • 10