A Flutter streaming app for movies and TV series with native Kotlin stream extraction, multi-provider fallback, and smooth HLS playback.
- Native Stream Extraction — Kotlin-powered extraction using OkHttp with DNS-over-HTTPS, parallel server discovery, and HLS validation
- Multi-Provider Fallback — 20+ stream sources tried automatically: VidLink, VixSrc, Vidrock, Vidzee, Videasy, PrimeSrc, Frembed, RPM, VidsrcNet, VidsrcRu, VidsrcTo, Moviesapi, 2Embed, Vidflix, VOE, Streamtape, and more
- Smooth HLS Playback — Parallel variant validation, ExoPlayer with 30s back buffer, adaptive quality switching
- Subtitle Support — Grouped by source server (VidLink, RPM, Vidsrc, HLS), SRT/VTT parsing, inline display
- Quality Selection — Manual quality picker with auto-switching support
- Episode Autoplay — Auto-advances to next episode with 30s countdown
- Watch History — Resume playback from last position, saved every 15 seconds
- Watchlist — Save favorite content for later
- Firebase Auth — Email/password and Google Sign-In
- TMDB Integration — Movie/series metadata, posters, backdrops, episode info
- TV Mode — Dedicated Android TV interface with D-pad navigation
- Auto-Update — Checks GitHub Releases for new versions, shows changelog, downloads and installs APK
- Push Notifications — Content availability alerts via Firebase
User selects content
↓
DirectM3u8Service.fetchMovieStreamUrl() / fetchSeriesStreamUrl()
↓
NativeStreamExtractor.resolveStream() [Platform Channel]
↓
StreamExtractor.resolveStream() [Kotlin, OkHttp]
↓
┌─────────────────────────────────────────┐
│ Server Providers (parallel discovery) │
│ StaticTmdbProvider, VidrockProvider, │
│ VidzeeProvider, PrimeSrcProvider, │
│ FrembedProvider │
└─────────────────────────────────────────┘
↓ (20+ servers per movie)
┌─────────────────────────────────────────┐
│ Host Extractors (per-URL matching) │
│ VidLink (WebView), RPM (AES-CBC), │
│ VixSrc (signed URLs), VidsrcNet │
│ (10 decryption algos), Vidrock, │
│ Vidzee (AES-GCM), VOE, GenericMedia │
└─────────────────────────────────────────┘
↓
Parallel HLS Validation (coroutineScope + async)
↓
video_player + Chewie (ExoPlayer on Android)
↓
Video plays with subtitles, quality switching, episode autoplay
- Server Discovery — Multiple
ServerProviders run in parallel, each generating server URLs from TMDB IDs - Extractor Dispatch — Each server URL is matched to a
HostExtractorby domain - Stream Resolution — Extractors resolve embed pages, decrypt payloads, follow redirects
- Redirect Chaining — Up to 5 redirect hops with cycle detection
- HLS Validation — Master playlist parsed, variants validated in parallel, subtitles extracted
- Playback — URL handed to ExoPlayer with headers, back buffer configured
| Extractor | Technique |
|---|---|
| VidLink | WebView JS injection intercepts /api/b/ fetch responses |
| RPM | AES-CBC decryption of hex payload, 5 route candidates (HLS, TikTok, Cloudflare) |
| VixSrc | Signed URL construction with token expiry, 410 retry |
| VidsrcNet | 3-level iframe chain, 10 per-ID decryption algorithms (XOR, Base64, ROT13) |
| Vidrock | AES-encrypted TMDB ID, tries all servers from API response |
| Vidzee | AES-GCM master key from remote API, AES-CBC link decryption |
| VidsrcRu | WebView network interception of /file2/*.m3u8 URLs |
| VidsrcTo | RC4 decryption with GitHub-hosted keys, multi-source fallback |
| Frembed | API-based server list with HTTP redirect resolution |
| GenericMedia | Catch-all regex scan for .m3u8/.mp4 URLs in page HTML |
- Framework: Flutter 3.8.0+ (Dart)
- Native: Kotlin (Android) — stream extraction, HLS validation
- Video: video_player + Chewie (ExoPlayer on Android)
- HTTP: OkHttp with DNS-over-HTTPS (Google DNS)
- Auth: Firebase Auth (Email/Password, Google Sign-In)
- Database: Firebase Firestore + SQLite (local)
- API: TMDB API (movie/series metadata)
- State: Provider
- UI: Material Design, Glassmorphism, Shimmer, Lottie
lib/
├── main.dart / main_phone.dart # App entry points
├── screens/ # UI screens
│ ├── m3u8_video_player_screen.dart # Main video player with subtitles, quality, autoplay
│ ├── maxstream_main_screen.dart # Bottom nav (Home, Search, Series, Watchlist, More)
│ ├── maxstream_home_screen.dart # Home with hero banners, sliders
│ ├── maxstream_search_screen.dart # Search with All/Movies/TV/Actors tabs
│ ├── maxstream_details_screen.dart # Movie/series detail pages
│ ├── maxstream_series_list_screen.dart
│ ├── maxstream_watchlist_screen.dart
│ ├── profile_settings_screen.dart # Profile, name, picture, password
│ └── streaming_provider_settings_screen.dart
├── services/
│ ├── native_stream_extractor.dart # Platform channel bridge to Kotlin
│ ├── direct_m3u8_service.dart # Stream URL resolution service
│ ├── tmdb_api_service.dart # TMDB API client
│ ├── profile_service.dart # Firebase profile picture upload
│ ├── watch_history_service.dart # SQLite watch history
│ ├── update_service.dart # GitHub Releases auto-updater
│ ├── notification_service.dart # Local notifications
│ ├── auth_service.dart # Firebase authentication
│ └── user_service.dart # User profile management
├── tv/ # Android TV interface
│ ├── screens/ # TV-optimized screens
│ ├── widgets/ # TV focus, navigation, keyboard
│ ├── services/ # TV scraper service
│ └── providers/ # TV state management
├── widgets/ # Reusable UI components
├── models/ # Data models (Movie, Series)
├── database/ # SQLite helpers
├── config/ # API configuration
└── utils/ # Utilities, responsive helpers
android/app/src/main/kotlin/com/maxstream/app/
├── MainActivity.kt # Platform channel handler
└── StreamExtractor.kt # ~1500 lines: 4 server providers, 17 host extractors, HLS validation
- Flutter SDK >=3.8.0
- Firebase project with Auth enabled
- TMDB API key
git clone https://github.com/chila254/maxstream.git
cd maxstream
flutter pub get
flutter run- Firebase — Create project, enable Auth, download
google-services.jsontoandroid/app/ - TMDB — Get API key from themoviedb.org, add to
lib/config/api_config.dart
The app checks GitHub Releases on startup for newer versions:
- Hits
https://api.github.com/repos/chila254/maxstream/releases/latest - Compares release tag (e.g.
v1.0.1) with installed version - Shows local notification + in-app dialog with changelog from release body
- Downloads
MaxStream.apkfrom the release asset - Prompts Android package installer
To release an update:
- Build APK:
flutter build apk --release - Create GitHub release with tag
v1.0.1, titlev1.0.1 - Attach
MaxStream.apkas a release asset - Write changelog in the release body
# Android APK
flutter build apk --release
# Android App Bundle
flutter build appbundle --release- Current: 1.1.0+3
- Min SDK: 3.8.0
Pull requests welcome. For major changes, open an issue first.
MIT License — see LICENSE for details.
Chila254 — github.com/chila254/maxstream
