ComusThumbz 文档
管理员登录

现场视频串流设置

本页的内容

这个指南帮助您在您的 ComusThumbz 网站设置了视频流直播功能 。 一旦配置完毕,你的创作者可以从他们的浏览器直接向粉丝播放直播视频,同时进行实时聊天,小费,以及私人节目. 想想这就像设置你自己的个人Twitch或OnlyFans的直播流媒体平台.

[Screenshot:现场-流版-综艺].


为什么你需要这个

实时流线功能允许您网站的创建者:

  • 从他们的浏览器直接直播(不需要特殊软件)
  • 低延迟的流视频( 1 秒以下)
  • 实时与观众聊天
  • 在流中接收提示
  • 提供一对一的私人节目
  • 控制谁可以观看(免费,仅订阅者,付费浏览等)

对于观众来说,他们可以:

  • 观看创作者直播
  • 聊天中发送消息
  • 向创建者发送提示
  • 请求私人显示


在你开始之前

警告:
直播流线需要专用服务器或VPS(Virtual Private Server). 它不会像GoDaddy或Bluehost的基本计划那样在共享托管上发挥作用. 您需要 root 访问才能在服务器上安装软件 。

你会需要什么

  1. 单独的服务器或 VPS 这可以是安装ComusThumbz的同一服务器,也可以是另一个服务器. 最低2GB内存,2个CPU核心推荐.
  2. 一个域或子域 - 有点像 streaming.yoursite.com
  3. 大约30-60分钟 - 设置过程
  4. 基本舒适与命令行 - 您需要运行一些命令在您的服务器上

检查是否准备好了

通过 SSH 登录到服务器并运行这些命令 :

# Check if Docker is installed
docker --version

检查您的服务器的公开 IP


curl -s ifconfig.me

如果Docker没有安装,不用担心 - 设置脚本可以为你安装.


理解设置

如何生活流线工作

Creator's Browser -> Streaming Server -> Viewers' Browsers
  1. 创建者打开您网站上的“ 活起来” 页面
  2. 他们的网络摄像头和麦克风连接到你的流媒体服务器
  3. 流媒体服务器向所有观看者发送视频
  4. 每个人都可以实时聊天和发送提示

安装什么

设置进程安装 活键,这是流媒体服务器软件。 它运行在你的服务器上的Docker容器里(把它当成自成一体的微型计算机),并处理所有视频的路由.


安装步骤

步骤1:选择您的安装方法

设置流线服务器有两种方法:

备选案文A:自动设置(建议) - 剧本为你做一切
选项B:手工设置 - 您自己运行每个命令( 为高级用户)

我们为大多数人推荐选择A。


备选案文A:自动化设置(最容易)

1. 上传设置脚本

  1. 从您的 ComusThumbz 安装文件夹下载设置脚本 : tools/setuplivekitserver.sh
  2. 上传到您的流媒体服务器( 您可以把它放入您的家目录)

2. 使脚本可执行

通过 SSH 登录到您的服务器并运行 :

chmod +x setuplivekitserver.sh

3. 运行设置脚本

sudo ./setuplivekitserver.sh

剧本会问你几个问题 然后:

  • 需要时安装嵌入器
  • 配置防火墙
  • 设置串流服务器
  • 生成安全密钥

4. 保存您的全权证书

最后,剧本会告诉你一些类似的东西:

API Credentials:
  API Key: APIxxxxxxxxxxxxxxxx
  API Secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

警告:
复制这些证书 并保存在安全的地方! 下一节你需要它们

5. 测试安装

剧本会告诉你是否一切正常 你应该看到一个信息说 "LiveKit正在成功运行。"


备选案文B:手动设置(高级)

如果您喜欢手动进行设置,或者自动脚本对您的服务器无效,请遵循技术指南中详细的手动安装步骤.

提示 :
手动步骤基本上与自动化脚本一样,只是细分为单个命令. 只有在你对服务器管理很满意时才使用它.


连接 ComusThumbz 到流服务器

现在您的流线服务器正在运行, 你需要告诉您的 ComusThumbz 安装如何连接到它 。

步骤1:启用特性

  1. 登录到您的管理面板
  2. 转到 行政小组 > 设置 > 特性切换
  3. 查找 生活流转 打开它
  4. 单击 保存更改

步骤2: 添加您的流动服务器细节

您需要在配置文件中添加三条信息 。

  1. 通过 SFTP 或文件管理器登录到您的网络服务器
  2. 导航到 ct/dat/config.inc.php
  3. 打开文件进行编辑
  4. 在文件末尾添加这些行( 在关闭前) ?> 如果有一个:
