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

Why do Jetpack-media3/exoplayer controls dim the video?

I am using exoplayer2 via androidx.media3:media3-exoplayer:1.0.0-beta03. I have a androidx.media3.ui.PlayerView in my XML layout, and then in my code I am creating an Exoplayer with ExoPlayer.Builder and assigning it to playerView.setPlayer. When…
mcc
  • 131
  • 1
  • 5
5
votes
1 answer

Targeting S+ (version 33 ) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified

App crashes at runtime with the following error : Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if…
5
votes
2 answers

Keep Aspect Ratio Exoplayer without using com.google.android.exoplayer2.ui.PlayerView

I am currently working on an OpenGL demo project of exoplayer version "2.12.1". https://github.com/google/ExoPlayer/tree/r2.12.1/demos/gl MainActivity.java /* * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache…
Lins Louis
  • 2,393
  • 2
  • 25
  • 30
5
votes
5 answers

How to fix this PlayerNotificationManager.createWithNotificationChannel error

I am developing a music app but i am getting error can anybody tell me how to fix this PlayerNotificationManager.createWithNotificationChannel? .createWithNotificationChannel is not recognizable class MusicNotificationManager( private val…
5
votes
0 answers

ExoPlayer play multiple videos simultaneously

I am building a video player android application where I need to play 2(maybe 4) live streams at the same time in the same view. Is it possible using a single exoplayer instance? If yes, please suggest how, also how to handle audio as I only need…
Ravi Rawal
  • 233
  • 3
  • 14
5
votes
1 answer

How to set custom layout and font in Exoplayer notification?

I'm using PlayerNotificationManager for displaying playback notifications in my application. Everything is working fine but I want to add my application's logo in the notification with custom fonts. I changed the play & pause buttons on the…
5
votes
1 answer

Exoplayer seekbar preview

I'm trying to add a preview to my seekbar on my exoplayer just like in youtube or plex (see the image below) I've found this library but it isn't up-to-date yet. I already have the image per frame but I don't know how to integrate them in my…
Biscuit
  • 4,840
  • 4
  • 26
  • 54
5
votes
1 answer

exoplayer not playing add and got crash

Today i upgraded exoplayer from 2.9.5 to 2.10.4 every thing is working fine in old version but in new version they added AdsLoader.AdViewProvider and i don't know how to implement it. I try my best but the issue does not resolved. I want to play ads…
virgo
  • 61
  • 1
  • 6
5
votes
3 answers

Dumb Question: What's the difference between PlayerView and SimpleExoPlayerView?

I'm writing a library around ExoPlayer (creating a simple View that can be dragged and dropped into an app and will play videos and advertisements per our company's business logic). As I'm looking to tweak the display of this player, I Googled the…
stevendesu
  • 15,753
  • 22
  • 105
  • 182
5
votes
1 answer

Android Exoplayer ConcatenatingMediaSource detect end of first source

I am trying add an intro video to my actual video. I am planning to achieve this by using ConcatenatingMediaSource. Below is the source code DataSource.Factory dataSourceFactory = new CacheDataSourceFactory(VideoCache.getInstance(this), new…
Rohan M
  • 171
  • 1
  • 13
5
votes
4 answers

ExoPlayer: Control skip-interval for forward and rewind buttons

I'm looking for a way to set a skip interval for "forward" and "rewind" buttons. By default pressing forward skips 15 seconds of video, but pressing rewind skips only 5 seconds. I'd like to set both to 5 seconds but I can't find any API to do…
Sasha Shpota
  • 9,436
  • 14
  • 75
  • 148
5
votes
0 answers

ExoPlayer shows wrong preview image while swiping screens through ViewPager

I have a PlayerView that takes up the top half of the Fragment in portrait orientation with the bottom half showing some text. The fragment is a part of a ViewPager and a user can switch screens with different videos. Problem: While navigating…
Sasha Shpota
  • 9,436
  • 14
  • 75
  • 148
5
votes
1 answer

ExoPlayerImplInternal: Renderer error can't play video android

I am regularly using google Exoplayer2 library in all my 4 apps. But I have facing some problem to play video its omits error: ExoPlayerImplInternal: Renderer error. …
Jayesh Rathod
  • 600
  • 1
  • 5
  • 18
5
votes
0 answers

ExoPlayer2 Zoomable View?

There are what appear to be several clones of the same answer for the first version of Exoplayer and the original Android media player, but they do not compile on Exoplayer2, which reorganized quite a bit of the internal code. A reasonably-diligent…
Tickerguy
  • 91
  • 1
  • 6
5
votes
2 answers

How to use MediaSession extension for ExoPlayer v2.5+

I want to use MediaSession with exoplayer and by searching I found that Exoplayer already have MediaSession extension library(https://github.com/google/ExoPlayer/tree/release-v2/extensions/mediasession), but I am unable to find any good…