One platform to stream, create & earn
BreakTV runs breaktv.asia: uploads transcoded to an adaptive HLS ladder with cover frames, soundtracks and AI-designed thumbnails, shorts, movies and series, live streaming from the browser or OBS, a creator studio, a wallet with Bakong KHQR top-ups, paid videos and memberships, a video ad server and a Telegram bot and Mini App. Every stream is shielded at the Cloudflare edge, and it all runs on the web and as an installable app, in English and Khmer.
Everything a video service needs, in one platform
A complete OTT stack — from a raw upload to a paid, adaptive stream on every screen.
Video & HLS Engine
Resumable chunked uploads, five cover frames to pick from, soundtracks from a music library, FFmpeg transcoding to an adaptive HLS ladder from 240p to 4K, hover previews, seek-bar storyboards and MP4 downloads.
Shorts
A full-screen, swipeable vertical feed like Reels, where only the short in view plays and the next one loads ahead. Portrait uploads up to 60 seconds become shorts automatically, with their soundtrack's name on screen.
Movies & Series
Movie genres, series grouped into seasons and episodes, “Shows” rows on the home page, and a free 60-second trailer in front of paid titles.
Live Streaming
Go live from a browser or phone camera, share a screen, or stream from OBS through Cloudflare Stream (RTMPS or SRT). Live chat and viewer counts, and the recording becomes a normal video when the stream ends.
Video Ad Server
Ad breaks before, half-way through and after videos and inside shorts, self-serve campaigns, VAST 4.1 tags for other players and a portal for advertisers.
Community
Channels with subscriptions and a notification bell, threaded comments with pins and reactions, community posts, articles, playlists and real-time direct messages.
Creator Studio
Analytics per video — by day, country and platform — comment moderation, subtitles, in-video cards, scheduling, geo-blocking, age limits and pricing.
Wallet & Payouts
A wallet topped up with Bakong KHQR, bank receipts or Telegram Stars; Pro plans and memberships that can renew from it; videos for sale or rent, donations, points and creator withdrawals.
Telegram Bot & Mini App
The whole site inside Telegram, plus a bilingual bot: search, inline mode, account linking, notifications, channel auto-posts and Stars top-ups.
AI Thumbnail Designs
The uploader picks a frame and a style, and Workers AI repaints it as a wide cover and a tall poster: Gemma 4 writes the brief, FLUX.2 paints it. The frames stay, so the uploader can switch back at any time.
Download Protection
Every stream plays from Ed25519-signed links that expire in ten minutes, and the Cloudflare edge checks each request for the site's player rather than a download tool. Segments are handed out in twenty-second windows, no faster than watching.
Stories & Discovery
Trending, latest, most viewed, movies, shorts, live and every category open as full-screen stories, and every thumbnail plays its preview. Search reads Khmer and English, with recent searches kept on the device.
Recent Updates
The latest work shipping to breaktv.asia — newest first.
These docs move to doc.breaktv.asia
This page now has an address of its own, doc.breaktv.asia, served by Cloudflare straight from the edge as static files, so it opens fast and never depends on the video server. It also gains two sections: Infrastructure, which follows a request from the visitor to the server and back, and Pipelines, which follow a video from upload to screen, a live stream, an AI design and a new version of the site on its way out. Old links to breaktv.asia/doc lead here.
The website and the installable app
BreakTV now focuses on the website and the app you install from it (PWA). The old Android and iOS apps, which wrapped the website, are retired along with their code, to make way for new native apps built from scratch later. Nothing changes on the site: on a phone, use the browser or install BreakTV from its menu.
Sign in with Google or Telegram
The sign-in page can offer Google and Log In With Telegram next to the password, once the site's Google client and Telegram Client ID are set in Admin → Settings. A Google address whose account has a confirmed e-mail signs in to that account; a new one makes a new account. Accounts with two-step sign-in are still asked for their code.
A glass card for signing in
Every sign-in page — sign in, create an account, forgotten password and the rest — now shares one frosted-glass card over a dark backdrop, on computers and phones.
A new BreakTV look on computers
On computers the BreakTV theme gets a menu down the left side, a banner carousel and framed poster cards with a “See all” button on each row, under the featured coverflow. The round navbar buttons sit in a pill and the one in use opens out to show its name, and titles and descriptions are a little smaller, so more fits on the screen. Tablets and phones keep their layouts.
Download protection: a video loads no faster than it plays
A download program written against BreakTV took whole videos in seconds: it opened the watch page in a real browser and recorded what the player loaded. Videos now reach the player in stretches of twenty seconds, and the server hands them out only about as fast as a video plays. Watching is unchanged, at double speed and when you skip around too. A program that forces the player ahead, or copies its requests, now gets a video as slowly as watching it. A tab left open since before this update reloads itself once.
Download protection: videos play in the player and nowhere else
Every video now plays through links that last ten minutes and that only the player on BreakTV can use. Download tools such as yt-dlp, ffmpeg and download managers, browser extensions that grab videos, and a link pasted into another program are refused (HTTP 403). A copied link stops working within minutes, and a link made in one country does not open in another. Watching is unchanged: the player renews its link by itself. The Download button still works on videos whose creator allows it. Admins can switch the protection off or on in Settings → Security. It cannot stop a screen recording.
Edit a card you already made
Each card in Studio now has a pencil button. It puts the card back in the form as you typed it: its link or video, title, times, place, colours and picture. Change what you need and press Save: the card keeps its place in the list. Its picture stays unless you remove it or choose a new one. Cancel leaves the card as it was.
Website cards get their own picture, and cards stay up as long as you set
In Studio, a card now asks how long to stay on the player (“Show for”, in seconds) instead of the second it should end at, and says when it will be on screen, from 0:50 to 1:40 for instance. Before, an end written as a length (Show from 50, Until 50) left the card up for only 3 seconds. A website card can bring its own picture, and shows on the player as a square: the picture, its title over the foot in the card’s colours, and a corner badge for opening the site. Cards for videos keep their rounded pill.
Previews on phones: hold for a second, or drag
On phones, a picture plays its preview when you hold it for a second, or when your finger drags over it as you scroll a row or the page. A touch shorter than a second is a tap and opens the video as before, even a slightly slow one that some phones take for a long press.
Video previews on every thumbnail
Point at any video’s picture and its short, silent preview plays: on the home page, in rows and grids, in search, in the watch page’s lists, in playlists, in the library and in the featured carousel. On phones, touch and hold a picture to play it. The preview keeps going after you lift your finger, until you scroll on or hold another, and a quick tap still opens the video as before. One preview plays at a time, and none while your phone is saving data.
Cards on the player open their video in a pop-up
The cards a creator adds in Studio now show on the player as a rounded pill: the video’s thumbnail with a play button on it, then its title, in the colours the creator chose. A card for a video, on BreakTV or on YouTube, plays it in a pop-up player that grows out of the card, while the video you were watching waits and carries on when you close it (✕, Esc, or a tap beside the video). The ↗ button opens the video’s own page, and a card for any other website still opens it in a new tab. On phones the cards are smaller, and two cards never cover each other.
New versions with one reload
The “A new version is ready” notice is gone. A new version of BreakTV now takes over by itself in the background: one reload of the page (or a pull down to refresh in the app) always shows the newest version, with no notice and no second reload.
Card times can be set on computers again
On a computer, the studio’s edit page left a card’s “Show from (seconds)” and “Until (seconds)” fields no room to type in. The card form now lays itself out by the width it has: one field per row in the narrow side column.
Site updates no longer fail uploads
A video still being processed when the site updated could fail, and its upload was deleted. Now it simply starts processing again from the same file after the update, and updates that only change the pages don’t interrupt it at all.
Live as stories
On phones, the live page becomes stories: “Go live” for those who may stream, the streams on air as a row you swipe through (each saying in red how long it has been on, with LIVE at its foot) or a word that nobody is live, then the recordings of past streams two across, newest first, more coming as you scroll. Past streams are new to the live page.
Shorts as stories
On phones, the shorts page becomes stories: the newest shorts as a row you swipe through, each saying how old it is in its corner, the most viewed as a second row (their views in the corner, the top three in red), then the rest two across, more coming as you scroll. Tap a story to watch it full screen and swipe on as before; back brings you to the stories. A link to a short still opens it full screen straight away, and tablets and computers keep the full-screen player at /shorts.
Movies as stories
On phones, the movies page becomes stories: the genres as pills on top (they narrow everything below), the newest movies as a row you swipe through, the most viewed as a second row once there are more movies than one row holds, then the rest two across, more coming as you scroll. A paid movie shows its price in its corner; a free one shows how old it is (or its views, among the most viewed).
Most viewed as stories
On phones, the most viewed page becomes a ranking in stories: the eight most viewed videos of all time as a row you swipe through, each with its views in its corner (the top three in red), the most viewed shorts as a second row, then the rest two across, more coming as you scroll. On trending, the “Most viewed” row now leads to this page, and screen readers read a story’s corner badge in full words (“21 hours ago”, “23 views”).
Latest as stories
On phones, the latest page becomes stories by time: the eight newest videos as a row you swipe through, each saying how old it is in its corner, in red for its first day, the newest shorts as a second row, then everything earlier two across, more coming as you scroll. On every stories page the preview now plays on the first story that has one, and a row with nothing to play (embedded videos) leaves the turn to the next row.
Trending as stories
On phones, the trending page becomes a ranking in stories: the week’s eight best as a row you swipe through, numbered #1, #2… (the one at the front plays its preview), the trending shorts as a second row, then the rest of the ranking two across from #9, more coming as you scroll. A week with no recent views shows the most viewed videos instead, under that name, and a week whose ranking fits in the first row gets the most viewed as a row beneath it.
Search as stories
On phones, the search page now shows your recent searches as pills you tap to search again (kept on that phone, with Clear) before you type anything, then a “Trending now” row and a “Browse categories” row of stories. Once you search, the eight best results are a row of stories you swipe through (the one at the front plays its preview) and the rest are stories two across, more coming as you scroll. The tabs and filters stay as they were.
BreakTV moves to breaktv.asia
The site now lives at breaktv.asia. Old links to ott.breaktv.asia and www.breaktv.asia open the same page on breaktv.asia, and the Android and iOS apps keep working as before. If you added the app to your home screen from the old address, add it again from breaktv.asia; you sign in once more on the new address.
All categories as stories
On phones, the categories page opens with an “All categories” row you swipe through: every category as a story, the busiest first, with its most watched video as the picture and preview, its name over the top and its channels’ faces and number of videos over the foot. A category with no videos yet gets drawn art in its own colour, with a picture for what it is about. Below, a row of the newest videos of each category that has some, its title leading to the category. One preview plays at a time, in the row nearest the top.
Each category as stories
On phones, each category page now opens with a “Trending now” row you swipe through sideways: tall 3:4 stories (the video’s AI poster, or its thumbnail) with the title over the top and the channel’s picture, name and length over the foot. The story at the front plays its silent preview while the row is on screen (not when the phone asks to save data or to reduce motion). Below, all of the category’s videos as stories two across, newest, trending or most viewed first. A category nobody has watched lately shows its newest instead. Long lists everywhere load more by themselves again when you scroll to the end.
The phone’s navigation becomes a notch
On phones, the bar across the top (menu, BREAKTV, search) becomes an island hanging from the top edge of the screen, its dark colour curving into the edge on both sides. It holds the logo, the page you are on, search and your menu (your picture, with a red dot when something is unread). Tap the page’s name and the main pages drop out of it — Home, Movies, Shorts, Trending, Live, Categories, Subscriptions and My list — over a dimmed page, the one you are on marked in red. It stays at the top as you scroll, reaches up under the status bar of the installed app, and every page has it but Shorts.
BreakTV installs like an app on phones
On Android, BreakTV now offers to install itself once you have looked around a little: the install sheet shows screenshots of the app, and the menu keeps Install the app at the top. On iPhone and iPad the same card and menu row show how to add it from Safari’s Share button, and inside the Facebook, TikTok or LINE browser how to open it in a real browser first. Installed, it opens full screen with the new BreakTV icon; a long press on the icon goes straight to Shorts, Search, Subscriptions or Upload, and a video shared from the phone’s gallery opens the upload page with it (Android). The lock screen and notification shade show what is playing, with play, pause, skips and Next, and the icon shows unread notifications. Offline, the app says so and reconnects by itself, and an app left open looks for a new version every half hour.
AI designs for bulk imports
Admin → Bulk import can now design the thumbnails of the videos it imports: tick “Design the thumbnails with AI” and pick a style. Each design starts from the picture the video comes with (YouTube’s thumbnail, for example), right after the import; a download that has no picture is designed from its frames once it is in. Pictures are only fetched from public addresses, and a design is asked for again when Workers AI is slow to answer.
Pick a style for the AI design
When you tick “Design it with AI” on the upload page, eight styles now appear under it, each with a preview: Auto (the AI picks the look that suits your video), Cinematic, Vibrant, Dramatic, Romantic, Vintage, Illustrated and Bright. The design follows the style you pick, in both shapes. In Studio, Design again opens the same choice, starting from the style the last design used.
Subtitles and cards can be added in Studio again
On a video's details page in Studio, the buttons that add subtitles and cards (links shown while the video plays) only reloaded the page and added nothing. They work again, without reloading the page, so unsaved changes to the details stay where they were.
Thumbnails designed by AI
When you upload a video you can now tick “Design it with AI”. Once you publish, Cloudflare’s AI looks at the frame you picked and at the title — Khmer titles included — and repaints the frame as polished cover art, without the lettering, logos or watermarks the frame had: a wide picture for phones and the watch page, and a tall poster for the lists on computers. It takes under a minute. Studio shows both, and you can go back to a frame, or design again from another one, at any time. Admins switch it on, choose who may use it and set a daily limit in Admin → Settings → AI thumbnails.
Video lists on computers become rows of posters
On computers, the home page now lists videos as rows of tall posters with round corners under plain titles, each row running to the edge of the screen — no more red-tabbed boxes. Each poster shows its title at the foot; point at it and its details appear: length and views, the release date, or the time left to watch. Arrows at the sides of a row scroll it a screen at a time. The list pages — Trending, Latest, Movies, a category, your library and a channel's videos — show the same posters in a grid, with the ⋮ menu in the corner. Phones keep their own layout.
The Khmer menu in Noto Sans Khmer
On computers, the menu at the top now shows its Khmer labels in Noto Sans Khmer, like the rest of the site's Khmer text. Before, they used whichever Khmer font the computer had (Khmer Sangam MN on a Mac, for example), so they looked different from the text around them. The English menu is unchanged.
A new logo: a play button in a square
Where the site shows its own mark — the header on computers, the sign-in page, the loading screen and these docs — the red tile with a white triangle is now a play button in a square, drawn in the same red. Point at it and it draws itself: the square traces its outline, then the play button pops up in the middle. People who turn motion down in their system settings see it still. The app icon and the browser-tab icon stay as they were.
A liquid-glass menu on computers
On computers, the menu at the top — Home, Movies, Shorts, Trending, Live and Subscriptions — is now a pill of glass with a drop of water marking the page you are on. Pick another page and the drop flows over to it, splitting into droplets on a long jump and merging back with a ripple; the pointer lifts the surface a little, and each icon plays its own small scene when tapped. On pages that are not in the menu, such as a video or a channel, there is no drop. On narrower screens the menu shows its icons only.
A new Dashboard for the admin
On computers and phones, the admin's Dashboard has a new look: a greeting with a year picker and a user search, then five overview numbers — users, videos, views, comments and open reports — each with a ring and an arrow setting the last 30 days against the 30 before. Below them: activity (views, comments, likes) or community (new members, uploads, subscriptions) as smooth lines by month, week or day; the members active in the last 30 days on a gauge; profile statistics; new members per period; then money, the newest members and the most viewed videos. Point at a chart to see its numbers, or download any chart as a spreadsheet (CSV). It follows your light or dark mode.
A new admin on phones
On phones and tablets the admin panel has a new look: a menu hangs from the top bar showing the page you are on. Tap it for every admin page, grouped, with counts of what is waiting, and Settings opening in place. Search finds any page or setting. Each page sits in a card, and on phones its tables turn into easy-to-read cards. It follows your light or dark mode.
The admin panel becomes a desktop
On computers, the admin panel now works like a desktop: each admin page is an app with its own icon, opening in a window you can drag, resize, snap to half the screen, maximize or minimize to the taskbar, with several open side by side. The taskbar has a Start menu that searches every page, counts of the reports, messages and payments waiting, the state of video processing, quick settings and a notification centre. The wallpaper, light or dark, and accent colour are in Personalize.
Up next first on phones
On phones, a video's page now opens on Up next, and its tabs read Up next, Comments, About. A link to a comment, such as a reply notification, opens Comments.
Phone player: full width, the video's own shape, sound on
On phones, the video now runs edge to edge right under the top bar, in the shape it was uploaded in — 16:9, 4:3 or upright — instead of sitting in a bordered 16:9 frame; one too tall for the screen is fitted into it. It starts by itself, with sound, from where you left off, so the red Play button under the title is gone. Browsers allow sound only once you have touched the site: a video you open from another page of the site, or in the BreakTV apps, plays with sound straight away, while a link opened fresh starts muted and your first tap anywhere turns the sound on.
Edit or delete your video from its page
On a video's page, its uploader now sees Edit video, Analytics and Delete under the buttons. Delete asks first, then removes the video and opens Studio → Videos. The ⋯ menu (Watch later, Report) also opens properly now: the row of buttons used to cut it off.
Pull down to reload
On touch screens, pulling a page down from the top reloads it — in the browser, the installed web app, the Android and iOS apps and the Telegram Mini App. A disc slides down with its arrow turning as you pull, and turns red once letting go will reload; if a new version of the app is waiting, the reload installs it too. It stays out of the way on the video player, the Shorts player, menus and pop-ups.
Whole 16:9 thumbnails on the home page
The home page now shows each video's thumbnail whole, in 16:9, instead of cropping it to a tall poster: in the featured carousel at the top, where the next videos peek from the sides, and in every row. On phones each row is a swipeable carousel with two and a half videos across — the cut-off third shows there is more — with the title, views and age under each picture, and every swipe stops at the start of a video. On computers the rows show four videos across, and three bigger ones in Must-Watch. Shorts stay vertical: on phones they are now a shelf of 9:16 thumbnails, three and a half across, instead of circles.
Live streams on Cloudflare Stream
Live streams can run on Cloudflare Stream: creators go live from OBS, vMix or Larix over RTMPS or SRT, with their channel's own server and stream key, which stay the same from one broadcast to the next. A browser camera broadcast is relayed to Cloudflare, and viewers watch from Cloudflare. When a stream ends, its recording is copied into the video library and deleted from Cloudflare. Switched on in Admin → Settings → Live streaming.
Shorts play full screen
The Shorts page now fills the screen like Reels: the site's bars give way to a back arrow, and the buttons sit on the picture. The whole video shows on a blurred copy of its cover, never cropped, and on computers each short is a 9:16 card on a night sky. The seek bar along the bottom can be dragged, and Space pauses or plays.
Paid and private videos in a private bucket
Videos with a price or set to private now play from a second R2 bucket with no public address: a link copied from the player stops working when its signature expires, and the files move by themselves when the price or privacy changes. Downloads are also saved under the title as written, Khmer titles included.
Videos stream from Cloudflare's CDN
New uploads now go to a Cloudflare R2 bucket and play from cdn.breaktv.asia instead of the server's disk: no egress fees, no ceiling set by the server's disk, and the server no longer sends the video bytes itself. Existing videos were moved over.
YouTube imports work from the server again
YouTube asks servers in data centres to sign in, which stopped imports with “confirm you’re not a bot”. YouTube links now go through a residential proxy set in Admin → Settings → Features, with one sticky session per import and a fresh one when YouTube blocks it.
Khmer text in Noto Sans Khmer
Every screen, both themes and this page now set Khmer text in Noto Sans Khmer, loaded as one variable font instead of four weights of Kantumruy Pro.
Platform documentation at /doc
This page: every module of the platform in one place — the video pipeline, money flows, admin suite, architecture and API — in English and Khmer, with screens of the current build.
Uploads after psar.online: cover frames, soundtracks and operator imports
Publishing now has two phases: five cover frames are cut the moment the file is in, and Publish queues the heavy encode. Uploaders can add a soundtrack from the new music library or their own audio, under or instead of the original sound. Importing from links became an operator tool for staff and granted accounts, HLS segments are now 4 seconds, and the player caches segments and loads the next short ahead.
A glassy coverflow of featured videos
The home page of the BreakTV theme now opens with a 3D coverflow of featured videos: the middle card plays, its neighbours turn away, and a glass dock shows the position with previous, play/pause and next. It moves by drag, swipe or arrow keys, advances every 8 seconds and pauses on hover — 16:9 cards on desktops, 2:3 posters on phones.
Bakong KHQR top-ups and a real ad server
Ported from breaktv.asia: wallet top-ups by Bakong KHQR, credited once the Bakong API confirms the exact amount; Pro and memberships that can renew from the wallet; referral shares of a referred member's first purchases; and an earnings report. Ads now play in breaks, serve VAST 4.1 to other players, count through signed pixels and report to advertisers in their own portal.
PlayTube is now BreakTV
The site name, browser title, Android and iOS app names, push notifications and the built-in theme now say BreakTV. Sites still on the old default name are renamed automatically; a name an admin chose is kept.
Offline shell, update prompt and web push are back
The service worker now registers on every visit, which brings back the offline app shell, the “new version — reload” banner (now translated too) and web push notifications. The home page is fetched network-first, so it always carries the server's meta tags.
A cinematic desktop layout
On tablets and desktops the built-in dark theme now has a pill menu and red-tabbed rows of posters — genres, top 10 per genre, trending, new releases, must-watch, movies, shows, shorts, channels and articles — above a six-column footer. Phones keep the poster-first, Netflix-style layout.
Rebuilt on React and Node.js
The full feature set of the PlayTube 3.1.1 script, rebuilt from the ground up: React 19 and Vite in front, Node.js 22, Express 5 and SQLite behind, FFmpeg for video, and Capacitor apps for Android and iOS.
See it in action
Real screens of the current BreakTV build with breaktv.asia's own content — captured December 2026.