// LiveKit WebRTC Streaming Configuration
define('LIVEKITHOST', 'wss://streaming.yoursite.com/livekit/');
define('LIVEKITAPIKEY', 'paste-your-api-key-here');
define('LIVEKITAPISECRET', 'paste-your-api-secret-here');
  1. 替换数值:
  • streaming.yoursite.com - 您的流媒体服务器域
  • paste-your-api-key-here - 安装第四步的API密钥
  • paste-your-api-secret-here - 安装第四步的API秘密
  1. 保存文件

提示 :
对于 拉脱维亚
热门编辑 wss:// 如果你的网站上有SSL/HTTPS的话。 如果你只是测试一个本地网络, 你可以使用 ws:// 然后是您的服务器的 IP 地址和 :7880。 。 。 。

步骤3:验证 有用吗?

  1. 登录到您的网站, 作为拥有创建访问权限的用户
  2. 转到 我的账户 > 继续生活 (在用户设置中)
  3. 您应该看到“ Go Live” 网页, 并带有网络摄像头选项
  4. 如果您看到错误消息, 某些东西配置不当

测试您的设置

完成串流测试

遵循这些步骤核实一切行之有效:

1. 编制创建账户

您需要一个拥有创建权限的账户来测试 。

  1. 转到 行政小组 > 用户 > 用户管理
  2. 找到您要测试的用户
  3. 单击 编辑
  4. 确保 是创建者 设置为
  5. 保存

2. 开始试验流

  1. 登录为创建者
  2. 转到 我的账户 > 继续生活
  3. 填入流标题( 如“ 测试流 ” )
  4. 设定访问 免费 (所以任何人都可以观看)
  5. 单击 开始串流
  6. 当浏览器请求相机/麦克风许可时,单击 允许
  7. 您应该在屏幕上查看您的网络相机预览

3. 视流为查看器

  1. 打开不同的浏览器( 或不可识别/ 私人窗口)
  2. 访问您的网站并去 生活流线 主菜单中
  3. 你应该看看你的测试流
  4. 点击它观看
  5. 视频应该在1-2秒内出现

4. 试验聊天

  1. 在查看器窗口中,在聊天框中键入信件并按 Enter
  2. 消息应该同时出现在收视器和播音器窗口中
  3. 这证明实时通信是有效的

5. 结束 " 流 "

  1. 回到广播窗口,单击 结束流
  2. 溪流应该从 Live Streams 页面上消失
  3. 观众应该看到一条消息 溪流已经结束

成功 :
如果所有五个步骤都奏效,恭喜! 你的现场直播已经启动


创建者和查看者到哪里去

创作者(广播员)

Go Live 页面 : 设置 > 继续生活

在本页上,创作者可以:

  • 选择他们的相机和麦克风
  • 为他们的流设置标题和描述
  • 选择谁可以观看( 免费、 密码保护、 仅订阅者、 付费浏览或提示目标)
  • 看他们的观众数
  • 读取并回复聊天信息
  • 参见提示通知
  • 接受或拒绝私人显示请求

对于查看器

流目录 : 活流(主要导航)

本页显示:

  • 所有活动流作为预览卡的网格
  • 观看每条溪流的观众人数
  • 创建者配置图和名称

监视流页面 : 点击任意流打开查看器页面

在本页上,观众可以:

  • 看现场录像
  • 与创建者和其他观众聊天
  • 发送提示
  • 请求私人表演( 如果他们有足够的标志)


共同任务

重新启动串流服务器

如果您的流不工作, 有时只需要重新启动服务器 :

# Log into your streaming server via SSH
docker restart livekit

10秒后再试一次

检查串流服务器是否运行

# Log into your streaming server via SSH
docker ps | grep livekit

如果看到里面有一条"livekit"的行,服务器正在运行. 如果你什么都看不见,就开始吧:

cd /opt/livekit
docker compose up -d

查看服务器日志

如果事情不起作用 你需要看看发生了什么

# Show the last 50 lines of the log
docker logs --tail 50 livekit

实时查看日志( 按 Ctrl+ C 键停止)


docker logs -f livekit

更新流服务器

每几个月,您可能想要更新最新版本:

# Pull the latest version
docker pull livekit/livekit-server:latest

重新开始新版本


docker compose down
docker compose up -d

解决问题

流不会开始

你所见: 创建者点击"Start Streaming",但无事发生或出现错误.

如何修补:

  1. 检查该特性是否启用于 行政小组 > 设置 > 特性切换
  2. 验证创建者账户 是创建者 设置为是
  3. 检查你的 config.inc.php 文件有三种 LIVEKIT 设置
  4. 验证正在运行的流服务器 : docker ps | grep livekit

无法连接查看器

你所见: Live Streams 页面加载, 但点击一个流显示错误或黑屏幕 。

