mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-21 01:26:59 +08:00
fix live dm
Closes #1007 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -12,7 +12,6 @@ import 'package:PiliPlus/models_new/live/live_room_play_info/codec.dart';
|
|||||||
import 'package:PiliPlus/models_new/live/live_room_play_info/data.dart';
|
import 'package:PiliPlus/models_new/live/live_room_play_info/data.dart';
|
||||||
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
||||||
import 'package:PiliPlus/plugin/pl_player/models/data_source.dart';
|
import 'package:PiliPlus/plugin/pl_player/models/data_source.dart';
|
||||||
import 'package:PiliPlus/services/account_service.dart';
|
|
||||||
import 'package:PiliPlus/services/service_locator.dart';
|
import 'package:PiliPlus/services/service_locator.dart';
|
||||||
import 'package:PiliPlus/tcp/live.dart';
|
import 'package:PiliPlus/tcp/live.dart';
|
||||||
import 'package:PiliPlus/utils/accounts.dart';
|
import 'package:PiliPlus/utils/accounts.dart';
|
||||||
@@ -71,8 +70,8 @@ class LiveRoomController extends GetxController {
|
|||||||
final RxBool isPortrait = false.obs;
|
final RxBool isPortrait = false.obs;
|
||||||
late List<({int code, String desc})> acceptQnList = [];
|
late List<({int code, String desc})> acceptQnList = [];
|
||||||
|
|
||||||
late final isLogin = accountService.isLogin.value;
|
late final bool isLogin;
|
||||||
AccountService accountService = Get.find<AccountService>();
|
late final int mid;
|
||||||
|
|
||||||
String? videoUrl;
|
String? videoUrl;
|
||||||
bool? isPlaying;
|
bool? isPlaying;
|
||||||
@@ -81,9 +80,12 @@ class LiveRoomController extends GetxController {
|
|||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
final account = Accounts.heartbeat;
|
||||||
|
isLogin = account.isLogin;
|
||||||
|
mid = account.mid;
|
||||||
queryLiveUrl();
|
queryLiveUrl();
|
||||||
queryLiveInfoH5();
|
queryLiveInfoH5();
|
||||||
if (Accounts.heartbeat.isLogin && !Pref.historyPause) {
|
if (isLogin && !Pref.historyPause) {
|
||||||
VideoHttp.roomEntryAction(roomId: roomId);
|
VideoHttp.roomEntryAction(roomId: roomId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -299,7 +301,7 @@ class LiveRoomController extends GetxController {
|
|||||||
LiveMessageStream(
|
LiveMessageStream(
|
||||||
streamToken: info.token!,
|
streamToken: info.token!,
|
||||||
roomId: roomId,
|
roomId: roomId,
|
||||||
uid: Accounts.main.mid,
|
uid: mid,
|
||||||
servers: info.hostList!
|
servers: info.hostList!
|
||||||
.map((host) => 'wss://${host.host}:${host.wssPort}/sub')
|
.map((host) => 'wss://${host.host}:${host.wssPort}/sub')
|
||||||
.toList(),
|
.toList(),
|
||||||
@@ -328,7 +330,7 @@ class LiveRoomController extends GetxController {
|
|||||||
extra['content'],
|
extra['content'],
|
||||||
color: DmUtils.decimalToColor(extra['color']),
|
color: DmUtils.decimalToColor(extra['color']),
|
||||||
type: DmUtils.getPosition(extra['mode']),
|
type: DmUtils.getPosition(extra['mode']),
|
||||||
selfSend: isLogin && uid == accountService.mid,
|
selfSend: isLogin && uid == mid,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
if (!isFullScreen && !disableAutoScroll.value) {
|
if (!isFullScreen && !disableAutoScroll.value) {
|
||||||
@@ -364,14 +366,14 @@ class LiveRoomController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> onLike() async {
|
Future<void> onLike() async {
|
||||||
if (!Accounts.heartbeat.isLogin) {
|
if (!isLogin) {
|
||||||
likeClickTime.value = 0;
|
likeClickTime.value = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var res = await LiveHttp.liveLikeReport(
|
var res = await LiveHttp.liveLikeReport(
|
||||||
clickTime: likeClickTime.value,
|
clickTime: likeClickTime.value,
|
||||||
roomId: roomId,
|
roomId: roomId,
|
||||||
uid: accountService.mid,
|
uid: mid,
|
||||||
anchorId: roomInfoH5.value?.roomInfo?.uid,
|
anchorId: roomInfoH5.value?.roomInfo?.uid,
|
||||||
);
|
);
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
|
|||||||
Reference in New Issue
Block a user