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
4 answers

Exoplayer error in Recyclerview, Source error None of the available extractors

I am using ExoPlayer to stream videos in a RecyclerView. I am implementing the ExoPlayer inside my RecyclerView Adapter's bind method inside my ViewHolder. The video format I am using is m3u8 and the URL I am using works in a browser. So I know…
3
votes
1 answer

Disable Seekbar/Progressbar from CastPlayer Notification (ExoPlayer)

I am using the ExoPlayer Cast Extension for playing an audio stream on a connected chromecast device. The notification appears automatically when a Chromecast Session is connected. How can i remove the progress bar from the notification? Could not…
MDXDave
  • 181
  • 1
  • 13
3
votes
2 answers

Exo Player becomes black when animating the container fragment, How to fix it?

I have an Exoplayer view in a fragment, when I animate the fragment container view from the activity the exo player will become black. I used setKeepContentOnPlayerReset(true); to keep the last frame and it's working fine. But when I call the…
3
votes
0 answers

Playing ExoPlayer in foreground

I use ExoPlayer with standard PlayerNotificationManager class from library. When I close my app that playing music with swipe, Android fully kill it, music stopped, notification continues to be displayed, but buttons isn't active. Can I implement…
3
votes
1 answer

Exoplayer is removing preview with PageTransformer

I have a viewPager with CubeTransformer, which is transforming every fragment. And inside every fragment is Image or Video view (with Exoplayer). And when you are trying to change a framgnet with transformation, exoplayer losses preview (I've got a…
Strangelove
  • 761
  • 1
  • 7
  • 29
3
votes
0 answers

Is it possible to attach a foreground service to notification given by PlayerNotificationManager?

I am building a music player like Spotify and want to save the last played song when the user clears the app from the "recents list" and as onDestory() is not guaranteed to run when the app is cleared from the recent list and Background service only…
Neeraj Sewani
  • 3,952
  • 6
  • 38
  • 55
3
votes
0 answers

Getting "Cannot initialize Visualizer engine, error: -3" when trying to use Visualizer with ExoPlayer

I am using ExoPlayer to play audio from a URL. I need to use a visualizer and picked the following library to do that: https://github.com/gauravk95/audio-visualizer-android Problem is, when I use it with ExoPlayer (and not MediaPlayer), I am getting…
3
votes
1 answer

ExoPlayer: Custom AudioProcessor - Equalizer

I'm working on an ExoPlayer based media player for Android, and I'm attempting to write my own Equalizer. I've looked fairly deeply into ExoPlayer, and I believe the best place to manipulate samples in order to apply Equalier changes, is in a custom…
Tim Malseed
  • 6,003
  • 6
  • 48
  • 66
3
votes
0 answers

Exoplayer playes sound but shows no video, as well as in ads (only hearing ad and seeing buttons for 'skip' and 'learn more')

I have the following code (which works on different parts of my app but doesn't work well in a recyclerview). as it says in the title - I hear the sound of the video or the ad (even the controllers and ad buttons) but not the video itself (the video…
3
votes
1 answer

Custom TimeBar in ExoPlayer

I would like to create a custom timebar in exoplayer using PlayerView that: cannot be dragged by user but only shows the progress in the video UPDATE: Ok, so I was able to disable dragging by setting the touch_target_height to 0dp! allows the…
3
votes
1 answer

Exoplayer, play an audio stream and a video stream synchronously?

I am using the following code to play a stream (which has both a video and an audio). But what if I want a video stream and a separate audio stream for the video stream at the same time synchronously? For example, suppose there…
Damn Vegetables
  • 11,484
  • 13
  • 80
  • 135
3
votes
0 answers

Exoplayer playback error after interstitial video ad show

I am playing video with ExoPlayer and showing Google AdMob's Interstitial Video Ad. After closing ads getting issue to play video again. I am getting error as below: Playback error.com.google.android.exoplayer2.ExoPlaybackException at…
Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
3
votes
0 answers

DASH Streaming ExoPlayer android studio

I'm streaming video from URL stored in firebase storage and I'm using the following code for streaming the video using ExoPlayer BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter(); TrackSelector trackSelector = new DefaultTrackSelector(new…
3
votes
1 answer

Android Exoplayer - Different URLs for different video quality and change manually

I am using exoplayer in my application. I am using it to play video from a url. What i am trying to do is that i have three different urls for high,medium and low quality of same the video, and i would like to let the user to be able to change the…
Akhil Soman
  • 2,077
  • 2
  • 17
  • 30
3
votes
3 answers

Exoplayer doesn't show subtitle

I am building Video player android app I want to add subtitle to the video the code was run successfully and the subtitle show correctly,but when I use the custom view by adding the exoplayerView layout to my project the subtitle disappears. so…
Enaam Riyadh
  • 131
  • 3
  • 15