How to integrate a short drama API into mobile apps
Use your backend to call ShortDramaAPI, then play HLS in the native or cross-platform player. API access is not the same as content rights — confirm territories and monetization before launch. This guide does not assume a vendor SDK.
Recommended architecture
- Your app asks your server for feed / episode metadata.
- Your server calls
catalog→episodes→playbackwith a server-held API key. - Your server returns a short-lived playback URL (and subtitle URLs) to the app.
- The app loads the
.m3u8in a vertical player (9:16).
iOS (AVPlayer)
AVPlayer plays HLS natively. Create an AVURLAsset / AVPlayerItem from the playback URL. Add AVMediaSelectionGroup handling for audio and legible (subtitle) options when the manifest exposes them. Prefer HTTPS URLs and handle expired links by re-requesting playback from your backend.
Android (ExoPlayer / Media3)
Use Media3 ExoPlayer with an HLS media source. Map audio and text tracks from the player’s track selector so users can switch language independently. Retry by refreshing the playback endpoint if the CDN URL expires.
React Native
Common pattern: fetch metadata via your API, then play with a community HLS-capable video component or a native module wrapping AVPlayer / ExoPlayer. Keep the ShortDramaAPI key on the server; the RN app only receives playback URLs.
Flutter
Flutter can play HLS through standard packages that wrap platform players. See the dedicated Flutter HLS guide. This guide does not assume a vendor SDK.
Checklist before store submit
- Confirm content rights for each store territory and monetization model — content rights.
- Verify offline / background playback policies match your license.
- Test first-frame and buffering on target devices; measure what matters to viewers.
- Wire error UI when playback returns 403/404/expired URL.