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

Get uri from cached video ExoPlayer

I have a question about ExoPlayer and caching. Struggling with this for a 2 days already and searched over the internet but I can't collect all informations together in one picture, don't know is that even possible. So my question is: Can somehow…
Yupi
  • 4,402
  • 3
  • 18
  • 37
3
votes
2 answers

Play Different MediaSource Together in Exoplayer

I am stuck to playing parallel diffrent Media streams in Exoplayer Scenario: I have one Audio MediaSource. and one Video MediaSource. I want to play that both mediasource Parallelly in ExoPlayer After lots of R&D i…
Nikunj Paradva
  • 15,332
  • 5
  • 54
  • 65
3
votes
1 answer

Exoplayer offline - download consumes more data than file size

I am using Exoplayer version 2.9.6 to stream videos. Recently I added download video feature to my app using Exoplayer's in built download manager. The problem with download is that it consumes more data while downloading. For a 18 mb video (the…
Ruthwik Warrier
  • 187
  • 2
  • 14
3
votes
4 answers

how to set particular index in list of media souces in exo player?

Hi I installed ExoPlayer V2 and I have Array list of size 10(like 10 songs) but when start ExoPlayer the audio media player always start first song instated of the specified index or position(I need to start 5th song) for (ModelRadio sample :…
Para M
  • 83
  • 9
3
votes
0 answers

Pre-buffer videos before it is played in ExoPlayer

I want to buffer multiple videos before it is played. I have created a list of exoplayer instance for each video url, and passed that instances to the playerView which is in different activity. I am not getting any error but the video is not playing…
gaurav tiwari
  • 1,093
  • 1
  • 9
  • 28
3
votes
2 answers

How to reinitialize ExoPlayer after releasing?

I have ExoPlayerWrapper class which is wrapper for ExoPlayer and is singleton injected by Dagger. Init block in ExoPlayerWrapper class looks in the following way: @Singleton class ExoPlayerWrapper @Inject constructor( context: Context, …
Ksenia
  • 3,453
  • 7
  • 31
  • 63
3
votes
1 answer

Getting HLS livestream in sync across devices

We are currently using ExoPlayer for one of our applications, which is very similar to the HQ Trivia app, and we use HLS as the streaming protocol. Due to the nature of the game, we are trying to keep all the viewers of this stream to have the same…
3
votes
3 answers

how to integrate subtitle with exoplayer android

I am using Exoplayer to play different types of videos, I have download this demo and work with it https://github.com/google/ExoPlayer now I need to add subtitle for my video, I am using ExoPlayer version 2.9.5 this is the method that build the…
Amira Elsayed Ismail
  • 9,216
  • 30
  • 92
  • 175
3
votes
0 answers

ExoPlayer force quality dash

I'm trying to get a video player where I can select the quality of the video. Like Youtube: It selects 'auto' by default but with a switch you can select: 360p, 720p etc. The 'auto' parts works now using this code: ``` TrackSelection.Factory…
raiders
  • 31
  • 3
3
votes
0 answers

Black screen gets flashed when loading a new Fragment with an ExoPlayer2 to play a new video

I want to play videos that I store locally in my res-folder. I need ExoPlayer2's capability of changing the playback speed. In practice I load different kinds of Fragments into a FrameLayout. When I want to play a video I first create an ExoPlayer2…
Christian
  • 25,249
  • 40
  • 134
  • 225
3
votes
1 answer

How to create a CastPlayer from ExoPlayer Cast extension?

I already have ExoPlayer 2.7.2 running in my app. I want to add Cast functionality to it. How do I change my vanilla ExoPlayer to a CastPlayer using the ExoPlayer Cast extension?
khateeb
  • 5,265
  • 15
  • 58
  • 114
3
votes
0 answers

How to dynamically add bytes data to Exoplayer MediaSource to continue playing downloaded bytes

I was able to play audio which is saved in local file by converting it into byte array and load in ExoPlayer in Android. I wanted to know if there is any way to load streaming bytes of a large audio file into ExoPlayer as it downloads. I am…
Shashi Kiran
  • 999
  • 5
  • 13
  • 27
3
votes
3 answers

SimpleExoPlayerView customization to keep background transparent and controls always visible

I'm using ExoPlayer to play audio songs, here is how my SimpleExoPlayerView looks like:
Sophie
  • 2,594
  • 10
  • 41
  • 75
3
votes
3 answers

ExoPlayer video not cropping and fit

I use ExoPlayer library for loading videos from my server and I want to scale and crop the videos to keep their aspect ratio. The videos playing fine and everything are fine even when I change the volume of the video. I tried to use the…
Zach Bublil
  • 857
  • 10
  • 28
3
votes
3 answers

Prevent Exoplayer re-buffering for .mp4 videos

Within this project there is a 'SimpleExoPlayer' and the version of the player is 'exoplayer:r2.5.3'. After running the app 'SimpleExoPlayer' buffering the content of the video and playing smoothly. But the user set the 'SeekBar' to previous…
Nuwan Withanage
  • 393
  • 7
  • 19