From upload to screen, automatically
Videos, streams, live broadcasts, AI designs and each new version of the site have a pipeline of their own, run by the media worker, the Cloudflare edge or CI, so nobody waits on them.
Upload to adaptive stream
Every upload and import goes through the same FFmpeg pipeline in a separate media worker, so the site never waits on an encode.
Upload
8 MB resumable chunks; FFprobe reads the real size and length, and portrait clips up to 60 s become shorts.
Cover frames
Five frames at 10/25/50/75/90% are cut the moment the file is in — the uploader picks the cover, or has AI design one.
Music Mix
Optional: a library track or the uploader's own audio, under or instead of the original sound, faded out at the end.
HLS Convert
Lowest rendition first so it plays fast, then the rest in one decode — H.264 + AAC, 4 s segments.
Store
Renditions go to Cloudflare R2: public videos to the main bucket, paid and private ones to a second bucket with no public address.
The bitrate ladder
Renditions are named by the short side, so a 1080×1920 short is “1080p”, and only rungs the source can fill are made. Frame rates above 30 fps are kept from 720p up.
Every segment checked at the edge
How a video reaches the player, and why a download tool gets nothing faster than watching.
Watch
The watch page gets a stream token with the video's details: Ed25519-signed, good for ten minutes, made out for the viewer's country.
Window
Before each stretch the player asks for a window token: twenty seconds of video, handed out at most 2.5× faster than it plays.
Edge check
The breaktv-edge Worker checks the token with the server's public key, the browser's Sec-Fetch headers and the player's X-Play proof.
From R2
Segments that pass come straight from the R2 bucket. What the Worker can't answer falls back to the server, which applies the same rules.
Play
hls.js picks the rendition, the service worker keeps segments for three days, and the player renews its token before it runs out.
Camera to replay
Two engines, chosen in Admin → Settings → Live streaming: this server, or Cloudflare Stream for OBS.
Go live
From the browser's camera or screen; with Cloudflare Stream, also from OBS over RTMPS or SRT.
Ingest
MediaRecorder chunks (WebM, or MP4 on Safari) arrive over a WebSocket and are piped into ffmpeg.
Package
ffmpeg writes an EVENT HLS playlist; on Cloudflare Stream, Cloudflare packages it and a watcher flips the video live.
Watch
Viewers play it with hls.js, with live chat and the number watching.
Replay
When the stream ends the playlist closes and is a video at once; Cloudflare recordings are copied into the library.
A frame becomes a cover
A job on the worker's AI lane, with Cloudflare Workers AI; ten designs per member a day by default.
Pick
The uploader picks one of the five frames, ticks “Design it with AI” and a style, or leaves the style to the model.
Brief
Gemma 4 looks at the frame and the title (often in Khmer) and writes, in English, what the cover should show.
Paint
FLUX.2 [klein] repaints the frame twice: a wide cover for phones and sharing, and a tall 5:7 poster for the lists.
Apply
Both go next to the video's other public pictures and replace its cover. No lettering is drawn: the site prints the title itself.
Switch
The frames stay, so the uploader can go back to one, or forward to the design again, at any time in Studio.
Commit to live site, hands off
Every change to the main branch goes out the same way, and is checked on the live site at the end.
Test
GitHub Actions runs the server's end-to-end tests and the web build for every pull request and push.
Promote
A push to main that passes moves the production branch to it.
Edge
CI deploys the breaktv-edge Worker with this build's static files, and the doc.breaktv.asia Worker.
Server
A systemd timer on the server sees production move within a minute and runs deploy.sh: build beside the live copy, back up, migrate, reload PM2.
Verify
CI waits until breaktv.asia loads this build's script from the Worker and the API answers, then checks the old addresses' redirects.
Import by Link (operator tool)
A link → yt-dlp → FFmpeg → HLS → a native video. For staff and the accounts an admin grants, on the web only — unless an admin opens it to every uploader.
Smart Playback
hls.js with adaptive bitrate; the service worker caches segments (cache first) and playlists (network first) without their stream tokens, and loads the next short ahead.
Two-Phase Publishing
Frames first, the heavy encode on Publish; videos over a minute go live at the lowest quality while the higher renditions are still encoding, with progress streamed over a WebSocket.
Soundtracks
A library track (Admin → Music library) or the uploader's own audio, from a chosen start, mixed in during the encode — cut or padded to length, faded out, and named on Shorts.
Previews & storyboards
A muted hover clip for every video card, and a sprite sheet with a WebVTT index that shows a thumbnail as you scrub the seek bar.
Watermark, trailers & downloads
An optional logo burned into every rendition, a 60-second trailer that paid videos show for free, and an MP4 of the top rendition for downloads.
The Watch Experience
A player built around HLS — adaptive quality, resume, subtitles and seek previews — the same on the web, in the installed app and inside Telegram.
Your position is saved as you watch and picked up on any device; history can be paused.
Hover or drag along the seek bar to see the frame you're about to jump to.
Creators upload SRT or VTT tracks per language; SRT is converted to WebVTT on upload.
Space or K to play, J / L for ±10 s, arrows for ±5 s and volume, F fullscreen, M mute, C captions.
An /embed/:id player with oEmbed discovery, Open Graph video tags and Twitter player cards for rich link previews.
Studio & Library
A back office for every creator and a personal library for every viewer — on the same account.
</> Creator Studio
Everything creators need to publish and grow.
- Overview · Videos · Comments · Ads, with a status badge on every upload
- Per-video analytics: views per day, watchers, average watch time, countries and platforms
- Privacy, scheduled publishing, an 18+ age limit and per-country blocking
- Sell and rent prices, unlocked for channel members, with a free trailer
- Cover frames, soundtracks, subtitles, in-video cards, series, seasons and episodes
- Switches for comments, downloads, embedding and ads on each video
</> Viewer Library
Everything viewers keep, in one place.
- Watch history (which can be paused), Watch later, Saved and Liked
- Playlists you can reorder, share and subscribe to
- Subscriptions with a per-channel notification bell
- Purchased and rented videos, with their expiry
- Full-text search with suggestions, filters and hashtags
- Direct messages, notifications and a blocked-users list
Wallet & Payouts
Two balances: a wallet to spend, and creator earnings to withdraw.
Bakong KHQR from any Cambodian bank app — credited once Bakong confirms the exact amount — or a bank receipt an admin approves, or Telegram Stars.
Pro plans and paid memberships — which can renew from the wallet — videos to buy or rent for two days, and ad campaigns.
Sales, rentals and memberships pay the creator after a site commission (10% by default), plus a share of the ads on their videos; earnings can move into the wallet.
PayPal, bank or ABA from $50; the amount is held at once and refunded if an admin rejects the request.
Points, Pro & Referrals
A rewards loop that brings viewers back, and plans that unlock more.
Likes (5), comments (10), watching (2) and uploads (20), up to 1,000 a day — or 2,000 on Pro.
100 points = $1, converted straight into the wallet.
Packages with their own price and length: bigger uploads (8 GB instead of 2 GB), no ads, a verified badge and featured videos — renewed from the wallet when the admin allows it.
A sign-up reward plus a share of a referred member's first Pro purchase, first paid membership and first video purchase or rental; invitation codes for invite-only launches.
Telegram Bot & Mini App
Meet viewers where they already are — the whole site runs inside Telegram, and the bot speaks English and Khmer.
Runs inside Telegram
The full site as a Mini App: sign-in from initData, Telegram's back button and light or dark colours, haptics, and swipe-to-close turned off so feeds scroll cleanly.
Bot commands
/latest, /trending, /search, /link, /unlink and /notifications on|off — with the command menu in English and Khmer.
Inline search
Type @ and the bot's name with a few words in any chat to share matching videos.
Account linking
Link from the site with a one-time code, sign in on the website with Log In With Telegram (Telegram's own window), or create an account straight from the Mini App.
Channel auto-post
Every new public video is posted to your Telegram channel with its thumbnail and an Open button.
Stars & notifications
Wallet top-ups paid with Telegram Stars through native invoices, and notifications delivered as bot messages.
Video Ad Server
Ad breaks in the player, self-serve campaigns, VAST tags for outside players and a portal for advertisers — with a revenue share for creators.
Views, clicks and completed plays count once per viewer, ad and day; views and clicks are charged to the advertiser's wallet as they happen.
Monetized creators earn a share of every billed ad on their videos — 50% by default — and can move it into their wallet.
Advertiser accounts follow the ads assigned to them, with daily stats for any period and CSV export.
Every served ad carries a signed reference, so only ads this server served are counted and billed; campaigns need approval and stop when their budgets run out.
The Admin Suite
30 apps in four folders: on a computer a desktop with windows and a taskbar, on a phone a menu of its own, with inbox counts on anything waiting for a decision. Moderators work the content, money and ad queues; admins also get the reports, payment gateways, advertisers, tools and every setting.
Web, PWA & Reach
Built to reach every device, every inbox and every search engine.
Embeds & Sharing
Every public video has an embeddable player at /embed/:id, oEmbed for automatic embeds and Twitter player cards, so a shared link plays where it is posted.
Installable PWA
A Workbox service worker: offline app shell, cached thumbnails, fonts and video segments, an install offer on Android and iPhone, lock-screen controls and Share to BreakTV. A new version takes over with one reload.
Server-side SEO
Per-page titles and Open Graph from the server, JSON-LD VideoObject, sitemap.xml, RSS and a robots.txt the edge keeps a short copy of.
English & Khmer
Every screen in both languages, Khmer category names, and push and Telegram messages in each user's own language.
Light on mobile data
Adaptive HLS that starts at the lowest rendition, previews that load only when a thumbnail is hovered or held, pages loaded on demand, and a service worker that keeps the shell, fonts and segments.
Sign-in & Security
Password, Google and Telegram sign-in, two-factor by app or e-mail, per-device sessions and login throttling.
Notifications
In-app and live over WebSocket, web push through Firebase to browsers and the installed app (once set up in Admin), and Telegram messages — each user chooses per type and channel.
Messaging
Real-time direct messages with unread counts, and a setting for who may write to you: everyone, subscribers or no one.
Where every request goes
Cloudflare in front of the site and under the videos, one server for everything that needs the database, and a handful of outside services. Each request is answered as close to the viewer as it can be.
At the edge: Cloudflare
Every request to breaktv.asia meets the breaktv-edge Worker first, on the same address as the server.
The build's hashed scripts and styles, icons and theme pictures are served by Cloudflare without reaching the server; scripts are cached for a year.
A video's segments come straight from R2 once the Worker has checked the token, the browser's headers and the player's proof. It holds only the server's public key, no secret.
Past the free plan's 100,000 requests a day, or if the Worker fails, requests go straight to the server, which applies the same rules.
ott.breaktv.asia and www move every page to breaktv.asia with a 301. This page is a separate Worker with static files only, on doc.breaktv.asia.
On the server: one machine
One Linux server (AWS EC2) runs nginx and two PM2 processes, for everything that needs the database.
Takes TLS from Cloudflare, serves local media, hands out protected files once the API has checked them (X-Accel), and trusts the visitor's IP and country headers only from Cloudflare.
Express 5 on Node.js 22: the REST API, sign-in, the page shell with per-page meta tags, the WebSocket hub and the browser's live ingest — one process, so rooms and live streams stay together.
The job queue in three lanes: heavy (transcodes, imports, live recordings, storage moves), light (notification fan-out, Telegram posts, moves between buckets) and AI (cover designs).
One database file in WAL mode with FTS5 trigram search: 51 tables, and numbered migrations that run on every deploy.
Cloudflare R2
Two buckets, no egress fees. The main one serves thumbnails, previews and trailers on cdn.breaktv.asia and holds public streams; paid and private videos sit in a second bucket with no public address.
Workers AI
Cover designs over Cloudflare's REST API from the job queue: Gemma 4 writes the brief, FLUX.2 [klein] paints a 16:9 cover and a 5:7 poster. Its token can run models and nothing else.
Cloudflare Stream
The optional live engine: each channel gets an RTMPS/SRT input for OBS, viewers watch Cloudflare's HLS, and the worker copies the recording into the library.
Firebase Cloud Messaging
Web push to browsers and the installed app, in each user's language; tokens are registered again on every start. Off until a Firebase project is added in Admin → Settings → Push (FCM).
Telegram Bot API
A webhook bot, the Mini App, Log In With Telegram, channel posts and Stars top-ups.
Bakong KHQR
Top-up QR codes any Cambodian bank app can pay; the wallet is credited once the Bakong Open API confirms the exact amount.
E-mail over SMTP
Confirmations, password resets and two-step codes; written to the log until SMTP is set.
GitHub Actions
Tests and builds every change, promotes passing commits to production, deploys both Workers and checks the live site.
Security & limits
Protection at every layer, from the edge to the database.
httpOnly cookies, X-Requested-With on every write, sessions per device that can be revoked, and two-step codes by app or e-mail.
900 API requests a minute per address; 30 sign-ins per 15 minutes; 10 sign-ups, password resets or e-mail resends an hour; 60 uploads or imports an hour. Five wrong passwords lock an account for 10 minutes.
Dotfiles, internal paths and scanner probes get a 404 before they reach the server; bodies over 64 MB a 413; http goes to https.
Ed25519 tokens signed with a key the edge never sees, made out for one video, ten minutes and the viewer's country; 600 window tokens a minute at most.
Data & deploys
Data that stays small, plain and easy to back up, and deploys that viewers never notice.
WAL mode for reads during writes, FTS5 trigram search that finds words inside Khmer text (which has no spaces), and numbered migrations.
A consistent copy before every deploy's migrations, the newest 14 kept; media lives in R2, receipts and ID documents in private storage.
The new build is made beside the live one and swapped in; the last seven days of script chunks stay, so open tabs keep loading pages.
The media worker restarts only when the server's code changed, so a deploy of the site alone never interrupts a transcode.
Architecture
One Express API and one SQLite database, a separate media worker for the heavy lifting, and a Cloudflare Worker in front.
REST API surface
280+ endpoints under /api, guarded by session and role — a representative slice of each group.
Auth
Videos
Upload & Import
Streaming
Channels & Library
Social
Wallet
Ads
Platform & Admin
Everything is JSON. Browsers use an httpOnly session cookie (plus X-Requested-With on writes); the Telegram Mini App and native apps send a bearer token.
Technology
Per-module deep dives
Expand any module for how it actually works under the hood.
Video Processing & Convert Pipeline
- Upload:
POST /api/upload/initreturns an upload id and an 8 MB chunk size; the client PUTs each chunk at?offset=(nginx streams it to Node without buffering) and, after a dropped connection, resumes from the server'sreceivedcount. - Phase one — cover frames: as soon as the bytes are in,
/framescuts five frames at 10, 25, 50, 75 and 90 % for the uploader to pick a cover. FFprobe gives the duration, frame rate and display-correct size (sample aspect ratio and rotation applied), and a portrait video no longer than 60 s is flagged as a short. - Phase two — Publish:
/completequeues the heavy work in the media worker, which publishes the frames already cut. Videos over a minute get two passes: the lowest rendition alone, so the video is public and playable at once, then every remaining rendition from a single decode. H.264 (x264 preset from settings,veryfastby default) and AAC in 4-second MPEG-TS segments, with a master playlist that carriesBANDWIDTH,RESOLUTION,CODECSandFRAME-RATE. - Soundtrack: a track from the music library, or the uploader's own audio file when the admin allows it, from a chosen start point — replacing the video's sound or playing under it ("Keep the original sound"). It is mixed in during the HLS encode, cut or padded to the video's length and faded out, and its name shows on Shorts.
- Extras: an optional watermark overlay; for videos over 90 s, a 60-second trailer remuxed from the low rendition without re-encoding; an MP4 remux of the top rendition for downloads; a muted 24 fps hover preview; a storyboard sprite whose WebVTT index the API generates on the fly.
- Publish: once the first pass is ready the creator is notified, subscribers with the bell on get a push and Telegram message, and a Telegram channel post is queued. A failed job keeps its source for a retry from Admin → System.
Live Streaming
- Ingest: the broadcaster's browser records the camera or a shared screen with
MediaRecorder— WebM, or fragmented MP4 on Safari — and streams the chunks over a WebSocket to/ws/live/:id. - Packaging, on this server: the API pipes them into FFmpeg, which writes an EVENT HLS playlist in 2-second segments; viewers play it with hls.js while it grows.
- Or on Cloudflare Stream (Admin → Settings → Live streaming): each channel gets a live input through the Stream API, kept between broadcasts, so OBS, vMix or Larix keep one RTMPS or SRT server and key; the owner can reset the key. A browser broadcast is encoded to H.264/AAC at a constant 2.5 Mbps with 4-second keyframes and relayed to the input over RTMPS. A watcher asks each input's
lifecycleendpoint (the API's list of the input's videos as fallback) and flips the stream live, and back after 75 seconds without a signal. Viewers play Cloudflare's HLS. Ending switches the input off, so a stray reconnect can't record unseen. - Resilience: a network blip doesn't end the show — a reconnecting broadcaster takes over the same session and the playlist continues. Streams left open by an API restart are closed out on boot.
- Interaction: live chat and viewer counts travel over per-video WebSocket rooms, and subscribers get a "live now" notification.
- After the stream: the playlist gets
ENDLISTand is a VOD at once. With saving switched on, the worker builds the normal ABR ladder from the recording and switches playback over. On Cloudflare, thelive_recordingjob waits until Stream has the recording ready, copies it here without re-encoding (several pieces joined if the broadcast dropped), transcodes it like an upload and deletes it from Cloudflare, so Stream storage stays near empty; until then it plays from Cloudflare.
Access Control & Protected Streams
- One rule set decides every play request, in order: processing, pending approval, private, scheduled, login required, geo-blocked (from Cloudflare's
CF-IPCountry), age-restricted (18+, from the birthday on the account) and paid (a purchase, an active rental or a channel membership). - Pictures and previews come straight from the CDN (
cdn.breaktv.asiaon Cloudflare R2, or/mediaon a local-disk install): thumbnails, hover previews and trailers stay public. A video's stream never has a public address. - The stream shield (on by default): every stream, public ones included, plays from
/api/s/<video>.<encode>/<token>/<file>. The token is signed with Ed25519, names one video and encode, lasts ten minutes and is made out for the viewer's country; the player renews it before it runs out. - Each request must look like the player: a browser's
Sec-Fetch-*headers from a page of the site, no extension's origin, no downloader's name, and the player's proof for that very file (X-Play), so a request copied into a tool opens that one file and no other. - Windows, not films: a segment opens only under a token whose window holds it, twenty seconds of video from
GET /api/videos/:id/stream-token?at=. Windows are paid from an account per network address and video: a minute and a half at once, refilled at 2.5 times the playing speed (Settings → Security). The iPhone's own player gets a plain token for the length of the video, and the server answers its requests at the same pace. - At the edge: the
breaktv-edgeWorker checks all this with the server's public key (/api/s/key) and serves the files straight from R2. The server answers what the Worker can't — local files, an iPhone's player, a request past the Worker's daily limit — with the same rules, sending each segment as an R2 link signed for that one request, or from local disk through nginx's internal/_protected/location. - Two buckets: paid and private videos keep their stream in a second bucket with no public address, and a change of price or privacy moves the files over inside R2. The site's own Download button answers only a click on the video's page. What no rule stops is a program recording the player at watching speed: only DRM closes that.
- Paid videos can still show their 60-second trailer, which is stored apart from the protected stream so it never reveals where the stream lives.
Import by Link
- YouTube from a data centre: YouTube asks servers to sign in, so YouTube links go through the residential proxy set in Settings → Features. Each run gets its own sticky session, so the page and the video bytes come from one IP (YouTube ties its media URLs to it), and a blocked session is retried on up to two more. Other sites go direct, sparing the proxy allowance; errors never show the proxy password.
- Who: an operator tool — admins, moderators and the accounts an admin gives "Can import from links" in Admin → Users, on the website. Settings → Features → "Who can import videos from links" can open it to everyone who may upload.
- Preview: yt-dlp metadata is fetched and cached briefly, so submitting doesn't fetch it twice; the duplicate warning also counts public copies of the same source.
- Embed or download (Settings → Features): embeds use each provider's own player — YouTube (privacy-enhanced), Vimeo, Dailymotion, Twitch videos and clips, Facebook, TikTok, Instagram and OK.ru. Downloads take the best MP4-compatible stream up to 1080p and run it through the same transcode pipeline, where vertical clips become shorts.
- Bulk import for admins lists a whole playlist or channel; the chosen entries are submitted one by one. yt-dlp is installed into
server/bin/and updated in place from Admin → System.
Search & Discovery
- SQLite FTS5 with the trigram tokenizer over title, description and tags, ranked by bm25 with the title weighted highest. Trigrams match any part of a word, which suits Khmer text written without spaces between words.
- Queries shorter than three characters fall back to
LIKE; search suggestions come from the same index. - Result tabs for videos, channels, playlists and articles, with filters; hashtag pages and trending hashtags; categories with Khmer names; trending, latest and most-viewed lists; popular channels; stock videos; and a coverflow of featured videos on the home page.
Player
- hls.js with adaptive bitrate, and the browser's own HLS on iOS Safari; menus for quality, speed and subtitles.
- Resume from the saved position (when you stopped more than 10 s in and not in the last 15 s); progress is saved while you watch.
- Keyboard: Space/K, J/L, the arrow keys, F, M and C. Touch: tap for the controls, double-tap either side to seek 10 s.
- Storyboard thumbnails over the progress bar, picture-in-picture, autoplay next, and in-video cards with start and end times.
- Ad breaks: before the video, half-way through, at the end, and in shorts after a few seconds; embedded YouTube and Vimeo videos get the pre-roll before the embed loads. VAST wrappers are followed and their tracking pixels fired.
- Caching: the service worker keeps segments (cache first) and playlists (network first) under keys without stream tokens or S3 signatures, loads the next short ahead, and is cleared on sign-out.
Wallet, Payments & Payouts
- Two ledgers per user: the wallet (money to spend) and the balance (creator earnings that can be withdrawn or moved into the wallet). Every credit and debit is written in one database transaction together with its ledger row.
- Bakong KHQR: the site shows a dynamic KHQR for its Bakong account, laid out byte for byte like the National Bank's KHQR SDK, and the payer scans it with any Cambodian bank app. The wallet is credited only when the Bakong API confirms a payment to that account for the exact amount and currency — while the page asks, and in a background check that keeps going if the payer closes it.
- Other top-ups: bank-transfer receipts approved by an admin, and Telegram Stars invoices. No card processor is wired in.
- Spending: Pro packages, buying or renting videos (rentals last 2 days by default), paid channel memberships and ad campaigns. Sales, rentals and memberships are split between the creator and the site commission. Pro and memberships renew from the wallet once the admin turns renewal on, and each member can switch it off; a renewal can never be charged twice.
- Withdrawals: PayPal, bank or ABA (configurable), $50 minimum, held immediately and refunded on rejection.
- Rewards: points per action with daily caps, converted at 100 to $1; referrals pay a sign-up reward and a share of a referred member's first Pro purchase, first membership and first video purchase or rental.
- Admin: an earnings report, the list of online payments with a manual re-check, and a Payment gateways tab with a connection check.
Advertising
- Breaks: player ads play before the video, half-way (at 50 % by default, optionally only in longer videos), at the end, and in shorts after 10 seconds; embedded YouTube and Vimeo videos get the pre-roll before the embed loads.
- Formats: uploaded video or image creatives (video normalized to at most 720p), creatives added by link, and VAST campaigns, whose wrappers the player follows; banners in three placements — sidebar, home and below the player.
- Ad server: VAST 4.1 tags (
/api/ads/vast.xml) serve the site's ads to other players. Every served ad carries a signed reference, and impressions, clicks and completed plays come back through signed pixels, counted once per viewer, ad and day. - Money: CPV and CPC are charged to the advertiser's wallet, and the video's monetized creator earns the publisher share (50 % by default). Campaigns serve only while their daily and total budgets last, matched by category and country.
- Advertisers: accounts that follow the ads assigned to them in a portal with daily stats for any period and CSV export; admins choose who may create self-serve ads.
- Pro: ad-free by default; the admin can keep direct-sold player ads for Pro members, but never banners.
Telegram Bot & Mini App
- Setup: one button in Admin → Settings → Telegram registers the webhook (with a secret token), the English and Khmer command menus and the Mini App menu button; long polling is available for development.
- Mini App:
ready()andexpand(), swipe-to-close disabled, Telegram's back button synced to the route, colour scheme and header colours,start_paramdeep links, haptics and Stars invoices. - Sign-in: Mini App
initData, or on the website Log In With Telegram (Telegram's own OpenID Connect window, or the older login widget), signs into the bound account; a new Telegram user creates an account or binds an existing one with a password; site users link with a one-time code. - Delivery: notification fan-out is throttled to Telegram's limit of about 30 messages a second, and new public videos post to a channel with an Open button.
Notifications & Real-time
- One WebSocket hub: per-user rooms (notifications, messages, transcode progress) and per-video rooms (live chat, viewer counts).
- notify() stores the in-app notification, emits it live, then pushes through FCM and Telegram according to each user's preferences; liking, unliking and liking again doesn't spam anyone.
- Fan-out: new uploads and go-live events reach subscribers with the bell on, in batches, with one FCM multicast per batch and language.
- The media worker reaches browsers through a loopback-only event bridge into the API's hub.
SEO & Sharing
- The API renders the app shell per route with title, description, canonical, Open Graph and Twitter tags —
og:videoand player cards on watch pages — and a JSON-LDVideoObjectwith the view count. - An oEmbed endpoint with a discovery link, and an embeddable player at
/embed/:id, the only page any site may frame. sitemap.xml,rss.xml, arobots.txtthat keeps/api,/admin,/studioand/settingsout of search engines, and a web-app manifest built from the admin settings.
Security & Accounts
- Sessions: httpOnly cookies for browsers and bearer tokens for the Telegram Mini App and native apps; cookie-authenticated writes must carry
X-Requested-With, which a cross-site form can't send. Sessions are listed per device and can be revoked. - Ways in: a password, Google (the server checks Google's signed token itself) or Log In With Telegram. Each asks for the two-step code when the account has one: an authenticator app (TOTP) or an e-mailed code. One-time tokens are stored only as hashes.
- Limits: login throttling (5 attempts, then a 10-minute lock, by default), an API rate limit of 900 requests a minute per address, and a maintenance mode that keeps staff working.
- Trust: verification badges and monetization by request with an ID photo; optional e-mail verification, invite-only registration and required sign-in. Creative links are checked against private addresses on every connection and redirect.
- nginx accepts
CF-Connecting-IPandCF-IPCountryonly from Cloudflare and loopback, so visitors can't choose their own address or country.
Themes & Settings
- Two themes, switched for every visitor: Playtag (an icon rail with sliding labels, a featured slider and a violet accent) and BreakTV (always dark: the StreamVibe layout on tablets, re-framed on computers with a side menu, framed poster cards and a pill navbar; a Netflix-style layout on phones; and a glassy coverflow of featured videos at the top of the home page).
- An accent colour can override the theme's own; the site name, logo, favicon, default language and light or dark default are settings too.
- 175 settings in 15 tabs live in the database; secrets never reach the browser and are masked in the admin, and there are built-in tests for SMTP, R2, Cloudflare Stream, Workers AI, push, the Telegram bot and the Bakong connection.
Deploy & Operations
- Processes: nginx in front; PM2 runs
playtube-api(one instance, because rooms and live streams live in this process) andplaytube-worker, whose job queue runs in three lanes: heavy (transcodes, imports, live recordings, storage moves) limited byWORKER_CONCURRENCY, light (fan-out, Telegram posts, moves between buckets, mass notifications) and AI (thumbnail designs, which mostly wait on Workers AI). The technical names kept theirplaytubeprefix through the BreakTV rename. - deploy.sh installs dependencies, builds the web app beside the live copy and swaps it in (keeping a week of old chunks for open tabs), backs up and migrates the database, reloads PM2 and health-checks the API.
- Schedules in the worker: open KHQR payments checked every 15 seconds, scheduled videos announced every minute, memberships renewed or expired every 10 minutes, and temporary files cleaned every hour; a run still going is skipped, never doubled.
- Backups:
npm run backupkeeps the 14 newest consistent copies of the live database; admins can also download one from Admin → System. - Shipping: GitHub Actions tests every change and moves the
productionbranch to each passing commit of main; a systemd timer on the server deploys it within a minute, and the worker reloads only when the server's code changed, so a transcode is not cut short by a deploy of the site alone. CI then deploys thebreaktv-edgeandbreaktv-docWorkers and checks that breaktv.asia serves the new build.