直播
主播以视频开播;观众观看、聊天、送礼并点亮爱心。按国家、好友和关注分类的列表、嘉宾席位、直播管理员和举报。PK 与美颜滤镜为附加组件。
作者:مروان القحطاني首次发布于 2026年11月29日最近更新于 2026年12月1日
关于此功能
主播以视频开播;观众观看、聊天、送礼并点亮爱心。按国家、好友和关注分类的列表、嘉宾席位、直播管理员和举报。PK 与美颜滤镜为附加组件。
功能
- 开播:主播以标题、简介和封面图开启直播(每位主播一场)。只有当主播真正发布视频后,直播才会出现在直播列表中;直播进行中可以编辑(标题、简介、封面,以及聊天标签页的开启或关闭)。主播随时可以结束直播,总计数据会被保存。可以通过面板的封禁引擎,禁止某位用户打开直播或进入直播。
- 观看:观众进入直播,观看视频,在聊天中发言并送礼(普通礼物和幸运礼物都通过同一礼物系统送入直播)。进入时,应用会获取主播的资料(名称、头像、VIP 和 ID)、爱心总数、直播的钻石、管理员及其权限、嘉宾席位,以及其他功能添加的任何信息。直播可以对新观众关闭。
- 列表:主列表只显示当前正在直播的内容,每页 15 个(最多 30 个),按置顶、热门排序,也可以按观看最多(trend)排序,并按主播所在国家筛选。额外列表包括:正在直播的好友、您关注且正在直播的人,以及显示有直播的国家及其数量的国家列表。每张直播卡片显示标题、封面、主播、观众,以及本场和累计获得的钻石。
- 爱心:观众点击爱心,无论观众多少,所有人每秒都能看到一个实时累计的总数,并有防自动点击保护(每人每秒最多 5 次点击,每分钟最多 120 次请求)。直播结束时保存总数。每位观众在每场直播中只计算一次,主播本人不计为自己直播的观众。
- 嘉宾与管理员:直播在舞台上设有嘉宾席位(每个席位包括位置、占用者和状态),其拥有者可以指定直播管理员并设定权限,也可以修改或移除(管理员数量有上限);每项更改都会立即同步给观众。
- 举报:观众可以举报直播中的某人(不能举报自己):类型(功能问题、建议、充值或其他)、10 到 2000 字的详情以及可选的图片;每人每分钟最多 5 次。面板中有一个只读的 Live Reports 页面。封禁与此分开,通过聊天和封禁引擎进行。
- 控制面板:一个 Live Rooms 页面(管理员和国家可以管理,地区只读)、一个 Live Reports 页面、在 Third Party Settings 下用于视频引擎密钥的 Live Broadcast Settings 标签页,以及仪表盘上的直播数据(按区域统计的直播、活跃、非活跃以及当前有观众的直播)。每个页面都有各自的权限(查看、显示、编辑、删除、创建),默认授予管理员职位。
- 文件:封面接受系统能根据文件内容识别的任何图片(PNG、JPG、GIF、BMP、TIFF、WebP);举报图片也是图片。直播视频本身由 UTD Stream 引擎传输,不作为文件上传。
- 适用于所有主题:首页的直播标签页和直播页面会采用当前主题的颜色。
- 对您的价值:直播视频是把礼物转化为收入的最有力方式。主播在直播时通过礼物获得收入,观众通过爱心、聊天和嘉宾席位感受到自己是节目的一部分,而您则通过国家列表、封禁、举报和管理员页面保持控制。
依赖
基础用户以及传输视频的 UTD Stream 引擎。用于向直播送礼的礼物、用于主播时长的公会,以及用于主播资料展示的 VIP 和专属 ID 均为可选。直播不再依赖语音房:它有自己的数据表。
应用内截图
左右滑动查看更多
安装与移除
购买后,您也可以在“我的购买”中找到这些命令。
安装
php artisan feature:install live --apply移除(您的数据会保留)
用一条命令在基础版中禁用该功能(本页面有显示);请先移除其附加组件。直播列表、爱心、举报以及 Live Rooms 页面会消失,语音房继续正常运行。移除前请关闭正在进行的直播;已存储的数据会保留,并随功能一起恢复。
php artisan feature:remove live请先移除它的附加项:如果附加项仍已安装,移除该功能的操作会被拒绝。
此功能的附加项
所需功能
没有任何要求:可以单独安装。
安装与移除
这条命令会为功能准备好数据表、管理面板页面、权限、设置和基础数据。在应用中,该功能会自动出现在它应在的位置。 该功能会从应用和管理面板中消失,而您的数据会保留。重新安装后,一切都会恢复原样。
购买后,您也可以在“我的购买”中找到这些命令。
安装
php artisan feature:install live --apply移除(您的数据会保留)
用一条命令在基础版中禁用该功能(本页面有显示);请先移除其附加组件。直播列表、爱心、举报以及 Live Rooms 页面会消失,语音房继续正常运行。移除前请关闭正在进行的直播;已存储的数据会保留,并随功能一起恢复。
php artisan feature:remove live请先移除它的附加项:如果附加项仍已安装,移除该功能的操作会被拒绝。
在你自己的功能里使用这个功能
The short truth: the broadcast offers other features no port, one webhook event to listen to (LiveStreamWebhookReceived, inside the feature), three FeatureCalls and six places in the app for add-ons. Never call a class inside Modules/Live directly.
Install and remove
- Install:
php artisan feature:install live --apply(without--applyit is a dry run). It creates the broadcast migrations, the menu row and permissions, and the switch closed; open it withphp artisan feature:open live. - Remove:
php artisan feature:remove live --apply. - Requires:
base:users@1,voice_rooms@^1.5.200,pk_room@^1.
Ports (server)
None. The base does not know the broadcast. Other features ask it with FeatureCalls (below) and read the relation ownerLiveStream of a user.
Events
- What the broadcast listens to:
Modules\Live\Events\LiveStreamWebhookReceived(video track: on air / stopped) andModules\VoiceRooms\Events\UtdStreamWebhookReceived. What the add-ons listen to:LiveStreamWebhookReceivedforpk_startedandpk_ended(thepk_liveadd-on). The event is synchronous inside the webhook: a listener that throws makes the webhook answer 500 and the engine retries, so write your listener idempotent. - What the broadcast emits: the realtime room message
live_taps_total(the tap total, at most once a second). No Laravel events.
Data you may read
live_tap_totals(a total per ended broadcast),live_session_viewersandf_live__streams.live_viewers_total(the running broadcast). Read only; the broadcast writes.
Slots (app): the broadcast places for add-ons (features/live/api.dart)
| Slot | What it holds |
|---|---|
liveControlSlot | a button in the broadcast control bar (the PK button) |
liveToolSlot | a camera tool in the broadcast setup and in the "More" sheet (beauty) |
liveVideoProcessorSlot | the camera processor (fresh for each capture) |
livePkConfigSlot | the PK setup for the kit (without it the kit runs without PK) |
liveSessionEndSlot | clean-up when the room closes |
liveMessageLayerSlot | a layer over the broadcast chat (a paid message flying over the broadcast and its send-refusal listener); the add-on receives LiveMessageContext{roomId, ownerId, isHost} |
Server example: a feature that listens to the start of a broadcast
use Modules\Live\Events\LiveStreamWebhookReceived;
use Illuminate\Support\Facades\Event;
// in the provider of your feature (an add-on inside the broadcast, requires live): the event belongs to the broadcast
Event::listen(LiveStreamWebhookReceived::class, function (LiveStreamWebhookReceived $w) {
if ($w->name !== 'track_published' || $w->trackType() !== 'VIDEO') {
return;
}
// $w->roomName() and $w->participantId(); it must be idempotent (the engine retries)
});Make an add-on inside the broadcast
An add-on widens the broadcast itself (like PK and beauty). Another feature that deals with the broadcast (gifts, for example) is not an add-on; it goes through a port.
Server: a module Modules/<X>/ with feature.json, module.json, FEATURE.md, CHANGELOG.md, Providers/<X>ServiceProvider.php (registers the ports and listeners and loads the migrations), Database/Migrations (additive only) and market/listing.json. In Database/Migrations add a migration settle_the_<slug>_switch_row that puts the switch row in app_features (open on a server that has data, closed on a new install, and never touching an existing row). The shape of feature.json (from the real Modules/LiveBeauty/feature.json):
{
"contract": "2.1",
"slug": "live_beauty",
"kind": "addon",
"parent": "live",
"version": "1.0.0",
"name": {"key": "live_beauty::feature.name"},
"description": {"key": "live_beauty::feature.description"},
"app_switch": "live_beauty",
"requires": ["base:users@1", "live@^1"],
"namespace": "Modules\\LiveBeauty"
}parent is live and requires must hold live@^1. Wrap your routes in appFeatureEnable:<slug> (as live_team_pk does over pk_live). After any new file run php artisan feature:catalogue <slug> --sign.
App: lib/src/features/<slug>/ with <slug>_module.dart (a FeatureModule); in registerDependencies register into the broadcast places above, with feature: '<slug>' in each InternalSlot. Add two lines to tools/features.yaml: <slug>: {enabled: true, paths: [features/<slug>], components: [], of: live} and a line under modules: for the module class. Native packages and permissions are declared in deps.yaml and native.yaml next to the module (as in features/live_beauty).
A small real example (beauty fills three places):
@override
void registerDependencies(GetIt di) {
liveVideoProcessorSlot.register(liveBeautyProcessorEntry);
liveToolSlot.register(liveBeautyToolEntry);
liveSessionEndSlot.register(liveBeautySessionEndEntry);
}Install and remove commands: server php artisan feature:install <slug> --apply and php artisan feature:remove <slug> --apply (without --apply it is a dry run); app python tools/apply_features.py --set <slug> on|off (--check when the generated files are old, --analyze-without <slug> proves the rest analyzes without it). feature:remove live refuses while an add-on is installed.
Settings, permissions and menu
- The switch: the row
app_features.live(open it withphp artisan feature:open live) decides. The app readsfeatures.livefrom the app check. - Engine settings: the keys
live.utd_stream.*(app id, server secret, callback secret, base URL), the switch "send the identity of each user to the broadcast" and the switch "show the live voice rooms on the broadcast page" (GET live/streams/optionsanswersshow_voice_rooms, which is false by itself while the voice rooms are closed). Saved from the tab "Live Broadcast Settings" in Third Party Settings. The screenlive-engine-settingsis aPOSTonly and has no menu row (declared so infeature:contractas a warning): it has noGETpage of its own, so a menu row would be a dead link. The controller itself checks the permission to save. - Old setting:
live_status(the settings table, the card "Live Feature" in the Features page; old apps read it fromVersionController). It stays until the old apps are gone; do not build on it. - Limits:
POST live/streams/tapshasthrottle:120,1and theActionAbuseGuardprotection (5 taps a second);POST live/reportshasthrottle:live-report. - Permissions (
panel_permissions, legacy, category Room):browse-live-roomsandshow-live-rooms(admin, country, region),edit-live-roomsanddelete-live-rooms(admin),create-live-rooms(country); andlive.browse-reportsfor the reports page. - Menu: the row "Live Rooms" (
uri: live-rooms, permissionbrowse-rooms) inside the section "Live Broadcast", and the row for the reports page. Three screens onlive-rooms: admin and country (without create/store) and region (read-only).
The broadcast table f_live__streams
A broadcast has its own table. The columns carry the meaning they had in rooms: id (the same id as the old room, because the engine knows the broadcast by it; a new id starts a million above any room), owner_id (was rooms.uid), numid, title (was room_name), cover (was room_cover), intro, status (1 open ... 4), is_live, is_broadcasting (the host is publishing video), live_viewers_total (unique viewers of the running broadcast), pin, is_top, hot and hour_hot (the order of the list), is_comment_closed, created_at, updated_at. The model is Modules\Live\Models\LiveStream (owner() is the host). Copy the data with php artisan live:copy-streams (dry run by default, --apply, --undo); it never touches rooms.
Before publishing (moving broadcasts to their table)
- Empty the queue before
live:copy-streams: gift and lucky jobs queued before the move carry the kindroom(the default). If the target was an old broadcast (aroomsrow of typelive), they would writesessionand the leaderboard and level rows on the oldroomsrow instead of the new broadcast. No coins or diamonds move (only counters are lost), but the queue must be empty before--apply. New jobs carryroom_kindfrom the request (target = stream). - The request from the app: a gift (normal or lucky) to a broadcast must carry
target = streamandroom_id = stream_id; without the field it goes to the room that has the same number.
UserPayload keys
App\Support\UserPayload keys this feature registers or answers (the base does not know feature names; the explanation is here). The one that asks writes the default.
- Extras place
live.stream.extras: the keys other features add to the answer of entering a broadcast (ctx['viewer']is the viewer).
FeatureCalls it answers
Small questions others ask with FeatureCalls::call (the name, who asks, what the answer is; the asker holds the default when the feature is not installed):
live.stream_of(live team PK: the running broadcast a user owns,{id, uid}, null when none or without the live feature)live.streams(live team PK: which of some stream ids run a broadcast now, stream id => owner id;[]without the live feature)live.send_command(one custom command to the engine room of a broadcast; the team PK add-on tells the people in a stream about its task)
更新内容
1.0.112发布于 2026年12月1日作者:مروان القحطاني
- 1.0.112: A new switch in the broadcast panel, "Show the voice rooms on the broadcast page" (Settings > Third Party > the broadcast tab > Live page), off by default; when on, the app lists the open voice rooms beside the streams on a card like a stream card, and a tap opens the room. The voice rooms page itself is unchanged.
1.0.111发布于 2026年12月1日作者:مروان القحطاني
- 1.0.111: PK start and end events now reach the customer's server: the add-on hears them from the single webhook address, so a battle is recorded and closed in the PK battles table. Before this the PK add-on never heard these events. 1.0.110: test improvements only.
1.0.110发布于 2026年12月1日作者:مروان القحطاني
- 1.0.110 and 1.0.109: Kick and ban review in the broadcast: the host ban is recorded before the engine is asked and restored if the engine refuses; lifting the host ban never frees the user for a moment while another ban holds him; one lock per (stream, user); the rest is tests.
1.0.107发布于 2026年11月29日作者:مروان القحطاني
- Release 1.0.107 (signed build 5397f37)
