Flutter short drama HLS integration

ShortDramaAPI returns HLS (.m3u8) playback URLs. Flutter apps can play those streams with standard video packages. This guide does not assume a vendor SDK.

SDK clarity: Flutter can play HLS with packages such as video_player. That is not the same as a vendor-maintained ShortDramaAPI Flutter SDK. This guide does not assume a vendor SDK.

Flow

  1. Your Dart app calls your backend for series / episode lists.
  2. Your backend uses the ShortDramaAPI key to call catalog → episodes → playback.
  3. Your backend returns the HLS URL (and optional subtitle URLs) to Flutter.
  4. Initialize a video controller with that URL inside a 9:16 player widget.

video_player example

Fetch a fresh playback URL from your backend if it expires, then initialize the controller:

Dart — video_player + HLS
import 'package:video_player/video_player.dart';

late final VideoPlayerController controller;

Future<void> playHls(String playbackUrl) async {
  controller = VideoPlayerController.networkUrl(
    Uri.parse(playbackUrl),
    formatHint: VideoFormat.hls,
  );
  await controller.initialize();
  await controller.play();
}

If playback fails after a while, request a fresh URL from your backend rather than reusing an expired CDN link.

Player options (high level)

Vertical UX tips

API quickstart Mobile guide View live demo