How to Google Cast a local .mp4 file from Flutter mobile app to Chromecast?
02:11 19 Feb 2026

I am building a Flutter mobile application and trying to cast a local .mp4 file to Chromecast.

βœ… Current Architecture

  • Flutter mobile app

  • I start a local HTTP server on the mobile device (same WiFi network)

  • Example served URL:

http://192.168.1.23:8080/video.mp4
  • I pass this URL as contentId in the Google Cast LOAD request.

πŸ”§ Media Load Request (Simplified)

await chromeCastSession.loadMedia(
GoogleCastMediaInformationIOS(
    contentId: contentUrl,
    contentUrl: Uri.parse(contentUrl),
    contentType: contentType,
    streamType: CastMediaStreamType.buffered,
    duration: videoDuration,
    metadata: metadata,
   )
);

🚫 Problem

The Chromecast receiver rejects the load/play request.

Symptoms:

  • Media status becomes IDLE

  • Player state does not change to BUFFERING or PLAYING

  • No playback starts

  • Receiver logs indicate load failure (no detailed error exposed in Flutter)

πŸ“Œ Important Notes

  • The Chromecast and mobile device are on the same WiFi network

  • The URL works in:

    • Mobile browser

    • Laptop browser (same network)

  • The .mp4 file plays correctly locally

  • The server is a basic Dart HTTP server (dart:io)


❓ Questions

  1. Does Chromecast require specific HTTP headers (e.g., Range support)?

  2. Does the server need to support:

    • Partial content (206 responses)?

    • Byte range requests?

  3. Are there known limitations when casting from a mobile-hosted HTTP server?

  4. Could this be related to:

    • CORS?

    • MIME type?

    • Missing Accept-Ranges header?

    • HTTPS requirement?


🎯 What I Want to Understand

What are the exact server requirements for Chromecast to successfully load and play media from a local HTTP server?
How can I chrome cast .mp4 videos form mobile?

flutter chromecast google-cast