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

ExoPlayer r1.5.12 to 2.7.3 migration

Currently I'm using version r1.5.12 to play MP3 files from InputStream using a custom UriDataSource. I'd like to upgrade to version 2.7.3 but I'm not sure which class replaces ExtractorSampleSource or whether it's possible to reuse my custom…
rraallvv
  • 2,875
  • 6
  • 30
  • 67
0
votes
0 answers

SimpleExoplayerView plays audio, screen is white

So I am trying to play a DASH video in a SimpleExoplayerView. I am following the most basic tutorials from https://codelabs.developers.google.com/codelabs/exoplayer-intro/#0. The trouble is, I am able to hear the audio but the screen is always…
0
votes
2 answers

Change Video Bitrate In Exoplayer 2.x

I tried to make a streaming app with ExoPlayer2.x . Now I got stuck in a problem. I am trying to make a Bitrate Changer. I don't want to use TrackSelector. I just want to use a method to change Bitrate of a single video to use when there is low…
devROYAL
  • 430
  • 4
  • 12
0
votes
1 answer

How to access Bandwidth with BandwidthMeter on Exoplayer (RTMP streaming)

I'm trying to get the bandwidth using getBitRateEstimate but it keeps returning -1 : (I think the issue has something to do with not providing the meter to the DataSourceFactory, but I can't figure out how to do it) Here is the code : private void…
ArzhRo
  • 71
  • 2
  • 4
0
votes
0 answers

I am using Exoplayer 2.7.1 and I'm trying to play cache directory a .tmp format file, but it does not play

Here i have attached my code `public class DownloadMusicActivity extends Activity { /** * Estimates bandwidth by listening to data transfers */ private static final DefaultBandwidthMeter BANDWIDTH_METER = new DefaultBandwidthMeter(); /** * The…
Siva Kumar
  • 61
  • 7
0
votes
2 answers

How to stop a user seeking a video in Exoplayer?

I'have included Exoplayer in a app, Client is requesting that user should watch the full video and close the screen. I'have implemented PlayerEventListener for identifying the finished state, But didn't find any callback or a way to stop user…
Voora Tarun
  • 1,266
  • 1
  • 20
  • 38
0
votes
1 answer

How to show ad markers in ExoPlayer?

I am using ExoPlayer 2.7.1. I have to show ads at certain intervals. These intervals are in an array of longs as milliseconds. How do I show ad markers in the ExoPlayer controller?
khateeb
  • 5,265
  • 15
  • 58
  • 114
0
votes
1 answer

Music service not working after some second when app in background in Oreo

How can I run service in background in oreo? This service class is working good in all Android versions below Oreo, and I declared this service in manifest. In my activity class I launch with…
Naveen
  • 21
  • 4
0
votes
0 answers

Is it possible render video to memory buffer

I'm wondering if it's possible to get pixel data from a video frame decoded by ExoPLaye without using any UI-elements(SurfaceView, TextureView etc). I want to show video frames in a game that contains only one top level GlSurfaceView. And I want to…
papirosnik
  • 311
  • 1
  • 3
  • 14
0
votes
1 answer

exoplayer2: pause video at start with ConcatenatingMediaSource

While playing videos from a ConcatenatingMediaSource playlist, I would like the player to pause automatically at the start of a new item eg. not automatically playing it. Using the demo application, I modified onPositionDiscontinuity function to…
bagage
  • 1,094
  • 1
  • 21
  • 44
0
votes
0 answers

Offline viewing of HLS video using Exoplayer

I am looking for sample code which shows how to download HLS video and play the downloaded video.
0
votes
1 answer

Is their any drawback to have a pool of exoplayer in memory?

I have an app with show to user a feed of photos/video similar to what is Instagram. I want the smoothest scrolling experience as possible (avoid any lags in the scroll). Problem is that creating an empty simpleExoPlayer can take around 10 to 20ms…
zeus
  • 12,173
  • 9
  • 63
  • 184
0
votes
2 answers

Right Exoplayer Uri

I downloaded a simple Exoplayer example (this link: github example) And it works perfectly with the uri that is set into it, but when I change to the video a want to play, nothing happens. I guess the Uri i'm trying to set is not right. How can I…
0
votes
0 answers

Exoplayer2 onBandwidthSample

I am using Exoplayer2 and i have no callback when i override the onBandwidthSample method. What am i doing bad? This is my code: new DefaultBandwidthMeter(new Handler(), new BandwidthMeter.EventListener() { @Override …
Billyjoker
  • 729
  • 1
  • 10
  • 31
0
votes
0 answers

Exoplayer2 hls - choose quality

I'm use the Exoplayer2 to play HLS videos and i want to let the user choose the quality of the video by himself. i have this url for example : https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8 in this url we have 8 different…
gil cohen
  • 333
  • 2
  • 8
  • 21