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
2 answers

Unable to play exoPlayer in full screen with setOnClickListener

By default video will be playing in portrait mode and when imageView1.setOnClickListener is clicked it video should play in full_screen.xml But in my case i can't play video in full_screen.xml, I have also added
sanoj lawrence
  • 951
  • 5
  • 29
  • 69
2
votes
0 answers

Play HLS radio without player view in my Android app

I am developing an android app to play the HLS radio. I don't want to have a player view since there is no video track for the streaming. I want to control the audio playing by a play/pause button. I did some google search and I found that there is…
2
votes
2 answers

Best way to release and reinitialize exoplayer in RecyclerView

I have two instances of Exoplayer with different mediasources. Currently Before initializing either of player. I am checking if any player attached to the surface if yes then releasing the player and initializing again with new operator…
2
votes
0 answers

How to update ExoPlayer's progress bar while playing video on CastPlayer Android?

I have a doubt regarding the ExoPlayer and CastPlayer. When I cast a video on the castplayer the progressbar on exoplayer is not being updated, also the remaining and the timme elapsed on exoplayer is not updating. I want to enable the…
CSG0811
  • 632
  • 5
  • 20
2
votes
1 answer

HTTP URL is not working in the ExoPlayer for Android 10

I have an HTTP URL of audio. The URL is working fine with the ExoPlayer v2.7.0 when android TargetSDKVersion is 26. When the TargetSDKVersion is set to 28, it is not working. Getting the following error: W/MediaPlayer: Couldn't open…
2
votes
1 answer

How to resolve DefaultTrackSelector#getCurrentMappedTrackInfo returning null?

I am using Exoplayer version 2.7.2, and I want to iterate over MappedTrackInfo to get all the available TrackGroupArray of a DASH video. But DefaultTrackSelector#getCurrentMappedTrackInfo is returning null. Here's my…
God Shashank
  • 21
  • 1
  • 2
2
votes
0 answers

Can't able to Play RTMP Voice Stream in ExoPlayer

When I stream Video with Audio I could able to play both Audio and Video in receiver side, When I stream Audio alone I Can't able to Play Audio in receiver side. private void initializePlayer(String rtmpUrl) { Intent intent = getIntent(); …
2
votes
1 answer

How to change encoding to a downloaded file Kotlin

I'm making an app which will download a .zip file, unzip it and finally take the .srt file (which was zipped) and put it as subtitle file in exoplayer movie. My problem The file has greek letters inside and when I put it as a subtitle file I only…
2
votes
0 answers

Exoplayer Custom Renderer For Images

I am trying to create an ImageRenderer for Exoplayer. I'm not sure how to start and am struggling to understand all of the components needed. My use case is I would like to have a playlist that could be a mix of hls and png url sources. I'm playing…
M. Smith
  • 379
  • 1
  • 20
2
votes
3 answers

Exoplayer - How to check if MP4 video has audio?

I'm using URLs from an API. Some of the URLs are mp4's without sound(video is playing just no sound). How do I check if that video has sound or not? I've been searching through SimpleExoPlayer docs and testing the methods on my…
DIRTY DAVE
  • 2,523
  • 2
  • 20
  • 83
2
votes
1 answer

Exoplayer2 Streaming HLS Videos , Sometimes plays video with sound only(video not played)

I implement exoplayer2 in my app for playing HLS Videos, but sometimes it plays just sound, and doesn't work correctly. What am I supposed to do? I couldn't find why this happens sometimes. this is the code for initializing player : fun…
Mona Baharlou
  • 1,401
  • 1
  • 13
  • 26
2
votes
2 answers

How can I get bitrates from live video in ExoPlayer2

I need to find streaming video bitrate from exoplayer, but it seems that this code does not show real bitrate bitrateEstimate = bandwidthMeter.bitrateEstimate
Mona Baharlou
  • 1,401
  • 1
  • 13
  • 26
2
votes
0 answers

Android React native Expo-av certificate pinning

android: Q, react-native: 0.60 expo-sdk .35+ Our app uses certificate pinning with self-signed certificate. This all works with React native nicely, because React native provides a hook to specify a custom OkHttp Client, that manages the pinned…
V P
  • 845
  • 10
  • 28
2
votes
2 answers

What is the correct way to play songs on ExoPlayer with Android 10 (Q) and targetSdkVersion = 29?

With the recent changes on Android 10 (Q), trying to play a song from the user's device on an app (that targets sdk version 29 and runs Android 10) using ExoPlayer, prints the following log on the console and fails (the song is not…
Augusto Carmo
  • 4,386
  • 2
  • 28
  • 61
2
votes
2 answers

Android Exoplayer play UDP streaming no audio

im new in android webview, i play video in android webview using exoplayer, there are 2 category video that i play, first mp4, working well. second streaming (unicast m3u8 and UDP) the video play well but no audio, i try play in stream vlc the…
Jimbo
  • 49
  • 8