Closes #979

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-11 16:18:30 +08:00
parent 2c92845af0
commit 60c25e4b65
8 changed files with 112 additions and 48 deletions

View File

@@ -507,14 +507,17 @@ class PlPlayerController {
// 获取实例 传参
static PlPlayerController getInstance({bool isLive = false}) {
// 如果实例尚未创建,则创建一个新实例
_instance ??= PlPlayerController._().._isLive = isLive;
_instance!._playerCount.value += 1;
_instance ??= PlPlayerController._();
_instance!
.._isLive = isLive
.._playerCount.value += 1;
return _instance!;
}
// 初始化资源
Future<void> setDataSource(
DataSource dataSource, {
bool isLive = false,
List<Segment>? segmentList,
List<Segment>? viewPointList,
bool? showVP,
@@ -542,6 +545,7 @@ class PlPlayerController {
VoidCallback? callback,
}) async {
try {
_isLive = isLive;
_videoType = videoType ?? VideoType.ugc;
this.width = width;
this.height = height;