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
67
votes
11 answers

Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified

App crashes at runtime with the following error : java.lang.IllegalArgumentException: maa.abc: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider…
50
votes
11 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
  • 521
  • 1
  • 4
  • 4
44
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
  • 15,026
  • 20
  • 92
  • 162
24
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
  • 9,436
  • 14
  • 75
  • 148
23
votes
4 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
  • 5,734
  • 3
  • 34
  • 51
21
votes
5 answers

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:…
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…
bene25
  • 580
  • 6
  • 18
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
16
votes
4 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
  • 3,446
  • 5
  • 33
  • 46
15
votes
4 answers

SimpleExoPlayer.Builder(this).build() deprecated

I'm using Exoplayer in my app and initializing exoplayer as player = SimpleExoPlayer.Builder(this).build() But Android Studio is giving me warning as it is deprecated. When I get to the lower version of Exoplayer 2.15.1, then warning goes off. But…
Feroz Khan
  • 2,396
  • 5
  • 20
  • 37
15
votes
2 answers

Exoplayer for android, trying to stream a m3u8 file and getting error: None of the available extractors could read the stream

I am trying to stream an m3u8 file and I am getting an error. The url I am using is the following: http://storage.googleapis.com/videos.siku.org/10005/dash/master.m3u8 This streaming video does work in a browser. I am getting the following error at…
PhilBlais
  • 1,076
  • 4
  • 13
  • 36
15
votes
4 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
  • 941
  • 1
  • 9
  • 20
14
votes
1 answer

How can I fix ExoPlayer slow loading of video?

I am trying to write an app where I'll have a couple of video URLs which I need to play. I am using ExoPlayer for playing videos. ExoPlayer is playing the videos but the problem I am facing is, ExoPlayer is loading some part of video (let's say 5…
11
votes
3 answers

In flutter app Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent

Please help me to sort out the problem. I give a link to the git. https://github.com/Vasajj/radio_tysa_fm.git something is wrong with PendingIntent, with package: On android 8 all is fine Installing build\app\outputs\flutter-apk\app.apk... Debug…
Vasyl
  • 154
  • 1
  • 1
  • 9
11
votes
2 answers

Symbol ExoPlayerFactory not found

I am going insane trying to figure this out. It makes no sense at all. I have added the required implementation in my build.gradle file and synced it up just fine, but when I try to use ExoPlayer it isn't found. I have even tried manually entering…
Neglected Sanity
  • 1,770
  • 6
  • 23
  • 46
1
2 3
53 54