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.

634 questions
40
votes
3 answers

How to pause ExoPlayer 2 playback and resume (PlayerControl was removed)

In ExoPlayer < 2.x there was a class PlayerControl with pause() and resume() functions but it was removed. I can't find a way to do this on ExoPlayer 2. How can I pause and resume a playback?
Daniel Gomez Rico
  • 12,814
  • 14
  • 81
  • 140
28
votes
9 answers

How to hide control buttons in ExoPlayer2

How to hide all controllers in ExoPlayer2 (start button, pause, and so on) that they did not exist, and the screen was always full. I looked, there is simpleExoPlayerView.setUseController(true) method; But it deactivate the player ... public void…
Nurlan Kanimetov
  • 301
  • 1
  • 3
  • 4
23
votes
3 answers

ExoPlayer: Place controller under the video without overlapping the video

I have a PlayerView that takes up the top half of the Activity in portrait orientation with the bottom half of the screen showing some text. I need to have the controller under the video without overlapping the video content (it will always be…
Sasha Shpota
  • 7,441
  • 6
  • 49
  • 100
21
votes
2 answers

ExoPlayer HlsMediaSource() deprecated

The HlsMediaSource() method is deprecated (I'm currently on exoplayer:2.6.1). What is the recommended method to use for HLS-media instead?
Algar
  • 4,828
  • 1
  • 26
  • 47
20
votes
1 answer

Detect if HDMI service is UP on android TV

We have a problem with HDMI service. Our Android TV app are set as default on STB. When you launch STB it doesnt show you launcher, it shows you out App immediately with playing HLS video stream. For playing video we are using Exo Player version…
Aleksandr A
  • 485
  • 5
  • 15
18
votes
1 answer

Refresh Media source in exoplayer

I am using Exo Player ExtractorMediaSource for playing video in my android app. I am downloading media from server and save in local database and on a specific time Alarm i play this media using ConcatenatingMediaSource in exo player. but first i…
Ghanshyam Sharma
  • 451
  • 9
  • 21
18
votes
1 answer

ExoPlayer2 - How can I make a HTTP 301 redirect work?

I started using ExoPlayer to stream some audio. All was well until I came across an URL that has a "301 Moved Permanently" redirect. ExoPlayer2 does not handle that by default. I've already seen this thread:…
12
votes
3 answers

How to catch all errors for ExoPlayer?

I implemented ExoPlayer as player for my application. But I can´t find out how to catch all ExoPlayer errors to avoid app crash. I added following listener, but it doesn´t catch all errors. I have to use DRM and it sometimes crash on some problem…
Michalsx
  • 2,515
  • 3
  • 23
  • 39
10
votes
1 answer

Exoplayer playback error after interstitial ad

I am playing video with ExoPlayer and showing Google AdMob interstitial ad. After ad has been gone there was trouble to play video and show error like: Playback error.com.google.android.exoplayer2.ExoPlaybackException at…
Dinesh Shingadiya
  • 966
  • 1
  • 6
  • 23
9
votes
2 answers

Unable to play MKV Matroska video with exoPlayer 2.11

In my video player when i try to play MKV Matroska file it stay still the video is not playing. i followed CodeLabs and ExoPlayer Dev and build player it can play .MP4 but unable to play .MKV here is my player:(exoplayer 2.11.5) private void…
sanoj lawrence
  • 1,085
  • 4
  • 24
  • 55
9
votes
2 answers

Decoder init failed: OMX.qcom.video.decoder.avc,

When I open video More then 2 time it will give error when i open video less then 2 time it will work properly i can not find any solution so if you have any solution please help me out com.google.android.exoplayer2.ExoPlaybackException:…
Jaspalsinh Gohil
  • 594
  • 6
  • 16
9
votes
1 answer

Binding PlayerView with SimpleExoPlayer from a service

I have implemented a Service to run the audio in background which runs perfectly but I am unable to get the instance of the SimpleExoPlayer from the service to the activity to update the UI and also the Audio plays twice in the background if I exit…
Akram Hussain
  • 331
  • 5
  • 18
9
votes
3 answers

ExoPlayer PlayerView OnClickListener not working

In my app, I want to handle user click on PlayerView however OnClickListener not being called and no exception is thrown. I added app:use_controller="false" to XML PlayerView. I tried to set OnTouchListener but I need MotionEvent.ACTION_UP to be…
Katy Colins
  • 433
  • 1
  • 5
  • 18
8
votes
2 answers

How to implement Exoplayer 2.11.1 in android?

i am trying to implement exoplayer this is my exoplayer version implementation 'com.google.android.exoplayer:exoplayer:2.11.1' i am creating a music player app and i don't know anything about exoplayer i am trying to implement exoplayer from last 2…
8
votes
1 answer

Change quality of video streaming in ExoPlayer

i am creating IPTV app. In this use Exoplayer for video streaming and now requirement is change Quality of video at runtime (Auto, 720p, 1080p, HD) like Youtube. i have found 2-3 solution but i don't understand how to implement that.
1
2 3
42 43