ExoPlayer video playback integration in Android app

TRUETECH is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
ExoPlayer video playback integration in Android app
Medium
~2-3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Integrating ExoPlayer for Video Playback in Android Application

MediaPlayer from the standard Android library handles local files and simple HTTP links. Once you have HLS streaming, DASH manifest, DRM protection via Widevine, or need to seek in a stream without buffering from the beginning — MediaPlayer reaches its limits and ExoPlayer begins.

ExoPlayer (with Media3 — androidx.media3:media3-exoplayer) is Google's library for media playback on Android. It's used in YouTube, Google TV and most streaming applications on the platform.

What We're Integrating

Basic integration: ExoPlayer + PlayerView in layout, loading MediaItem by URL, managing playback through Player.Listener. This takes several hours.

Real tasks are more complex. Adaptive streaming (HLS/DASH): HlsMediaSource or DashMediaSource with DefaultDataSource.Factory. ExoPlayer automatically selects quality based on AdaptiveTrackSelection — but you need to properly configure DefaultBandwidthMeter and DefaultLoadControl with buffering parameters (minBufferMs, maxBufferMs, bufferForPlaybackMs). Incorrect parameters lead to constant buffering pauses even on fast Internet.

DRM via Widevine: DefaultDrmSessionManager with HttpMediaDrmCallback, which accesses the license server. Widevine L1 certificate works only on devices with hardware DRM environment (TEE). L3 is software-based, available on all devices, but quality is limited. The manifest needs android:requestLegacyExternalStorage for some old devices with filesystem quirks.

Picture-in-Picture: when transitioning to background mode, ExoPlayer should continue playback. Activity switches to PiP mode via enterPictureInPictureMode() with PictureInPictureParams. Key — Player is not directly bound to Activity lifecycle, otherwise it stops at onStop(). Solution: ExoPlayer in MediaSessionService or at least a properly lifecycle-aware component.

Typical Issues

ExoPlayer on PlayerView inside RecyclerView — classic pain. On fast scrolling, multiple PlayerViews try to play media simultaneously. You need "one active player" logic with pausing the previous one when the next appears. RecyclerView.OnScrollListener + LinearLayoutManager.findFirstCompletelyVisibleItemPosition() — standard approach.

Audio focus: if the application doesn't request AudioFocus and doesn't respond to its loss, the user's music player won't pause. AudioFocusRequest with OnAudioFocusChangeListener — mandatory part of any video player.

Transitioning between screens without interrupting playback: ExoPlayer should be stored above the screen's lifecycle — in ViewModel or service singleton. PlayerView.setPlayer(null) when leaving screen, PlayerView.setPlayer(player) when returning. Without this you get black screen or double audio.

Versioning: Media3 1.3.x is the current branch at time of writing. Old com.google.android.exoplayer2 is deprecated; migration to androidx.media3 is part of integration work in existing projects.

Integration timeline: 2–3 days for basic player with HLS and playback management. Widevine DRM, PiP, player in RecyclerView — each adds 1–2 days. Cost is calculated individually.