mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-23 03:50:56 +08:00
优化直播测试的streamName解析
This commit is contained in:
parent
241d802fe1
commit
0dec52806b
@ -99,11 +99,15 @@ class ChapterLive extends Model
|
|||||||
|
|
||||||
public static function generateStreamName($id)
|
public static function generateStreamName($id)
|
||||||
{
|
{
|
||||||
|
if ($id == 'test') return $id;
|
||||||
|
|
||||||
return sprintf('chapter-%03d', $id);
|
return sprintf('chapter-%03d', $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function parseFromStreamName($streamName)
|
public static function parseFromStreamName($streamName)
|
||||||
{
|
{
|
||||||
|
if ($streamName == 'test') return $streamName;
|
||||||
|
|
||||||
return (int)str_replace('chapter-', '', $streamName);
|
return (int)str_replace('chapter-', '', $streamName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user