# Multi TV > Free, ad-free, and open-source multi-channel live TV viewing application developed as a Progressive Web App (PWA). ## Core Information - **URL:** https://lab.mertskaplan.com/multitv - **Source Code:** https://github.com/mertskaplan/multitv - **Author:** Mert S. Kaplan (mail@mertskaplan.com) - **Version:** 3.0 - **License:** MIT License ## Description Multi TV is a lightweight, responsive PHP-based application designed to stream multiple television channels or video streams simultaneously on a single page. It supports both YouTube video embeds and direct HLS/M3U8 video streams. The application uses a dynamic grid system powered by Bootstrap to arrange video players cleanly based on the selected channel count. ## Key Features - **Simultaneous Multi-Streaming:** Watch multiple streams at the same time in an optimized grid. - **Hybrid Stream Support:** Detects and handles regular YouTube video IDs (slugs) as well as direct stream links (`http://` or `https://` protocols for `.m3u8` / HLS formats). - **Responsive & Dynamic Grids:** Predefined flexible layouts from 1 up to 25 channels. For channel counts greater than 25, it automatically calculates an X*X grid matrix using the square root of the number. - **Interactive Channel Customization:** Users can dynamically change channel names, reorder channels via drag-and-drop sorting (jQuery UI Sortable), add new channels, and modify stream slugs/URLs through an offcanvas settings sidebar. - **State Persistence:** Saves custom channel lists, preferred channel count, and selected language locally using browser cookies for continuous sessions. - **PWA (Progressive Web App):** Service worker integration with an installation prompt banner allowing users to install the application locally. - **Full-Screen Support:** Native full-screen toggle capabilities optimized across major desktop and mobile browsers. ## Technical Architecture & Stack - **Backend:** Pure PHP (Routing, Cookie Management, i18n file scanning, layout assignment). - **Frontend Framework:** Bootstrap 5 (Styling and layout grid). - **Libraries:** - jQuery & jQuery UI (Drag-and-drop sortable interface for channels). - Hls.js (HTTP Live Streaming engine for rendering live `.m3u8` feeds on non-Safari browsers). - **Internationalization (i18n):** Automated scanning of the `i18n/` directory for `.php` locale files. Out-of-the-box support for: - Turkish (`tr`), English (`en`), French (`fr`), Spanish (`es`), Portuguese (`pt`), Arabic (`ar`), Persian (`fa`), Urdu (`ur`), Kurdish (`ku`), Hebrew (`he`). ## URL Structure & Routing The application processes requests using clean paths mapping to language and grid size definitions: - Base path structure: `{root}/{lang}/{channel_count}` - Examples: - `/tr/4` — Opens 4 channels in Turkish layout. - `/en/9` — Opens 9 channels in English layout. ## Request Query Parameters - `lang`: (String) Explicitly overrides or sets the interface language (e.g., `?lang=en`). - `channel`: (Integer) Explicitly sets the number of channels to render. - `autoplay`: (String) Controls video initialization behavior (`on` or `off`). Defaults to `on`. - `clear`: (Trigger) Clears all persistent cookies (`custom_channels`, `custom_channel_count`, `custom_lang`) and triggers a clean redirection to the application root. - `cn[]` & `vs[]`: (Arrays) Used in pairs to submit custom configurations via forms or URLs: - `cn[]`: Array of channel names (e.g., `cn[]=TRT+1`). - `vs[]`: Array of video slugs/URLs corresponding to those channels (e.g., `vs[]=tv-trt1.medya.trt.com.tr...` or YouTube video ID). ## Persistent State (Cookies) - `custom_channels`: A JSON-encoded string mapping channel names to their streaming slugs or HLS URLs. - `custom_channel_count`: An integer remembering the last grid matrix count selected by the user. - `custom_lang`: Stores the user's preferred language code. - Expiration: Cookies are configured with a validity period of 60 days (`86400 * 60` seconds). ## Default Channels by Language (i18n Data) ### Turkish (tr) NTV, CNN Türk, Sözcü TV, Habertürk, Halk TV, Haber Global, TV 100, TRT Haber, TGRT Haber, CNBC-e, TYT Türk, Ulusal Kanal, Bloomberg HT, TVNET, 24 TV, Ekotürk TV, Bengütürk TV, Flash Haber, beIN Sports Haber, TRT Spor, HT Spor, Ekol Spor, Lider Haber, AS TV, KRT TV, Akit TV, TBMM TV, Medya Haber, TELE 1, NİL RTV, TRT 1, Show TV, Star TV, Kanal D, Now TV, TV8, Kanal 7, Teve2, DMAX, TLC, TRT Türk, Ülke TV, 360 TV, DHA Canlı, Finans Turk, TRT 2, TV 4, TRT World, TRT Avaz, TRT Belgesel, Cine 1 TV, Çiftçi TV, Rumeli TV, Tek Rumeli TV, Tivi 6, Meltem TV, Woman TV, Diyanet TV, Dost TV, Semerkand TV, Rehber TV, Lalegül TV, Gonca TV, TRT Spor Yıldız, Sports TV, FB TV, TJK TV, TJK TV 2, TRT Müzik, Power TV, Powertürk TV, Powertürk Taptaze, Powertürk Slow, Powertürk Akustik, Power Love, Power Dance, Number1 TV, Number1 Türk, Number1 Dance, Number1 Damar, Number1 Aşk, Kral Pop TV, Dream Türk, Cartoon Network, TRT Çocuk, TRT Diyanet Çocuk, TRT EBA TV, Baby TV, Türksat Saat, Türksat Tanıtım, Persiana Türkiye, CAN TV ### English (en) BBC News, Sky News, Al Jazeera English, LiveNOW from FOX, DW English, ABC News, ABC News Live, Bloomberg, FRANCE 24 English, TRT World, JoyNews, NHK WORLD-JAPAN, TVP World, Yahoo Finance, TeleSUR English, NEWS9, WION, DD India, NDTV 24x7, Eyewitness News ABC7NY, Channels Television, CGTN Europe, The Reuters 60, CGTN, i24NEWS English World, Africanews English, GB News, America's Voice, BEK News, InfoWars, Iran Press, Black News Channel, CBC News Network, Free Speech TV, KABC-DT1 24/7 News, KFSN-DT1 24/7 News, 6PR ### French (fr) France 24, BFM TV, Euronews Français, i24NEWS Français, CGTN French, Press TV French, RT France, Africa 24, Africanews French, BFM2 HD, BFM Business, BFM Var, Geopolis TV ### Arabic (ar) قناة الجزيرة, قناة العربية البث, قناة الحدث, سكاي نيوز عربية, قناة العربي أخبار, بي بي سي عربي, الشرق للأخبار, المشهد, فرنسا 24, دويتشه فيله عربية (DW), عربية CNBC, الإخبارية السورية, تلفزيون سوريا, فرانس 24, عربي TRT, قناة الحرة, أكسترا نيوز, قناة بلقيس الفضائية, قناة الإخبارية, قناة الميادين