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

After upgrading ExoPlayer from 2.11.8 to 2.12.1 and replacing deprecated components I can't play any video

I've recently upgraded com.google.android.exoplayer:exoplayer-core from version 2.11.8 to version 2.12.1. Some components are deprecated by version 2.12.1 in the following code snippet. cacheEvictor =…
2
votes
0 answers

Is there's any way to save the modified audio to storage device using ExoPlayer

After changing the speed and pitch of a local audio, I would like to save it into the storage device, I change the audio parameters using the code below : public void setSpeed(float speed) { PlaybackParameters param = new…
2
votes
1 answer

Attempt to invoke virtual method on Playerview.setplayer on a null object reference

I am getting a null pointer exception where there shouldnt be one. Here is the error readout java.lang.NullPointerException: Attempt to invoke virtual method 'void…
rial
  • 705
  • 7
  • 17
2
votes
1 answer

Exoplayer - Change the size of exo_playback_control_view controller at runtime programmatically

I've overwritten the XML layout of exo_playback_control_view to a custom one that I have. Right now I am using the PlayerView
DIRTY DAVE
  • 2,523
  • 2
  • 20
  • 83
2
votes
1 answer

What is LeastRecentlyUsedCacheEvictor in ExoPlayer?

I am very confused with exoplayer and their documentation, They have explained everything in very short. Can anyone please tell me what exactly leastRecentlyUsedCacheEvictor is and how it work? use case and methods?
nirazverma
  • 1,001
  • 10
  • 15
2
votes
1 answer

how to pass load control in exoplayer 2.11.8 version

I am using exoplayer 2.11.8 version. In this version, they have changed the lot of methods. By Searching their docs, I build the Exoplayer. Here's the Code: DataSource.Factory dataSourceFactory = new…
2
votes
1 answer

E/ExoPlayerImplInternal: Source error, when playing a .MP4 file from the local storage

I am downloading a MP4 file from an URL and storing it locally, then when I play the Video using exoplayer, it works fine. But when I use seekbar to move back and forth, it throws the exception(It does work for some videos though) 2020-08-19…
Rahul H
  • 41
  • 2
  • 5
2
votes
2 answers

why ExoPlayer doesn't work on old devices with android API lower than 23?

it took quite a few days to realize that something wrong is going on with old devices with API lower than 23 and I searched intensively but without an answer. So when I found my answer I thought that it's worth sharing with the community
Amine Dev
  • 53
  • 7
2
votes
0 answers

How to pause ExoPlayer playerView when RecyclerView.SCROLL_STATE_DRAGGING and release player on Destroy

I want to implement a RecyclerView that works similar to Instagram feeds, that contains both Image and Video Items. I have successful implemented the recyclerView to display both image and video items, but I am having issues with pausing the video…
steveOS
  • 125
  • 1
  • 12
2
votes
1 answer

how to implement audio visualizer to exoplayer

I am working on a radio app . I used exoplayer as player on my project and I want to add audio visualizer on my playeractivity . but I couldn't find any tutorial or sample for it . I just made a customeRenderfactory and add it to my player . But I…
shayegan
  • 71
  • 7
2
votes
0 answers

ViewPager2 - Fragment change in PIP mode

I have to develop an app that has a list of videos and also support PIP mode. I have used ViewPager2 with vertical orientation and ExoPlayer. FragmentStateAdapter is use for ViewPager2 adapter Problems. When screens enter PIP mode fragment…
mukesh
  • 4,140
  • 5
  • 29
  • 40
2
votes
1 answer

Android + exoplayer: play AES encrypted videos, locally

On a linux box, I have an MP4 video that is encrypted with openssl: openssl enc -aes-128-ecb -a -in video.mp4 -out video.enc -K `cat aes.key` Please note, this is an exercise, the strength of the algo doesn't matter. That file is sent to an Android…
mbmc
  • 5,024
  • 5
  • 25
  • 53
2
votes
3 answers

stop and release exoplayer from viewpager 2

I am using Exoplayer with ViewPager2. Home Fragment.java public class HomeFragment extends Fragment { View view; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle…
ADL
  • 71
  • 2
  • 3
2
votes
1 answer

Listen for onDownloadComplete Exoplayer

I am trying to download a video for offline playing in exoplayer, but I don't know how to listen for onDownloadComplete. In the exoplayer docs they say DownloadService is a wrap around android DownloadManager so I try to listen for…
Jeeva
  • 1,029
  • 3
  • 15
  • 21
2
votes
0 answers

How to set maximum height and minimum height for quality tracks in exoplayer

In my project i want to set minimum height and maximum height for a video track. Simply means if we select that track the video should play in between these maximum and minimum quality like the AUTO mode. Now we can set maximum video size but i…
newbie
  • 31
  • 4