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

How to use custom DataSource in ExoPlayer 2?

DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter(); DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(this, Util.getUserAgent(this, "yourApplicationName"), bandwidthMeter); ExtractorsFactory extractorsFactory =…
Bincy Baby
  • 3,941
  • 5
  • 36
  • 62
7
votes
2 answers

Exoplayer(2.0.0) giving BehindLiveWindowException when playing live HLS video

I am getting this exception after some time when I am playing a live video(HLS), for recorded videos it is working fine. com.google.android.exoplayer2.source.BehindLiveWindowException at…
Ishant Sagar
  • 228
  • 5
  • 13
7
votes
1 answer

Dynamic playlists with Exoplayer 2

I'd like to use ExoPlayer2 with playlists having possibility to dinamically change the tracks (add or remove them from playlist) and change the loop settings. Since ConcatenatingMediaSource has static arrays (and not lists), I'm implementing a…
Manuela
  • 462
  • 6
  • 18
6
votes
0 answers

How to integrate Audio ad with Exoplayer like Spotify?

I want to integrate Audio ads into my podcast app with the interval of 3 podcasts. After every 3 podcasts, I need one specific ad to play which could be skippable or non-skippable. For integration, I have gone through exoplayer official docs of ad…
krupa parekh
  • 607
  • 3
  • 16
6
votes
1 answer

exoplayer 2.11.* version throws Renderer error in android 5.0/5.1(Lollipop) devices

I am using exoplayer for streaming my audio file from firebase storage to my android app. exoplayer works great in android versions which is >= 6.0. But in Android 5.0/5.1(Lollipop) devices, exoplayer throws me a Renderer error. Here's the Error i…
smackbeta
  • 91
  • 2
  • 5
6
votes
2 answers

ExoPlayer initialize player deprecated

I'm currently working with the latest ExoPlayer update and I'm getting calls that it is deprecated, could someone help me? private fun initializePlayer () { if (simpleExoPlayer == null) { val trackSelector = DefaultTrackSelector(this) …
6
votes
0 answers

How to create DASH manifest url for youtube videos?

I am creating android application. I want to play Youtube videos in the exoplayer. In the exoplayer demo app all the url's are stored in media.exolist.json like this: { "uri":…
Abhi
  • 95
  • 8
6
votes
1 answer

how to play m3u8 with exoplayer, the screen remains black

goes black trying to play m3u8 with exoplayer v2.10.5,which makes me add or how can I play m3u with exoplayer v2.10.5 and gradle 3.5.3 or which version of exoplayer would work with api 28 and gradle 3.5.3 if you can help me accommodate the code or…
6
votes
0 answers

Android: How to play Gapless audio loop in MediaPlayer?

I know this question asked multiple times in this platform but none of them are solving my issue. I was trying to play a sound file in a loop but when a loop is complete first time there is a noticeable gap. I have sound files in .M4A format. I was…
6
votes
1 answer

How does TikTok stream videos in android or how to reduce start time of video in ExoPlayer?

I'm developing an app where I want to stream video from URL. I'm currently using ExoPlayer for streaming and it is working fine but it has a delay of around 5 seconds before the video loads and starts playing. Is there any way to reduce this start…
Arjun
  • 1,477
  • 1
  • 13
  • 23
6
votes
1 answer

Play Multiple audio files through ExoPlayer or some other option?

My problem: I want to load 70 sounds in my app and then want to play multiple sound(maximum 8 sound at a time). Example app is below: https://play.google.com/store/apps/details?id=net.relaxio.sleepo I try SoundPool system in my app and it give me a…
ibad ur rahman
  • 1,381
  • 4
  • 18
  • 40
6
votes
0 answers

ExoPlayer HttpDataSource$InvalidResponseCodeException: Response code: 404

I have a playlist of 7 dash(.mpd) videos. I'm using Exoplayer version 2.8.4. Exoplayer is stuck in loading for the last two of them and I'm getting the following error in my logs. Other 5 videos plays seamlessly. What could be the reason. Thanks in…
Sumukha Aithal K
  • 675
  • 1
  • 10
  • 23
6
votes
1 answer

ExoPlayer can't play audio/video streamed (RTMP) by Adobe live stream encoder

I'm using Adobe Live Stream Encoder to stream RTMP live audio in server side. in my android client app, ExoPlayer with RTMP Extension can't play it and causes RtmpIOException but I can play it with VLC or MPC. I tested my android app with some other…
Ali.M
  • 311
  • 6
  • 24
6
votes
0 answers

ExoPlayer seekto function does not seek to the specified point but starts from 0

I'm working on ExoPlayer 2.6.0 for a Radio streaming app. Radio is playing is fine, but when i try to add seekTo for +/-30 seconds it always starts the streaming from 0. In the debug mode, player seeks to +30 seconds but as soon as…
Harry .Naeem
  • 1,245
  • 3
  • 20
  • 33
6
votes
2 answers

Set custom controller programmatically for SimpleExoPlayerView

Through XML we can easily add custom UI controller (controller_layout_id) to SimpleExoPlayerView, like this:
Zeero0
  • 2,602
  • 1
  • 21
  • 36