تخطَّ إلى المحتوى

ɳTV Setup

هذا المحتوى غير متوفر بلغتك بعد.

This page covers setting up the ɳTV backend and connecting the Flutter app to it. For IPTV-only use, skip to M3U / IPTV: no backend is needed.


Flutter app:

  • Flutter SDK 3.10 or later
  • Dart 3.0 or later (included with Flutter)
  • A device or simulator for your target platform

Backend:


ɳTV uses a standard ɳSelf backend. Create one alongside the app:

Terminal window
mkdir -p ntv/.backend
cd ntv/.backend
nself init

nself init walks through project name, domain, and environment settings. For a local development setup, use localhost and accept the defaults.


Terminal window
cd ntv/.backend
# Set your license key
nself license set nself_pro_xxxxx...
# Required paid plugins
nself plugin install streaming stream-gateway epg tmdb
# Free plugins (no key needed)
nself plugin install torrent-manager content-acquisition subtitle-manager

Optional paid plugins for additional features:

Terminal window
nself plugin install media-processing # server-side encoding (Rust)
nself plugin install recording # DVR from live streams

Terminal window
nself build
nself start

nself build generates the docker-compose.yml from your plugin configuration. �P1� start brings up all services.

Verify the backend is running:

Terminal window
nself status

The streaming plugin API should be reachable at http://localhost:8000/streaming/library (adjust port to your ɳSelf project config).


Terminal window
git clone https://github.com/nself-org/ntv
cd ntv
flutter pub get

Launch the app:

Terminal window
flutter run

On first launch:

  1. Tap Configure Backend on the Library screen (or open Settings from the bottom nav).
  2. Enter your backend URL in the Backend URL field. For local dev: http://localhost:8000. For a remote server: https://your-server.example.com.
  3. Enter your API key if your backend requires authentication (the ɳSelf auth token or a configured static key).
  4. Tap Save Connection.

The Library screen will load your media collection. If it shows an error, check that nself status shows all services healthy and the URL is correct.


With the backend running and the app connected, add media to your library:

  • Via the backend: Copy files into the media directory configured in your ɳSelf project .env and run nself media scan (requires media-processing plugin).
  • Via torrent-manager: Use the nself admin UI at localhost:3021 to add torrents if the torrent-manager plugin is installed.
  • Via content-acquisition: Configure automated download rules if the content-acquisition plugin is installed.

After adding files and scanning, pull-to-refresh on the Library screen to see new content.


Key environment variables for the ɳTV backend (set in nself):

VariableDescription
MEDIA_PATHDirectory where media files are stored
TMDB_API_KEYTMDB API key for metadata (required by tmdb plugin)
STREAMING_SEGMENT_DURATIONHLS segment length in seconds (default: 6)
STREAM_GATEWAY_AUTHEnable bearer token auth on stream URLs (true/false)

Get a free TMDB API key at themoviedb.org.


To deploy the ɳTV backend to a remote server:

Terminal window
cd ntv/.backend
nself deploy staging # deploy to staging server
nself deploy prod # deploy to production server

The ɳTV Flutter app can point to any reachable backend URL, local, staging, or production. Update the Backend URL in Settings to switch.


SymptomCheck
Library screen shows errornself status: all services must be Running
No poster arttmdb plugin installed? TMDB_API_KEY set?
Stream fails to playstream-gateway plugin installed? Backend URL reachable from device?
EPG not loadingepg plugin installed? EPG sources configured?
Progress not savingstreaming plugin installed? Auth token valid?