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
contentIdin the Google CastLOADrequest.
π§ 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
IDLEPlayer state does not change to
BUFFERINGorPLAYINGNo 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
.mp4file plays correctly locallyThe server is a basic Dart HTTP server (
dart:io)
β Questions
Does Chromecast require specific HTTP headers (e.g.,
Rangesupport)?Does the server need to support:
Partial content (206 responses)?
Byte range requests?
Are there known limitations when casting from a mobile-hosted HTTP server?
Could this be related to:
CORS?
MIME type?
Missing
Accept-Rangesheader?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?