Building a video streaming app with ExoPlayer

ExoPlayer is Android’s widely used engine for live and on-demand video, yet a useful streaming product extends well beyond placing a player in a layout. A complete app needs a searchable catalogue, authenticated sessions, adaptive manifests, captions, viewing history, analytics and an operational backend. ExoPlayer, now maintained through Android’s Media3 libraries, handles the media layer while the rest remains conventional Android software.

A production app also needs somewhere to publish video, protect catalogue data and issue playback authorisation. Many teams place the application API and a small database on a DigitalOcean Droplet, while large files move to object storage or a specialist streaming origin. Video traffic then scales independently from lightweight catalogue requests, which matters when a busy Australian household opens the service on several devices.

The default phpMyAdmin installation notice on this type of DigitalOcean page is a deployment checkpoint, not an Android feature. Follow its SSH instructions and phpMyAdmin 1-Click Quickstart guidance to establish a restricted administration path for catalogue records. Treat phpMyAdmin as an internal tool; the public app should call a documented API instead of connecting directly to database tables.

Australian viewing habits should shape the experience from the start. Commuters on Sydney and Melbourne trains regularly enter and leave mobile coverage, NBN plans compete with metered cellular data, and Australian screens already offer ABC iview, Netflix, YouTube and free ad-supported channels. Resilient playback, economical quality levels, accessible captions and responsible data handling are practical requirements rather than optional extras.

Design the playback architecture

Keep media playback, catalogue logic and business rules in separate layers. ExoPlayer should consume HLS or DASH manifests supplied by the API, with the app deciding what users may watch rather than embedding permissions inside the player interface. This structure allows live streams, television episodes and short-form clips to share a catalogue model while retaining source-specific playback settings.

The catalogue response should include a stable content identifier, title, duration, artwork, manifest URL, caption tracks and any DRM configuration. A short-lived playback token can be attached to requests for protected manifests, while expiry metadata lets the app refresh access before a stream fails. Avoid returning database credentials or permanent secrets to the device.

Adaptive bitrate selection should respond to available bandwidth, buffer health and the user’s data preference. ExoPlayer can switch among renditions without restarting the stream, which preserves continuity when a train moves between stations or a home connection changes. Record the selected quality occasionally, but collect the data only when it is needed for reliability or capacity decisions.

Connect the Droplet to a secure catalogue

Create the Droplet with a supported Ubuntu image, apply updates and configure access through SSH before installing anything else. The public application can run behind a reverse proxy with HTTPS, while phpMyAdmin remains available only to administrators. Database migrations should be repeatable, and catalogue publishing should update an API-backed cache rather than making every player request perform database work.

Do not leave phpMyAdmin exposed to the entire internet with a simple password. Restrict access with an allow-listed address, private network or SSH tunnel, and rotate administrator credentials. The app can use least-privilege database accounts for its own service, while sensitive changes stay behind separate administrative authentication and audit logs.

Video files should pass through a media pipeline that creates the required HLS and DASH renditions, thumbnails and caption files. For the catalogue administration journey, adapting web test guidance can create repeatable checks for search, publishing and broken playback links. These checks complement Android instrumentation tests because a published record can be valid in the database yet still point to an unavailable manifest.

Configure ExoPlayer for real viewing conditions

Use the current androidx.media3 packages for the core player, interface, HLS and DASH support, then wrap ExoPlayer in a lifecycle-aware component. A PlayerView can provide the standard surface and controls, while the activity or view model owns the player instance. Pause it in onStop, preserve the position and release resources in onDestroy so rotation or backgrounding does not waste battery or decoder capacity.

Build a data-saving mode around ExoPlayer’s track-selection controls. Users on metered mobile data can cap the maximum rendition, while automatic mode can use available bandwidth during an NBN session. Resume playback from the last saved position, expose a clear buffering indicator and provide a retry action that distinguishes a temporary network problem from unavailable content.

Playback should also fit Australian routines beyond the train commute. Media-session integration supports headphones, lock-screen controls and Android Auto, while captions need correct styling for Australian English and accessible contrast. Offer subtitle preferences, audio-description tracks where supplied, and a compact player that remains usable on phones in portrait orientation.

Protect accounts, content and user data

Account security starts with short-lived access tokens, secure storage on the device and server-side revocation. The login flow should distinguish an expired session, invalid credentials and a device restriction without revealing which account exists. Rate-limit repeated failures, require MFA for administrative roles and send users a useful event when a new device signs in.

Warning design deserves a deliberate review because unclear messages can push users toward fake support pages. A separate resource on login and warning messages can prompt checks for expired sessions, misleading redirects and phishing-like prompts, even though its casino-specific subject is outside this product. Keep recovery links in the verified domain and show the service’s real support channel.

For covered organisations, the Privacy Act 1988 and Australian Privacy Principles require clear handling of personal information, restrained collection and workable access or deletion pathways. Publish a plain privacy notice, explain viewing history and analytics retention, and avoid collecting precise location unless a defined feature needs it. Content licensing, the Copyright Act 1968 and ACMA classification rules also affect which streams can be offered and how they are labelled in Australia.

Test, release and measure the service

Test manifest parsing, token refresh, track selection, caption loading and error mapping in unit tests. Instrumentation tests should cover real playback on several Android versions, network loss, low bandwidth, audio focus, rotation and process recreation. A small device lab in Sydney and Melbourne can reveal differences in decoding performance, mobile coverage and household connections that an emulator will not reproduce.

Measure startup time, rebuffer duration, playback failure rate, crash-free sessions and completion by content type. Segment the results by app version, device class and Australian network type without storing raw viewing histories for this purpose. Use the measurements to tune manifests and default quality, and keep a release process that can roll back the app or disable a faulty stream quickly.

Before publication, verify caption accuracy, age ratings, classification labels, privacy disclosures and the account-deletion path. Coordinate protected playback with a Widevine licence service when the content agreement requires DRM, and ensure the licence endpoint cannot be replaced by a client-supplied host. Publish gradually through the Australian app market, then expand the release using measured playback quality and support demand.

Start with one live channel and one on-demand collection, then connect every stage from upload to playback. Establish the Droplet, API and media pipeline first, secure phpMyAdmin before importing data, and build the Android player against realistic manifests. This narrow path exposes security and reliability problems before the catalogue expands.

Launch the working build to a controlled Australian audience, watch actual network conditions and collect feedback through the app’s support route. Fix failed playback paths, tune data use and document the release process. Expand the catalogue and device coverage only after the complete viewing journey remains stable.