如何修补:

  1. 确定您的防火墙允许在这些端口的流量 :
  • TCP: 7880, 7881 (韩语).
  • UDP: 50 000-60 000
  1. 检查你的LIVEKITHOST 用途 wss:// (无) ws://如果您的网站使用 HTTPS
  2. 使用 HTTPS 验证您的 SSL 证书是有效的

聊天工作但视频是黑色的

你所见: 观看者可以发送聊天信息,但视频从未出现.

如何修补:

这通常意味着UDP端口被封锁. 在您的流线服务器上 :

# Open the UDP port range
sudo ufw allow 50000:60000/udp

然后重新启动流式服务器并再次尝试.

“ 你已经有活动流”错误

你所见: 创造者试图去直播 但有一个错误 说他们已经有溪流。

如何修补:

如果前一条流没有正常结束(浏览器崩溃等),这种情况就会发生. 你可以手动结束它:

  1. 转到 行政小组 > 生活流线 (如果你有这个页面)
  2. 找到卡住的流并单击 结束流

或请开发者运行此 SQL 命令 :

UPDATE tblLiveStreams
SET status = 'ended', endedat = NOW()
WHERE creatorid = [USERID] AND status IN ('waiting', 'live');

替换 [USERID] 与创建者的用户编号。

流预览不显示

你所见: Live Streams 目录页面显示流但无预览图像.

如何修补:

  1. Check that the uploads/streamsnapshots/ folder exists
  2. Make sure the folder is writable (permission 755 or 777)
  3. Wait a few seconds - previews are captured every 30 seconds during a live stream

Tips for New Users

 

Tip:
  • Start with free streams - Get comfortable with the technology before setting up paid streams
  • Test with friends - Have a few people watch your first stream to verify everything works
  • Check your internet speed - Creators need at least 5 Mbps upload speed for good quality streaming
  • Use a wired connection - WiFi can be unreliable for streaming; ethernet cables work better
  • Close other apps - Streaming uses a lot of computer resources; close unnecessary programs
  • Have good lighting - Viewers can't tip if they can't see you clearly

 


Access Control Options Explained

When creators start a stream, they choose who can watch:

Access Type What It Means When to Use It
Free Anyone can watch, no payment required Building an audience, special events, or casual streams
Password Protected Viewers need a password to watch Private streams for a specific group, like fan club members
Subscribers Only Only users with an active subscription can watch Exclusive content for paying subscribers
Pay-Per-View Viewers pay tokens once to unlock the stream Special events or premium content
Tip Goal Stream unlocks when tip goal is reached Interactive fundraising or community challenges

Creators can change these settings for each stream.


Understanding Private Shows

Private shows are one-on-one streams between a creator and a single viewer. Here's how they work:

  1. A viewer watches a public stream
  2. They click Request Private Show
  3. They set how many minutes they want
  4. The request appears to the creator
  5. If the creator accepts:
  • The public stream ends
  • A new private stream starts
  • Only the requesting viewer can watch
  • Tokens are deducted per minute automatically
  1. When time runs out (or someone ends it), the private show ends

Creators set their per-minute rate in their creator profile settings.


Security and Privacy

What's Protected

  • All video streams are encrypted in transit
  • Tokens (payment for access) are generated by the server, not the browser
  • Viewers can only join rooms they have permission for
  • Chat messages are stored in your database

What to Watch For

  • Require SSL/HTTPS - Always use wss:// in your LIVEKIT_HOST setting for production sites
  • Monitor reported streams - Have a moderation system for inappropriate content
  • Set up rate limiting - Prevent chat spam by limiting how fast users can send messages
  • Review your firewall - Only open the ports mentioned in this guide

Page When to Use It
Feature Toggles Turn live streaming on or off site-wide
Creator Management Approve creators who can go live
User Management Set who has creator privileges
Token Settings Configure token pricing for pay-per-view and private shows

Getting Help

If you're stuck:

  1. Check the logs - Run docker logs livekit to see what the streaming server is reporting
  2. Test the connection - Make sure you can reach your streaming server from a browser
  3. Verify your config - Double-check the three LIVEKIT settings in config.inc.php
  4. Check the forum - Other users may have solved the same issue
  5. Contact support - Provide the output of docker ps and docker logs --tail 50 livekit

What's Next?

Once your live streaming is set up:

  1. Promote the feature - Let your creators know they can now go live
  2. Create a guide for creators - Write simple instructions for your specific audience
  3. Set token prices - Decide pricing for pay-per-view and private shows
  4. Monitor usage - Watch server resources to see if you need to upgrade
  5. Gather feedback - Ask creators and viewers what they like or what needs improvement

 

Success:
Live streaming can significantly increase engagement and revenue on your site. Take time to promote it to your creators and viewers!