远程遥控视频的显示bug修复;恢复远程遥控中的前置推送检查和动态实时信息的展示。

This commit is contained in:
2026-09-04 15:02:43 +08:00
parent db81816b78
commit b468e577a6
4 changed files with 128 additions and 16 deletions

View File

@@ -198,16 +198,20 @@ class _RemoteControlPageState extends State<RemoteControlPage> {
.targetDevice;
final deviceId = targetDevice?.deviceName;
// 🔥 从 RemoteControlCubit 获取 token(如果有的话)
// 注意:如果 token 不在 RemoteControlCubit 中,需要从其他地方获取
// 这里假设 token 是有效的,直接构建 URL
if (deviceId != null && deviceId.isNotEmpty) {
// 🔥 从 AppUserCubit 获取登录 token:SRS on_play 会校验,缺失会被拒绝拉流
final token = context.read<AppUserCubit>().state.user?.token;
if (deviceId != null &&
deviceId.isNotEmpty &&
token != null &&
token.isNotEmpty) {
_videoStreamUrl =
"webrtc://${TCPConsts.TCP_IP}/live/livestream/$deviceId";
"webrtc://${TCPConsts.TCP_IP}/live/livestream/$deviceId?token=$token";
debugPrint('🎬 [WebRTC] URL构建成功: $_videoStreamUrl');
} else {
_videoStreamUrl = '';
debugPrint('❌ [WebRTC] URL构建失败 - deviceId: $deviceId');
debugPrint(
'❌ [WebRTC] URL构建失败 - deviceId: $deviceId, hasToken: ${token != null}',
);
}
final int originY = context
.watch<RemoteControlCubit>()