opt auto fullscreen

opt video fit

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-03-04 14:22:51 +08:00
parent 8d312d8cf1
commit a802bc1cdf
7 changed files with 47 additions and 85 deletions

View File

@@ -184,7 +184,7 @@ class LiveRoomController extends GetxController {
final account = Accounts.main;
isLogin = account.isLogin;
mid = account.mid;
queryLiveUrl();
queryLiveUrl(autoFullScreenFlag: true);
queryLiveInfoH5();
if (Accounts.heartbeat.isLogin && !Pref.historyPause) {
VideoHttp.roomEntryAction(roomId: roomId);
@@ -194,7 +194,10 @@ class LiveRoomController extends GetxController {
}
}
Future<void>? playerInit({bool autoplay = true}) {
Future<void>? playerInit({
bool autoplay = true,
bool autoFullScreenFlag = false,
}) {
if (videoUrl == null) {
return null;
}
@@ -203,10 +206,11 @@ class LiveRoomController extends GetxController {
isLive: true,
autoplay: autoplay,
isVertical: isPortrait.value,
autoFullScreenFlag: autoFullScreenFlag,
);
}
Future<void> queryLiveUrl() async {
Future<void> queryLiveUrl({bool autoFullScreenFlag = false}) async {
currentQn ??= await Utils.isWiFi
? Pref.liveQuality
: Pref.liveQualityCellular;
@@ -245,7 +249,7 @@ class LiveRoomController extends GetxController {
currentQnDesc.value =
LiveQuality.fromCode(currentQn)?.desc ?? currentQn.toString();
videoUrl = VideoUtils.getLiveCdnUrl(item);
await playerInit();
await playerInit(autoFullScreenFlag: autoFullScreenFlag);
isLoaded.value = true;
} else {
_showDialog(res.toString());