Compare commits

..

No commits in common. "bb41882757b9852c2926b2904d3bbdeb75fb0a63" and "c5b55d86608e11cbc7ec7bb34c801e67f18474ca" have entirely different histories.

33 changed files with 1122 additions and 891 deletions

3
.idea/.gitignore vendored
View File

@ -1,3 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/wgshare/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/wgshare/.pub" />
<excludeFolder url="file://$MODULE_DIR$/wgshare/build" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/WGShare.Mobile.Flutter.iml" filepath="$PROJECT_DIR$/.idea/WGShare.Mobile.Flutter.iml" />
</modules>
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -39,6 +39,65 @@ end
post_install do |installer| post_install do |installer|
installer.pods_project.targets.each do |target| installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target) # Here are some configurations automatically generated by flutter
# Start of the permission_handler configuration
target.build_configurations.each do |config|
# You can enable the permissions needed here. For example to enable camera
# permission, just remove the `#` character in front so it looks like this:
#
# ## dart: PermissionGroup.camera
# 'PERMISSION_CAMERA=1'
#
# Preprocessor definitions can be found in: https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
## dart: PermissionGroup.calendar
# 'PERMISSION_EVENTS=1',
## dart: PermissionGroup.reminders
# 'PERMISSION_REMINDERS=1',
## dart: PermissionGroup.contacts
# 'PERMISSION_CONTACTS=1',
## dart: PermissionGroup.camera
'PERMISSION_CAMERA=1',
## dart: PermissionGroup.microphone
'PERMISSION_MICROPHONE=1',
## dart: PermissionGroup.speech
# 'PERMISSION_SPEECH_RECOGNIZER=1',
## dart: PermissionGroup.photos
# 'PERMISSION_PHOTOS=1',
## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
# 'PERMISSION_LOCATION=1',
## dart: PermissionGroup.notification
# 'PERMISSION_NOTIFICATIONS=1',
## dart: PermissionGroup.mediaLibrary
# 'PERMISSION_MEDIA_LIBRARY=1',
## dart: PermissionGroup.sensors
# 'PERMISSION_SENSORS=1',
## dart: PermissionGroup.bluetooth
# 'PERMISSION_BLUETOOTH=1',
## dart: PermissionGroup.appTrackingTransparency
# 'PERMISSION_APP_TRACKING_TRANSPARENCY=1',
## dart: PermissionGroup.criticalAlerts
# 'PERMISSION_CRITICAL_ALERTS=1'
]
end
# End of the permission_handler configuration
end end
end end

View File

@ -1,120 +1,121 @@
{ {
"images": [ "images" : [
{ {
"size": "20x20", "filename" : "40.png",
"idiom": "universal", "idiom" : "iphone",
"filename": "icon-20@2x.png", "scale" : "2x",
"scale": "2x", "size" : "20x20"
"platform": "ios" },
}, {
{ "filename" : "60.png",
"size": "20x20", "idiom" : "iphone",
"idiom": "universal", "scale" : "3x",
"filename": "icon-20@3x.png", "size" : "20x20"
"scale": "3x", },
"platform": "ios" {
}, "filename" : "29.png",
{ "idiom" : "iphone",
"size": "29x29", "scale" : "1x",
"idiom": "universal", "size" : "29x29"
"filename": "icon-29@2x.png", },
"scale": "2x", {
"platform": "ios" "filename" : "58.png",
}, "idiom" : "iphone",
{ "scale" : "2x",
"size": "29x29", "size" : "29x29"
"idiom": "universal", },
"filename": "icon-29@3x.png", {
"scale": "3x", "filename" : "87.png",
"platform": "ios" "idiom" : "iphone",
}, "scale" : "3x",
{ "size" : "29x29"
"size": "38x38", },
"idiom": "universal", {
"filename": "icon-38@2x.png", "filename" : "80.png",
"scale": "2x", "idiom" : "iphone",
"platform": "ios" "scale" : "2x",
}, "size" : "40x40"
{ },
"size": "38x38", {
"idiom": "universal", "filename" : "120.png",
"filename": "icon-38@3x.png", "idiom" : "iphone",
"scale": "3x", "scale" : "3x",
"platform": "ios" "size" : "40x40"
}, },
{ {
"size": "40x40", "filename" : "120 1.png",
"idiom": "universal", "idiom" : "iphone",
"filename": "icon-40@2x.png", "scale" : "2x",
"scale": "2x", "size" : "60x60"
"platform": "ios" },
}, {
{ "filename" : "180.png",
"size": "40x40", "idiom" : "iphone",
"idiom": "universal", "scale" : "3x",
"filename": "icon-40@3x.png", "size" : "60x60"
"scale": "3x", },
"platform": "ios" {
}, "filename" : "20.png",
{ "idiom" : "ipad",
"size": "60x60", "scale" : "1x",
"idiom": "universal", "size" : "20x20"
"filename": "icon-60@2x.png", },
"scale": "2x", {
"platform": "ios" "filename" : "40 1.png",
}, "idiom" : "ipad",
{ "scale" : "2x",
"size": "60x60", "size" : "20x20"
"idiom": "universal", },
"filename": "icon-60@3x.png", {
"scale": "3x", "filename" : "29 1.png",
"platform": "ios" "idiom" : "ipad",
}, "scale" : "1x",
{ "size" : "29x29"
"size": "64x64", },
"idiom": "universal", {
"filename": "icon-64@2x.png", "filename" : "58 1.png",
"scale": "2x", "idiom" : "ipad",
"platform": "ios" "scale" : "2x",
}, "size" : "29x29"
{ },
"size": "64x64", {
"idiom": "universal", "filename" : "40 2.png",
"filename": "icon-64@3x.png", "idiom" : "ipad",
"scale": "3x", "scale" : "1x",
"platform": "ios" "size" : "40x40"
}, },
{ {
"size": "68x68", "idiom" : "ipad",
"idiom": "universal", "scale" : "2x",
"filename": "icon-68@2x.png", "size" : "40x40"
"scale": "2x", },
"platform": "ios" {
}, "filename" : "76.png",
{ "idiom" : "ipad",
"size": "76x76", "scale" : "1x",
"idiom": "universal", "size" : "76x76"
"filename": "icon-76@2x.png", },
"scale": "2x", {
"platform": "ios" "filename" : "152.png",
}, "idiom" : "ipad",
{ "scale" : "2x",
"size": "83.5x83.5", "size" : "76x76"
"idiom": "universal", },
"filename": "icon-83.5@2x.png", {
"scale": "2x", "filename" : "167.png",
"platform": "ios" "idiom" : "ipad",
}, "scale" : "2x",
{ "size" : "83.5x83.5"
"size": "1024x1024", },
"idiom": "universal", {
"filename": "icon-1024.png", "filename" : "1024.png",
"scale": "1x", "idiom" : "ios-marketing",
"platform": "ios" "scale" : "1x",
} "size" : "1024x1024"
],
"info": {
"version": 1,
"author": "icon.wuruihong.com"
} }
],
"info" : {
"author" : "xcode",
"version" : 1
}
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -8,6 +8,10 @@
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>智汇享</string> <string>智汇享</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict/>
</array>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
@ -37,7 +41,7 @@
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
<string>Main</string> <string>Main</string>
<key>UIRequiresFullScreen</key> <key>UIRequiresFullScreen</key>
<true/> <false/>
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>

View File

@ -2,9 +2,9 @@ import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'agreement_read_logic.dart'; import 'agreement_read_logic.dart';
import 'agreement_read_state.dart'; import 'agreement_read_state.dart';
@ -23,6 +23,7 @@ class AgreementReadPageState extends State<AgreementReadPage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
if (Platform.isAndroid) WebView.platform = AndroidWebView();
} }
@override @override
@ -80,15 +81,12 @@ class AgreementReadPageState extends State<AgreementReadPage> {
), ),
/// ///
Expanded( const Expanded(
child: InAppWebView( child: WebView(
initialUrlRequest: initialUrl:
URLRequest(url: WebUri("https://static.23544.com/WGShare-PrivacyPolicy.html")), 'https://static.23544.com/WGShare-PrivacyPolicy.html',
initialSettings: InAppWebViewSettings( ),
transparentBackground: true, ),
safeBrowsingEnabled: true,
isFraudulentWebsiteWarningEnabled: true),
)),
], ],
)); ));
} }

View File

@ -17,7 +17,7 @@ import '../../utils/permission/PermissionService.dart';
import '../../utils/toast_utils.dart'; import '../../utils/toast_utils.dart';
import 'meeting_main_state.dart'; import 'meeting_main_state.dart';
class MeetingMainLogic extends GetxController with RequestToolMixin { class MeetingMainLogic extends GetxController with RequestToolMixin{
final MeetingMainState state = MeetingMainState(); final MeetingMainState state = MeetingMainState();
@override @override
@ -45,11 +45,10 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
/// Token /// Token
Future<void> doHttpGetMeetingToken(bool isInit) async { Future<void> doHttpGetMeetingToken(bool isInit) async {
BaseStructureResult<String> res = BaseStructureResult<String> res = await getClient().getMeetingToken(state.roomNumber.value);
await getClient().getMeetingToken(state.roomNumber.value);
state.meetingToken.value = res.data!; state.meetingToken.value = res.data!;
if (isInit == true) { if(isInit == true){
initRtc(); initRtc();
signalRSocket(); signalRSocket();
} }
@ -59,33 +58,32 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
/// 1. /// 1.
/// 2. /// 2.
Future<void> mergeFetch() async { Future<void> mergeFetch() async {
try { try{
ToastUtils.showLoading(); ToastUtils.showLoading();
var results = await Future.wait([ var results = await Future.wait([
getClient().getMeetingRoomInfo(state.roomNumber.value), getClient().getMeetingRoomInfo(state.roomNumber.value),
getClient().getMeetingRoomAllUser(state.roomNumber.value) getClient().getMeetingRoomAllUser(state.roomNumber.value)]);
]);
getMeetingRoomInfo(results[0].data as MeetingRoomInfo); getMeetingRoomInfo(results[0].data as MeetingRoomInfo);
getMeetingRoomAllUser(results[1].data as List<MeetingRoomUser>); getMeetingRoomAllUser(results[1].data as List<MeetingRoomUser>);
} finally { }finally{
ToastUtils.dismiss(); ToastUtils.dismiss();
} }
} }
/// ///
void changeMeetingInfoState(bool isShow) { void changeMeetingInfoState(bool isShow){
state.isShowMeetingInfoFloatingLayer.value = isShow; state.isShowMeetingInfoFloatingLayer.value = isShow;
} }
/// ///
void changeMeetingAudioState(bool isShow) { void changeMeetingAudioState(bool isShow){
state.isShowMeetingAudioFloatingLayer.value = isShow; state.isShowMeetingAudioFloatingLayer.value = isShow;
} }
/// ///
void changePageState(int pageState) { void changePageState(int pageState){
state.pageState.value = pageState; state.pageState.value = pageState;
} }
@ -103,17 +101,16 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
} }
/// ///
void startTime() { void startTime(){
state.stopwatch.value.start(); state.stopwatch.value.start();
state.timer.value = state.timer.value = Timer.periodic(const Duration(milliseconds: 100), upTime);
Timer.periodic(const Duration(milliseconds: 100), upTime);
} }
/// ///
void upTime(Timer t) { void upTime(Timer t) {
if (state.stopwatch.value.isRunning) { if(state.stopwatch.value.isRunning){
state.duration.value = state.duration.value =
"${state.stopwatch.value.elapsed.inHours.toString().padLeft(2, "0")}" "${state.stopwatch.value.elapsed.inHours.toString().padLeft(2, "0")}"
":${(state.stopwatch.value.elapsed.inMinutes % 60).toString().padLeft(2, "0")}" ":${(state.stopwatch.value.elapsed.inMinutes % 60).toString().padLeft(2, "0")}"
":${(state.stopwatch.value.elapsed.inSeconds % 60).toString().padLeft(2, "0")}"; ":${(state.stopwatch.value.elapsed.inSeconds % 60).toString().padLeft(2, "0")}";
} }
@ -126,16 +123,16 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
} }
/// ///
void searchMember(String value) { void searchMember(String value){
if (value.isNotEmpty) { if(value.isNotEmpty){
List<MeetingRoomUser> memberSearchList = []; List<MeetingRoomUser> memberSearchList = [];
for (var i = 0; i < state.cacheUsers.value.length; i++) { for(var i = 0; i < state.cacheUsers.value.length; i++){
if (state.cacheUsers.value[i].userName.contains(value)) { if(state.cacheUsers.value[i].userName.contains(value)){
memberSearchList.add(state.cacheUsers.value[i]); memberSearchList.add(state.cacheUsers.value[i]);
} }
} }
state.users.value = memberSearchList; state.users.value = memberSearchList;
} else { }else{
state.users.value = state.cacheUsers.value; state.users.value = state.cacheUsers.value;
} }
} }
@ -148,106 +145,128 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
/// ///
Future<void> doHttpCancelSpeak() async { Future<void> doHttpCancelSpeak() async {
await getClient().cancelSpeak( await getClient().cancelSpeak(state.meetingRoomInfo.value!.id, state.meetingRoomInfo.value!.roomNum, UserStore.to.userInfoEntity.value!.uid);
state.meetingRoomInfo.value!.id,
state.meetingRoomInfo.value!.roomNum,
UserStore.to.userInfoEntity.value!.uid);
}
///
Future<void> cancelSpeak() async {
try {
ToastUtils.showLoading();
await Future.wait(
[doHttpCancelSpeak(), doHttpSetMicr(false), doHttpSetCamer(false)]);
} finally {
ToastUtils.dismiss();
}
} }
/// ------------------------------------------------------------------------------ /// ------------------------------------------------------------------------------
/// ///
Future<void> doHttpSetMicr(bool isOpenMicrophone) async { Future<void> doHttpSetMicr(bool isOpenMicrophone) async {
await getClient().setMicr(state.roomNumber.value, isOpenMicrophone, await getClient().setMicr(state.roomNumber.value, isOpenMicrophone, UserStore.to.userInfoEntity.value!.uid);
UserStore.to.userInfoEntity.value!.uid);
} }
/// ------------------------------------------------------------------------------- /// -------------------------------------------------------------------------------
/// ///
Future<void> doHttpSetCamer(bool isOpenCamera) async { Future<void> doHttpSetCamer(bool isOpenCamera) async {
await getClient().setCamera(state.roomNumber.value, isOpenCamera, await getClient().setCamera(state.roomNumber.value, isOpenCamera, UserStore.to.userInfoEntity.value!.uid);
UserStore.to.userInfoEntity.value!.uid);
} }
/// ///
void setCameraOpen(bool isOpen) { void setCameraOpen(bool isOpen){
state.isOpenCamera.value = isOpen; state.isOpenCamera.value = isOpen;
} }
/// ///
Future<void> doHttpGetTvAnchor() async { Future<void> doHttpGetTvAnchor() async {
BaseStructureResult res = BaseStructureResult res = await getClient().getTvAnchor(state.roomNumber.value);
await getClient().getTvAnchor(state.roomNumber.value);
state.remoteUid.value = res.data!.toString(); state.remoteUid.value = res.data!.toString();
debugPrint("wgs输出===:获取当前全员观看主播${res.data}");
if (res.data!.toString().length != 9) { if(res.data!.toString().length != 9){
// //
if (state.remoteUid.value == UserStore.to.userInfoEntity.value!.uid) { //
// if(state.remoteUid.value == UserStore.to.userInfoEntity.value!.uid) {
// ID为0 state.isSelf.value = true;
state.remoteUid.value = "0"; }else{
// state.isSelf.value = false;
state.floating.value?.close(); }
if (state.isSpeak.value == true && state.isOpenCamera.value == true) { if(state.isSelf.value == true){
// //
if(state.isOpenCamera.value == true){
//
changePageState(1); changePageState(1);
} else { state.floating.value?.close();
// }else{
//
changePageState(0); changePageState(0);
} }
} else { }else{
// //
//
var isCurrentUserIsCamera = false; var isCurrentUserIsCamera = false;
for (var i = 0; i < state.cacheUsers.value.length; i++) { //
if (state.remoteUid.value == state.cacheUsers.value[i].uid && for(var i = 0; i < state.cacheUsers.value.length; i++){
state.cacheUsers.value[i].enableCamera == true) { if(state.remoteUid.value == state.cacheUsers.value[i].uid && state.cacheUsers.value[i].enableCamera == true){
isCurrentUserIsCamera = true; isCurrentUserIsCamera = true;
} }
} }
if(isCurrentUserIsCamera == true){
if (isCurrentUserIsCamera == true) {
//
debugPrint("wgs输出===:当前会议室存在全员观看主播时,切换页面到视频状态");
changePageState(1);
} else {
// ID为空并切换页面到视频状态
debugPrint("wgs输出===当前会议室不存在全员观看主播时设置主播ID为空并切换页面到视频状态");
state.remoteUid.value = "";
changePageState(1); changePageState(1);
}else{
changePageState(0);
} }
} }
} else { }else{
// //
/*if(state.remoteUid.value == UserStore.to.userInfoEntity.value!.screenShareId){ //
// if(state.remoteUid.value != UserStore.to.userInfoEntity.value!.screenShareId){
state.isSelf.value = false;
}else{ }else{
// state.isSelf.value = true;
}
//
if(state.isSelf.value == false){
changePageState(1); changePageState(1);
}*/ }
} }
/*if(res.data!.toString().length != 9){
if(state.remoteUid.value != UserStore.to.userInfoEntity.value!.uid) {
state.isSelf.value = false;
}else{
state.isSelf.value = true;
}
if(state.isSelf.value == true){
if(state.isOpenCamera.value == true){
changePageState(1);
}else{
changePageState(0);
}
state.floating.value?.close();
}else{
var isCurrentUserIsCamera = false;
for(var i = 0; i < state.cacheUsers.value.length; i++){
if(state.remoteUid.value == state.cacheUsers.value[i].uid && state.cacheUsers.value[i].enableCamera == true){
isCurrentUserIsCamera = true;
}
}
if(isCurrentUserIsCamera == true){
changePageState(1);
}else{
changePageState(0);
}
}
}else{
if(state.remoteUid.value != UserStore.to.userInfoEntity.value!.screenShareId){
state.isSelf.value = false;
}else{
state.isSelf.value = true;
}
if(state.isSelf.value == false){
changePageState(1);
}
}*/
} }
/// ///
Future<void> doHttpSetTvAnchor(String id) async { Future<void> doHttpSetTvAnchor(String id) async {
await getClient().setTvAnchor(state.roomNumber.value, id, await getClient().setTvAnchor(
UserStore.to.userInfoEntity.value!.userName); state.roomNumber.value,
id,
UserStore.to.userInfoEntity.value!.userName
);
} }
/// ///
/*Future<void> startScreenCapture() async { /*Future<void> startScreenCapture() async {
debugPrint("wgs输出===RTC-启动屏幕共享"); debugPrint("wgs输出===RTC-启动屏幕共享");
state.isOpenShare.value = true; state.isOpenShare.value = true;
@ -271,7 +290,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
doHttpSetTvAnchor(UserStore.to.userInfoEntity.value!.screenShareId); doHttpSetTvAnchor(UserStore.to.userInfoEntity.value!.screenShareId);
}*/ }*/
/// ///
/*Future<void> stopScreenCapture() async { /*Future<void> stopScreenCapture() async {
debugPrint("wgs输出===RTC-停止屏幕共享"); debugPrint("wgs输出===RTC-停止屏幕共享");
state.isOpenShare.value = false; state.isOpenShare.value = false;
@ -289,19 +308,16 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
doHttpSetTvAnchor(UserStore.to.userInfoEntity.value!.uid); doHttpSetTvAnchor(UserStore.to.userInfoEntity.value!.uid);
}*/ }*/
/// ------------------------------------------------------------------------------signalR Socket相关 /// ------------------------------------------------------------------------------signalR Socket相关
/// Socket长连接 /// Socket长连接
Future<void> signalRSocket() async { Future<void> signalRSocket() async {
state.hubConnection.value = HubConnectionBuilder() state.hubConnection.value = HubConnectionBuilder()
.withUrl( .withUrl('${RequestConfig().baseUrl}/session-manage', HttpConnectionOptions(
'${RequestConfig().baseUrl}/session-manage', transport: HttpTransportType.webSockets,
HttpConnectionOptions( accessTokenFactory: () async => await Future.value(UserStore.to.token),
transport: HttpTransportType.webSockets, logging: (level, message) => debugPrint("wgs输出===SignalR Socket-$message"),
accessTokenFactory: () async => ))
await Future.value(UserStore.to.token),
logging: (level, message) =>
debugPrint("wgs输出===SignalR Socket-$message"),
))
// 线410 4 10 10 // 线410 4 10 10
.withAutomaticReconnect([10000, 4000, 10000, 10000]).build(); .withAutomaticReconnect([10000, 4000, 10000, 10000]).build();
@ -311,41 +327,42 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
/// ------------------------------------------------------------------------------ /// ------------------------------------------------------------------------------
/// ///
state.hubConnection.value?.on("ManagerRefresh", (e) { state.hubConnection.value?.on("ManagerRefresh", (e){
// var jsonStr = const Utf8Decoder().convert(json.encode(e?[0]).runes.toList()); // var jsonStr = const Utf8Decoder().convert(json.encode(e?[0]).runes.toList());
var jsonStr = json.encode(e?[0]); var jsonStr = json.encode(e?[0]);
var listDynamic = jsonDecode(jsonStr); var listDynamic = jsonDecode(jsonStr);
MeetingRoomUser meetingRoomUser = MeetingRoomUser.fromJson(listDynamic); MeetingRoomUser meetingRoomUser = MeetingRoomUser.fromJson(listDynamic);
if (meetingRoomUser.isRoomManager == true) { if(meetingRoomUser.isRoomManager == true){
debugPrint("wgs输出===Socket-开启发言权限:${e?[0]}--${e?[1]}"); debugPrint("wgs输出===Socket-开启发言权限:${e?[0]}--${e?[1]}");
for (MeetingRoomUser mru in state.cacheUsers.value) { for(MeetingRoomUser mru in state.cacheUsers.value){
if (mru.uid == meetingRoomUser.uid) { if(mru.uid == meetingRoomUser.uid){
mru.roleId = meetingRoomUser.roleId; mru.roleId = meetingRoomUser.roleId;
mru.enableMicr = true; mru.enableMicr = true;
mru.isRoomManager = meetingRoomUser.isRoomManager; mru.isRoomManager = meetingRoomUser.isRoomManager;
} }
} }
if (UserStore.to.userInfoEntity.value!.uid == meetingRoomUser.uid) { if(UserStore.to.userInfoEntity.value!.uid == meetingRoomUser.uid){
state.isSpeak.value = true; state.isSpeak.value = true;
state.isOpenMicrophone.value = true; state.isOpenMicrophone.value = true;
// SDK角色为主播 // SDK角色为主播
setClientRole("主播"); setClientRole("主播");
debugPrint("wgs输出===Socket-开启发言权限:主播"); debugPrint("wgs输出===Socket-开启发言权限:主播");
} }
} else { }else{
debugPrint("wgs输出===Socket-关闭发言权限:${e?[0]}--${e?[1]}"); debugPrint("wgs输出===Socket-关闭发言权限:${e?[0]}--${e?[1]}");
for (MeetingRoomUser mru in state.cacheUsers.value) { for(MeetingRoomUser mru in state.cacheUsers.value){
if (mru.uid == meetingRoomUser.uid) { if(mru.uid == meetingRoomUser.uid){
mru.roleId = meetingRoomUser.roleId; mru.roleId = meetingRoomUser.roleId;
mru.enableMicr = false; mru.enableMicr = false;
mru.isRoomManager = meetingRoomUser.isRoomManager; mru.isRoomManager = meetingRoomUser.isRoomManager;
} }
} }
if (UserStore.to.userInfoEntity.value!.uid == meetingRoomUser.uid) { if(UserStore.to.userInfoEntity.value!.uid == meetingRoomUser.uid){
state.isSpeak.value = false; state.isSpeak.value = false;
state.isOpenMicrophone.value = false; state.isOpenMicrophone.value = false;
state.isOpenCamera.value = false; state.isOpenCamera.value = false;
state.isOpenShare.value = false; state.isOpenShare.value = false;
state.isSelf.value = false;
state.remoteUid.value = ""; state.remoteUid.value = "";
// SDK角色为观众 // SDK角色为观众
@ -358,9 +375,10 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
state.floating.value?.close(); state.floating.value?.close();
// //
changePageState(0); changePageState(0);
// //
// stopScreenCapture(); // stopScreenCapture();
debugPrint("wgs输出===Socket-关闭发言权限:观众"); debugPrint("wgs输出===Socket-关闭发言权限:观众");
} }
} }
@ -368,13 +386,13 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
/// ------------------------------------------------------------------------------ /// ------------------------------------------------------------------------------
/// ///
state.hubConnection.value?.on("OperAllMicr", (e) { state.hubConnection.value?.on("OperAllMicr", (e){
if (e?[0] == true) { if(e?[0] == true){
debugPrint("wgs输出===Socket-全员开麦"); debugPrint("wgs输出===Socket-全员开麦");
} else { }else{
debugPrint("wgs输出===Socket-全员闭麦"); debugPrint("wgs输出===Socket-全员闭麦");
} }
for (var i = 0; i < state.cacheUsers.value.length; i++) { for(var i = 0; i < state.cacheUsers.value.length; i++){
state.cacheUsers.value[i].enableMicr = e?[0]; state.cacheUsers.value[i].enableMicr = e?[0];
} }
state.users.value = state.cacheUsers.value; state.users.value = state.cacheUsers.value;
@ -382,34 +400,32 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
}); });
/// ///
state.hubConnection.value?.on("OperMicr", (e) { state.hubConnection.value?.on("OperMicr", (e){
// var jsonStr = const Utf8Decoder().convert(json.encode(e?[0]).runes.toList()); // var jsonStr = const Utf8Decoder().convert(json.encode(e?[0]).runes.toList());
var jsonStr = json.encode(e?[0]); var jsonStr = json.encode(e?[0]);
var listDynamic = jsonDecode(jsonStr); var listDynamic = jsonDecode(jsonStr);
MeetingRoomUser meetingRoomUser = MeetingRoomUser.fromJson(listDynamic); MeetingRoomUser meetingRoomUser = MeetingRoomUser.fromJson(listDynamic);
if (meetingRoomUser.enableMicr == true) { if(meetingRoomUser.enableMicr == true){
debugPrint( debugPrint("wgs输出===Socket-用户单独开麦${meetingRoomUser.uid}-${meetingRoomUser.userName}");
"wgs输出===Socket-用户单独开麦${meetingRoomUser.uid}-${meetingRoomUser.userName}"); for(MeetingRoomUser mru in state.cacheUsers.value){
for (MeetingRoomUser mru in state.cacheUsers.value) { if(mru.uid == meetingRoomUser.uid){
if (mru.uid == meetingRoomUser.uid) {
mru.enableMicr = true; mru.enableMicr = true;
} }
} }
if (meetingRoomUser.uid == UserStore.to.userInfoEntity.value!.uid) { if(meetingRoomUser.uid == UserStore.to.userInfoEntity.value!.uid) {
state.isOpenMicrophone.value = true; state.isOpenMicrophone.value = true;
// //
muteLocalAudioStream(false); muteLocalAudioStream(false);
} }
} else { }else{
debugPrint( debugPrint("wgs输出===Socket-用户单独闭麦${meetingRoomUser.uid}-${meetingRoomUser.userName}");
"wgs输出===Socket-用户单独闭麦${meetingRoomUser.uid}-${meetingRoomUser.userName}"); for(MeetingRoomUser mru in state.cacheUsers.value){
for (MeetingRoomUser mru in state.cacheUsers.value) { if(mru.uid == meetingRoomUser.uid){
if (mru.uid == meetingRoomUser.uid) {
mru.enableMicr = false; mru.enableMicr = false;
} }
} }
if (meetingRoomUser.uid == UserStore.to.userInfoEntity.value!.uid) { if(meetingRoomUser.uid == UserStore.to.userInfoEntity.value!.uid) {
state.isOpenMicrophone.value = false; state.isOpenMicrophone.value = false;
// //
@ -420,27 +436,26 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
/// ------------------------------------------------------------------------------ /// ------------------------------------------------------------------------------
/// ///
state.hubConnection.value?.on("UserJoined", (e) { state.hubConnection.value?.on("UserJoined", (e){
// var jsonStr = const Utf8Decoder().convert(json.encode(user).runes.toList()); // var jsonStr = const Utf8Decoder().convert(json.encode(user).runes.toList());
var jsonStr = json.encode(e); var jsonStr = json.encode(e);
var listDynamic = jsonDecode(jsonStr); var listDynamic = jsonDecode(jsonStr);
List<MeetingRoomUser> meetingRoomUsers = (listDynamic as List<dynamic>) List<MeetingRoomUser> meetingRoomUsers = (listDynamic as List<dynamic>).map((e) => MeetingRoomUser.fromJson((e as Map<String,dynamic>))).toList();
.map((e) => MeetingRoomUser.fromJson((e as Map<String, dynamic>)))
.toList();
state.cacheUsers.value.addAll(meetingRoomUsers); state.cacheUsers.value.addAll(meetingRoomUsers);
state.users.value = state.cacheUsers.value; state.users.value = state.cacheUsers.value;
debugPrint("wgs输出===Socket-远端用户或主播加入会议室:$jsonStr"); debugPrint("wgs输出===Socket-远端用户或主播加入会议室:$jsonStr");
}); });
/// ///
state.hubConnection.value?.on("UserLeave", (e) { state.hubConnection.value?.on("UserLeave", (e){
// var jsonStr = const Utf8Decoder().convert(json.encode(uid).runes.toList()); // var jsonStr = const Utf8Decoder().convert(json.encode(uid).runes.toList());
var jsonStr = json.encode(e); var jsonStr = json.encode(e);
List listDynamic = jsonDecode(jsonStr); List listDynamic = jsonDecode(jsonStr);
for (String uidStr in listDynamic) { for(String uidStr in listDynamic){
for (var j = 0; j < state.cacheUsers.value.length; j++) { for(var j = 0; j < state.cacheUsers.value.length; j++){
if (state.cacheUsers.value[j].uid == uidStr) { if(state.cacheUsers.value[j].uid == uidStr){
state.cacheUsers.value.removeAt(j); state.cacheUsers.value.removeAt(j);
doHttpGetTvAnchor();
} }
} }
} }
@ -449,7 +464,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
}); });
/// ///
state.hubConnection.value?.on("ForceExitRoom", (e) { state.hubConnection.value?.on("ForceExitRoom", (e){
// var jsonStr = const Utf8Decoder().convert(json.encode(e).runes.toList()); // var jsonStr = const Utf8Decoder().convert(json.encode(e).runes.toList());
var jsonStr = json.encode(e); var jsonStr = json.encode(e);
debugPrint("wgs输出===Socket-被移除会议:$jsonStr"); debugPrint("wgs输出===Socket-被移除会议:$jsonStr");
@ -458,7 +473,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
}); });
/// ///
state.hubConnection.value?.on("AllLeave", (e) { state.hubConnection.value?.on("AllLeave", (e){
debugPrint("wgs输出===Socket-全员结束会议"); debugPrint("wgs输出===Socket-全员结束会议");
Get.back(); Get.back();
ToastUtils.showSuccess("会议已结束"); ToastUtils.showSuccess("会议已结束");
@ -466,88 +481,87 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
/// ------------------------------------------------------------------------------ /// ------------------------------------------------------------------------------
/// ///
state.hubConnection.value?.on("ReceiveMessage", (e) { state.hubConnection.value?.on("ReceiveMessage", (e){
// var jsonStr = const Utf8Decoder().convert(json.encode(e).runes.toList()); // var jsonStr = const Utf8Decoder().convert(json.encode(e).runes.toList());
var jsonStr = json.encode(e); var jsonStr = json.encode(e);
List list = json.decode(jsonStr); List list = json.decode(jsonStr);
MeetingRoomMsg meetingRoomMsg = MeetingRoomMsg meetingRoomMsg = MeetingRoomMsg(list[0],list[1],list[2],0);
MeetingRoomMsg(list[0], list[1], list[2], 0);
state.meetingRoomMsgs.value.add(meetingRoomMsg); state.meetingRoomMsgs.value.add(meetingRoomMsg);
update(); update();
Future.delayed(const Duration(milliseconds: 100), () { Future.delayed(const Duration(milliseconds: 100), () {
state.chatController state.chatController.jumpTo(state.chatController.position.maxScrollExtent);
.jumpTo(state.chatController.position.maxScrollExtent);
}); });
debugPrint("wgs输出===Socket-会议室接收消息:$jsonStr"); debugPrint("wgs输出===Socket-会议室接收消息:$jsonStr");
}); });
/// ------------------------------------------------------------------------------ /// ------------------------------------------------------------------------------
/// ///
state.hubConnection.value?.on("OperCamera", (e) { state.hubConnection.value?.on("OperCamera", (e){
// var jsonStr = const Utf8Decoder().convert(json.encode(e?[0]).runes.toList()); // var jsonStr = const Utf8Decoder().convert(json.encode(e?[0]).runes.toList());
var jsonStr = json.encode(e?[0]); var jsonStr = json.encode(e?[0]);
var listDynamic = jsonDecode(jsonStr); var listDynamic = jsonDecode(jsonStr);
MeetingRoomUser meetingRoomUser = MeetingRoomUser.fromJson(listDynamic); MeetingRoomUser meetingRoomUser = MeetingRoomUser.fromJson(listDynamic);
if (meetingRoomUser.enableCamera == true) { if(meetingRoomUser.enableCamera == true){
debugPrint("wgs输出===Socket-用户单独开摄像头"); debugPrint("wgs输出===Socket-用户单独开摄像头");
for(MeetingRoomUser mru in state.cacheUsers.value){
// if(mru.uid == meetingRoomUser.uid){
for (MeetingRoomUser mru in state.cacheUsers.value) {
if (mru.uid == meetingRoomUser.uid) {
mru.enableCamera = true; mru.enableCamera = true;
} }
} }
if(meetingRoomUser.uid == UserStore.to.userInfoEntity.value!.uid){
if (meetingRoomUser.uid == UserStore.to.userInfoEntity.value!.uid) {
//
//
state.isOpenCamera.value = true; state.isOpenCamera.value = true;
// //
muteLocalVideoStream(false); muteLocalVideoStream(false);
// //
startPreview(); startPreview();
// //
changePageState(1); if(state.pageIndex.value == 0 && state.isSelf.value == false){
// //
if (state.pageIndex.value == 0 && state.remoteUid.value != "0") {
state.floating.value?.open(state.context.value!); state.floating.value?.open(state.context.value!);
} }
changePageState(1);
} }
} else { }else{
debugPrint("wgs输出===Socket-用户单独闭摄像头"); debugPrint("wgs输出===Socket-用户单独闭摄像头");
for(MeetingRoomUser mru in state.cacheUsers.value){
// if(mru.uid == meetingRoomUser.uid){
for (MeetingRoomUser mru in state.cacheUsers.value) {
if (mru.uid == meetingRoomUser.uid) {
mru.enableCamera = false; mru.enableCamera = false;
} }
} }
if(meetingRoomUser.uid == UserStore.to.userInfoEntity.value!.uid){
if (meetingRoomUser.uid == UserStore.to.userInfoEntity.value!.uid) {
//
//
state.isOpenCamera.value = false; state.isOpenCamera.value = false;
//
if(state.isSelf.value == true){
changePageState(0);
state.isSelf.value = false;
}
// //
muteLocalVideoStream(true); muteLocalVideoStream(true);
// //
stopPreview(); stopPreview();
//
if (state.remoteUid.value == "0") {
changePageState(0);
}
// //
if (state.floating.value?.isShowing == true) { state.floating.value?.close();
state.floating.value?.close(); }else{
if(meetingRoomUser.uid == state.remoteUid.value || meetingRoomUser.screenShareId == state.remoteUid.value){
if(state.isOpenCamera.value == true){
state.remoteUid.value = "";
changePageState(0);
}
} }
} }
} }
}); });
/// ///
state.hubConnection.value?.on("ShowUser", (e) { state.hubConnection.value?.on("ShowUser", (e){
// var jsonStr = const Utf8Decoder().convert(json.encode(e).runes.toList()); // var jsonStr = const Utf8Decoder().convert(json.encode(e).runes.toList());
var jsonStr = json.encode(e); var jsonStr = json.encode(e);
List list = json.decode(jsonStr); List list = json.decode(jsonStr);
/*if(list[0].toString().length != 9){
state.remoteUid.value = list[0].toString();
}*/
doHttpGetTvAnchor(); doHttpGetTvAnchor();
debugPrint("wgs输出===Socket-设置新的全员观看视频主播:${list[0]}"); debugPrint("wgs输出===Socket-设置新的全员观看视频主播:${list[0]}");
}); });
@ -555,15 +569,13 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
/// ///
Future<void> joinMeetingToSocket() async { Future<void> joinMeetingToSocket() async {
await state.hubConnection.value?.invoke("joinChannel", await state.hubConnection.value?.invoke("joinChannel", args: [state.roomNumber.value, false, false, false]);
args: [state.roomNumber.value, false, false, false]);
mergeFetch(); mergeFetch();
} }
/// ///
Future<void> leaveMeetingToSocket() async { Future<void> leaveMeetingToSocket() async {
await state.hubConnection.value await state.hubConnection.value?.invoke("levelChannel", args: [state.roomNumber.value]);
?.invoke("levelChannel", args: [state.roomNumber.value]);
state.hubConnection.value?.stop(); state.hubConnection.value?.stop();
} }
@ -572,16 +584,13 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
MeetingRoomMsg meetingRoomMsg = MeetingRoomMsg( MeetingRoomMsg meetingRoomMsg = MeetingRoomMsg(
UserStore.to.userInfoEntity.value!.uid, UserStore.to.userInfoEntity.value!.uid,
UserStore.to.userInfoEntity.value!.userName, UserStore.to.userInfoEntity.value!.userName,
msg, msg,1);
1);
state.meetingRoomMsgs.value.add(meetingRoomMsg); state.meetingRoomMsgs.value.add(meetingRoomMsg);
update(); update();
Future.delayed(const Duration(milliseconds: 100), () { Future.delayed(const Duration(milliseconds: 100), () {
state.chatController state.chatController.jumpTo(state.chatController.position.maxScrollExtent);
.jumpTo(state.chatController.position.maxScrollExtent);
}); });
await state.hubConnection.value await state.hubConnection.value?.invoke("sendChannelMsg", args: [state.roomNumber.value, msg]);
?.invoke("sendChannelMsg", args: [state.roomNumber.value, msg]);
} }
/// ------------------------------------------------------------------------------SDK相关 /// ------------------------------------------------------------------------------SDK相关
@ -606,134 +615,119 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
// //
await state.rctEngine.value?.setDefaultAudioRouteToSpeakerphone(false); await state.rctEngine.value?.setDefaultAudioRouteToSpeakerphone(false);
// //
await state.rctEngine.value?.enableAudioVolumeIndication( await state.rctEngine.value?.enableAudioVolumeIndication(interval: 200, smooth: 3, reportVad: true);
interval: 200, smooth: 3, reportVad: true);
joinMeetingToRtc(); joinMeetingToRtc();
// //
state.rctEngine.value?.registerEventHandler( state.rctEngine.value?.registerEventHandler(
RtcEngineEventHandler( RtcEngineEventHandler(
//
onJoinChannelSuccess: (RtcConnection connection, int elapsed) {
debugPrint("wgs输出===RTC-自己加入会议室ID${connection.localUid}");
},
// //
onLeaveChannel: (RtcConnection connection, RtcStats stats) { onJoinChannelSuccess: (RtcConnection connection, int elapsed) {
debugPrint("wgs输出===RTC-自己离开会议室ID${connection.localUid}"); debugPrint("wgs输出===RTC-自己加入会议室ID${connection.localUid}");
}, },
// - //
onUserJoined: (RtcConnection connection, int remoteUid, int elapsed) { onLeaveChannel: (RtcConnection connection, RtcStats stats){
debugPrint("wgs输出===RTC-远端用户或主播加入会议室用户或主机的ID$remoteUid"); debugPrint("wgs输出===RTC-自己离开会议室ID${connection.localUid}");
}, },
// - // -
onUserOffline: (RtcConnection connection, int remoteUid, onUserJoined: (RtcConnection connection, int remoteUid, int elapsed) {
UserOfflineReasonType reason) async { debugPrint("wgs输出===RTC-远端用户或主播加入会议室用户或主机的ID$remoteUid");
debugPrint("wgs输出===RTC-远端用户或主播离开会议室用户或主机的ID$remoteUid"); },
},
// // -
onAudioRoutingChanged: (int routing) { onUserOffline: (RtcConnection connection, int remoteUid, UserOfflineReasonType reason) async {
debugPrint("wgs输出===RTC-音频路由切换:$routing"); debugPrint("wgs输出===RTC-远端用户或主播离开会议室用户或主机的ID$remoteUid");
state.communicationMode.value = routing; },
if (routing == 1) {
debugPrint("wgs输出===RTC-音频路由切换为听筒");
} else if (routing == 3) {
debugPrint("wgs输出===RTC-音频路由切换为扬声器");
} else {
debugPrint("wgs输出===RTC-音频路由切换为外接设备");
}
},
// //
onLocalAudioStateChanged: (RtcConnection connection, onAudioRoutingChanged: (int routing){
LocalAudioStreamState state, LocalAudioStreamReason reason) { debugPrint("wgs输出===RTC-音频路由切换:$routing");
debugPrint("wgs输出===RTC-音频采集开关:$state"); state.communicationMode.value = routing;
}, if(routing == 1){
debugPrint("wgs输出===RTC-音频路由切换为听筒");
// }else if(routing == 3){
onRemoteVideoStateChanged: (RtcConnection connection, debugPrint("wgs输出===RTC-音频路由切换为扬声器");
int remoteUid, }else{
RemoteVideoState remoteVideoState, debugPrint("wgs输出===RTC-音频路由切换为外接设备");
RemoteVideoStateReason remoteVideoStateReason,
int elapsed) {
debugPrint(
"wgs输出===RTC-远端视频状态发生改变ID-$remoteUid-状态-$remoteVideoStateReason");
if (remoteVideoStateReason ==
RemoteVideoStateReason.remoteVideoStateReasonRemoteMuted) {
//
if (remoteUid.toString().length != 9) {
//
if (remoteUid.toString() == state.remoteUid.value) {
//
doHttpGetTvAnchor();
}
} else {
//
} }
} },
},
// //
onAudioVolumeIndication: (RtcConnection connection, onLocalAudioStateChanged: (RtcConnection connection, LocalAudioStreamState state, LocalAudioStreamReason reason){
List<AudioVolumeInfo> speakers, debugPrint("wgs输出===RTC-音频采集开关:$state");
int speakerNumber, },
int totalVolume) {
if (speakers.isNotEmpty) { //
for (AudioVolumeInfo avi in speakers) { onRemoteVideoStateChanged: (RtcConnection connection,
for (MeetingRoomUser mru in state.cacheUsers.value) { int remoteUid,
// RemoteVideoState state,
if (avi.uid == 0) { RemoteVideoStateReason reason,
//debugPrint("wgs输出===RTC-用户音量提示(自己):${CountMicrophoneVolume.getVolume(avi.volume!)}"); int elapsed){
mru.volume = CountMicrophoneVolume.getVolume(avi.volume!); debugPrint("wgs输出===RTC-远端视频状态发生改变:$state");
state.microphoneVolume.value = },
CountMicrophoneVolume.getVolume(avi.volume!);
} else { //
if (avi.uid.toString() == mru.uid) { onAudioVolumeIndication: (
//debugPrint("wgs输出===RTC-用户音量提示(远端用户):${speakers[0].uid}--${speakers[0].volume}"); RtcConnection connection,
List<AudioVolumeInfo> speakers,
int speakerNumber,
int totalVolume){
if(speakers.isNotEmpty){
for(AudioVolumeInfo avi in speakers){
for(MeetingRoomUser mru in state.cacheUsers.value){
//
if(avi.uid == 0){
//debugPrint("wgs输出===RTC-用户音量提示(自己):${CountMicrophoneVolume.getVolume(avi.volume!)}");
mru.volume = CountMicrophoneVolume.getVolume(avi.volume!); mru.volume = CountMicrophoneVolume.getVolume(avi.volume!);
state.microphoneVolume.value = CountMicrophoneVolume.getVolume(avi.volume!);
if (avi.volume != 0) { }else{
state.spokesman.value = mru.userName; if(avi.uid.toString() == mru.uid){
state.spokesmanVolume.value = //debugPrint("wgs输出===RTC-用户音量提示(远端用户):${speakers[0].uid}--${speakers[0].volume}");
CountMicrophoneVolume.getVolume(avi.volume!); mru.volume = CountMicrophoneVolume.getVolume(avi.volume!);
} else {
state.spokesman.value = ""; if(avi.volume != 0){
state.spokesmanVolume.value = 0; state.spokesman.value = mru.userName;
state.spokesmanVolume.value = CountMicrophoneVolume.getVolume(avi.volume!);
}else{
state.spokesman.value = "";
state.spokesmanVolume.value = 0;
}
} }
} }
} }
} }
} }
} },
},
// //
onClientRoleChanged: (RtcConnection connection, ClientRoleType oldRole, onClientRoleChanged: (
ClientRoleType newRole, ClientRoleOptions newRoleOptions) { RtcConnection connection,
debugPrint( ClientRoleType oldRole,
"wgs输出===RTC-切换用户角色为:${newRole == ClientRoleType.clientRoleBroadcaster ? "主播" : "观众"}"); ClientRoleType newRole,
}, ClientRoleOptions newRoleOptions){
debugPrint("wgs输出===RTC-切换用户角色为:${newRole == ClientRoleType.clientRoleBroadcaster ? "主播" : "观众"}");
},
// token即将在30秒内过期回调 // token即将在30秒内过期回调
onTokenPrivilegeWillExpire: (RtcConnection connection, String token) { onTokenPrivilegeWillExpire: (RtcConnection connection, String token){
doHttpGetMeetingToken(false); doHttpGetMeetingToken(false);
}, },
// //
onLocalVideoStateChanged: (VideoSourceType source, onLocalVideoStateChanged: (VideoSourceType source, LocalVideoStreamState state, LocalVideoStreamReason reason){
LocalVideoStreamState state, LocalVideoStreamReason reason) { debugPrint("wgs输出===RTC-本地视频状态发生改变:$source--$state--$reason");
debugPrint("wgs输出===RTC-本地视频状态发生改变:$source--$state--$reason"); },
},
// //
/*onPermissionError: (PermissionType permissionType){ /*onPermissionError: (PermissionType permissionType){
debugPrint("wgs输出===RTC-获取设备权限出错:$permissionType"); debugPrint("wgs输出===RTC-获取设备权限出错:$permissionType");
if(permissionType == PermissionType.screenCapture){ if(permissionType == PermissionType.screenCapture){
// //
state.isOpenShare.value = false; state.isOpenShare.value = false;
stopScreenCapture(); stopScreenCapture();
} }
@ -749,19 +743,19 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
channelId: state.roomNumber.value, channelId: state.roomNumber.value,
uid: int.parse(UserStore.to.userInfoEntity.value!.uid), uid: int.parse(UserStore.to.userInfoEntity.value!.uid),
options: const ChannelMediaOptions( options: const ChannelMediaOptions(
// //
autoSubscribeVideo: true, autoSubscribeVideo: true,
// //
autoSubscribeAudio: true, autoSubscribeAudio: true,
// //
publishCameraTrack: true, publishCameraTrack: true,
// //
publishMicrophoneTrack: true, publishMicrophoneTrack: true,
// clientRoleBroadcaster clientRoleAudience // clientRoleBroadcaster clientRoleAudience
// clientRoleBroadcaster // clientRoleBroadcaster
// //
// //
clientRoleType: ClientRoleType.clientRoleAudience), clientRoleType: ClientRoleType.clientRoleAudience),
); );
} }
@ -775,20 +769,17 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
/// ///
Future<void> setClientRole(String roleStr) async { Future<void> setClientRole(String roleStr) async {
if (roleStr == "主播") { if(roleStr == "主播"){
await state.rctEngine.value await state.rctEngine.value?.setClientRole(role: ClientRoleType.clientRoleBroadcaster);
?.setClientRole(role: ClientRoleType.clientRoleBroadcaster); }else{
} else { await state.rctEngine.value?.setClientRole(role: ClientRoleType.clientRoleAudience);
await state.rctEngine.value
?.setClientRole(role: ClientRoleType.clientRoleAudience);
} }
} }
/// ///
Future<void> setEnableSpeakerphone(int mode) async { Future<void> setEnableSpeakerphone(int mode) async {
state.communicationMode.value = mode; state.communicationMode.value = mode;
await state.rctEngine.value await state.rctEngine.value?.setEnableSpeakerphone(mode == 1 ? false : true);
?.setEnableSpeakerphone(mode == 1 ? false : true);
} }
/// ///
@ -798,7 +789,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
/// ///
Future<void> muteLocalAudioStream(bool mute) async { Future<void> muteLocalAudioStream(bool mute) async {
await state.rctEngine.value?.muteLocalAudioStream(mute); await state.rctEngine.value?.muteLocalAudioStream(mute);
} }
/// ///

View File

@ -70,6 +70,8 @@ class MeetingMainState {
late RxBool isOpenShare = false.obs; late RxBool isOpenShare = false.obs;
/// ID /// ID
late RxString remoteUid = "".obs; late RxString remoteUid = "".obs;
///
late RxBool isSelf = false.obs;
/// ///
late RxString spokesman = "".obs; late RxString spokesman = "".obs;

View File

@ -10,8 +10,11 @@ import 'package:get/get.dart';
import 'package:liquid_progress_indicator_v2/liquid_progress_indicator.dart'; import 'package:liquid_progress_indicator_v2/liquid_progress_indicator.dart';
import 'package:preload_page_view/preload_page_view.dart'; import 'package:preload_page_view/preload_page_view.dart';
import 'package:wgshare/common/store/user_store.dart'; import 'package:wgshare/common/store/user_store.dart';
import 'package:wgshare/pages/metting/share/meeting_main_share_view.dart';
import 'package:wgshare/pages/metting/video/meeting_main_video_view.dart';
import 'package:wgshare/utils/toast_utils.dart'; import 'package:wgshare/utils/toast_utils.dart';
import '../../common/models/meeting_room_user.dart';
import '../../utils/color_util.dart'; import '../../utils/color_util.dart';
import '../../utils/cus_behavior.dart'; import '../../utils/cus_behavior.dart';
import '../../view/view_svg_path.dart'; import '../../view/view_svg_path.dart';
@ -84,7 +87,8 @@ class MeetingMainPageState extends State<MeetingMainPage> {
width: 20.w, width: 20.w,
height: 20.h, height: 20.h,
), ),
onTap: () {}, onTap: () {
},
), ),
SizedBox(width: 16.w), SizedBox(width: 16.w),
GestureDetector( GestureDetector(
@ -174,7 +178,7 @@ class MeetingMainPageState extends State<MeetingMainPage> {
height: 22.h, height: 22.h,
), ),
onTap: () { onTap: () {
logic.cancelSpeak(); logic.doHttpCancelSpeak();
}, },
), ),
), ),
@ -211,81 +215,109 @@ class MeetingMainPageState extends State<MeetingMainPage> {
child: MeetingMainVoiceComponent( child: MeetingMainVoiceComponent(
users: state.cacheUsers.value)), users: state.cacheUsers.value)),
// - // -
Visibility( Visibility(
visible: state.pageState.value == 1, visible: state.pageState.value == 1 && state.isSelf.value == false,
child: null != state.rctEngine.value child: null != state.rctEngine.value
? Stack( ? Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
PreloadPageView.builder( PreloadPageView.builder(
preloadPagesCount: 2, preloadPagesCount: 2,
itemCount: 2, itemCount: 2,
itemBuilder: (BuildContext context, itemBuilder: (BuildContext context, int position) => returnPageToOther(position),
int position) => controller: PreloadPageController(initialPage: 0),
returnPage(position), onPageChanged: (int position) {
controller: PreloadPageController( state.pageIndex.value = position;
initialPage: 0), if(state.isSpeak.value == true && state.isOpenCamera.value == true && state.isSelf.value == false){
onPageChanged: (int position) { if(position == 0){
state.pageIndex.value = position; state.floating.value?.open(context);
if (state.isSpeak.value == true && }else{
state.isOpenCamera.value == state.floating.value?.close();
true && }
state.remoteUid.value != "0") { }
if (position == 0) { },
state.floating.value ),
?.open(context);
} else {
state.floating.value?.close();
}
}
},
),
/// pageview /// pageview
Positioned( Positioned(
bottom: 16, bottom: 16,
child: Row( child: Row(
children: [ children: [
Container( Container(
width: 8.w, width: 8.w,
height: 8.h, height: 8.h,
margin: const EdgeInsets.only( margin: const EdgeInsets.only(right: 6),
right: 6), decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius: BorderRadius.circular(8),
borderRadius: color: state.pageIndex.value == 0
BorderRadius.circular( ? ColorUtil.Color_255_255_255
8), : ColorUtil.Color_108_108_108),
color: state.pageIndex
.value ==
0
? ColorUtil
.Color_255_255_255
: ColorUtil
.Color_108_108_108),
),
Container(
width: 8.w,
height: 8.h,
margin: const EdgeInsets.only(
left: 6),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
8),
color: state.pageIndex
.value ==
1
? ColorUtil
.Color_255_255_255
: ColorUtil
.Color_108_108_108),
)
],
),
), ),
Container(
width: 8.w,
height: 8.h,
margin: const EdgeInsets.only(left: 6),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: state.pageIndex.value == 1
? ColorUtil.Color_255_255_255
: ColorUtil.Color_108_108_108),
)
], ],
) ),
),
],
)
: Container()),
// -
Visibility(
visible: state.pageState.value == 1 && state.isSelf.value == true,
child: null != state.rctEngine.value
? Stack(
alignment: Alignment.center,
children: [
PreloadPageView.builder(
preloadPagesCount: 2,
itemCount: 2,
itemBuilder: (BuildContext context, int position) => returnPageSelf(position),
controller: PreloadPageController(initialPage: 0),
onPageChanged: (int position) {
state.pageIndex.value = position;
},
),
/// pageview
Positioned(
bottom: 16,
child: Row(
children: [
Container(
width: 8.w,
height: 8.h,
margin: const EdgeInsets.only(right: 6),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: state.pageIndex.value == 0
? ColorUtil.Color_255_255_255
: ColorUtil.Color_108_108_108),
),
Container(
width: 8.w,
height: 8.h,
margin: const EdgeInsets.only(left: 6),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: state.pageIndex.value == 1
? ColorUtil.Color_255_255_255
: ColorUtil.Color_108_108_108),
)
],
),
),
],
)
: Container()), : Container()),
GestureDetector( GestureDetector(
@ -450,7 +482,7 @@ class MeetingMainPageState extends State<MeetingMainPage> {
}, },
), ),
/// ///
/*GestureDetector( /*GestureDetector(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -767,7 +799,7 @@ class MeetingMainPageState extends State<MeetingMainPage> {
padding: const EdgeInsets.only(top: 16, bottom: 16), padding: const EdgeInsets.only(top: 16, bottom: 16),
margin: const EdgeInsets.only(left: 40, right: 40), margin: const EdgeInsets.only(left: 40, right: 40),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(6)), borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.all(color: ColorUtil.Color_0_0_0_0), border: Border.all(color: ColorUtil.Color_0_0_0_0),
color: ColorUtil.Color_35_35_35, color: ColorUtil.Color_35_35_35,
), ),
@ -1427,9 +1459,7 @@ class MeetingMainPageState extends State<MeetingMainPage> {
? AgoraVideoView( ? AgoraVideoView(
controller: VideoViewController( controller: VideoViewController(
rtcEngine: state.rctEngine.value!, rtcEngine: state.rctEngine.value!,
canvas: const VideoCanvas( canvas: const VideoCanvas(uid: 0, setupMode: VideoViewSetupMode.videoViewSetupAdd),
uid: 0,
setupMode: VideoViewSetupMode.videoViewSetupAdd),
), ),
) )
: const CircularProgressIndicator(), : const CircularProgressIndicator(),
@ -1452,10 +1482,20 @@ class MeetingMainPageState extends State<MeetingMainPage> {
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2), borderRadius: BorderRadius.circular(2),
color: ColorUtil.Color_0_0_0_96), color: ColorUtil.Color_0_0_0_96),
child: Text( child: Row(
UserStore.to.userInfoEntity.value!.userName, children: [
style: TextStyle( /*Image.asset(
fontSize: 10.sp, color: ColorUtil.Color_185_184_184), 'assets/images/meeting_main_microphone_open.png',
width: 13.w,
height: 14.h,
),
SizedBox(width: 4.w),*/
Text(
UserStore.to.userInfoEntity.value!.userName,
style: TextStyle(
fontSize: 10.sp, color: ColorUtil.Color_185_184_184),
)
],
), ),
) )
], ],
@ -1465,43 +1505,34 @@ class MeetingMainPageState extends State<MeetingMainPage> {
); );
} }
/// pageview对应页数的界面 /// -
Widget returnPage(int position) { Widget returnPageToOther(int position){
debugPrint("wgs输出===:全员观看是别人时布局");
var pageList = []; var pageList = [];
/// ///
pageList.add(Stack( pageList.add(Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
state.remoteUid.value != "" state.remoteUid.value != ""
? AgoraVideoView( ? AgoraVideoView(
controller: VideoViewController( controller: VideoViewController(
rtcEngine: state.rctEngine.value!, rtcEngine: state.rctEngine.value!,
canvas: VideoCanvas( canvas: VideoCanvas(uid: int.tryParse(state.remoteUid.value), setupMode: VideoViewSetupMode.videoViewSetupAdd)
uid: int.tryParse(state.remoteUid.value), ),
setupMode: VideoViewSetupMode.videoViewSetupAdd), )
), : const CircularProgressIndicator(),
) /*Positioned(
: Container( bottom: 110,
width: double.infinity, child: GestureDetector(
color: ColorUtil.Color_57_57_57, child: Image.asset(
child: Column( 'assets/images/meeting_main_hang_up.png',
mainAxisAlignment: MainAxisAlignment.center, width: 50.w,
children: [ height: 50.h,
Image.asset( ),
'assets/images/metting_main_no_person.png', onTap: () {
width: 138.w, },
height: 144.h, ),
), ),*/
const SizedBox(height: 20),
Text(
'主持人正在赶来的路上...',
style: TextStyle(
color: ColorUtil.Color_255_255_255, fontSize: 14.sp),
)
],
),
),
Positioned( Positioned(
top: 16, top: 16,
right: 16, right: 16,
@ -1516,23 +1547,30 @@ class MeetingMainPageState extends State<MeetingMainPage> {
Text( Text(
'正在讲话:', '正在讲话:',
style: TextStyle( style: TextStyle(
fontSize: 10.sp, color: ColorUtil.Color_185_184_184), fontSize: 10.sp,
color: ColorUtil.Color_185_184_184),
), ),
SizedBox( SizedBox(
width: 20.w, width: 20.w,
height: 20.h, height: 20.h,
child: LiquidCustomProgressIndicator( child: LiquidCustomProgressIndicator(
value: state.spokesmanVolume.value, value:
valueColor: const AlwaysStoppedAnimation( state.spokesmanVolume.value,
ColorUtil.Color_2_177_136), valueColor:
backgroundColor: ColorUtil.Color_255_255_255, const AlwaysStoppedAnimation(
ColorUtil
.Color_2_177_136),
backgroundColor:
ColorUtil.Color_255_255_255,
direction: Axis.vertical, direction: Axis.vertical,
shapePath: ViewSvgPath.getMicrpphonePath()), shapePath: ViewSvgPath
.getMicrpphonePath()),
), ),
Text( Text(
state.spokesman.value, state.spokesman.value,
style: TextStyle( style: TextStyle(
fontSize: 10.sp, color: ColorUtil.Color_185_184_184), fontSize: 10.sp,
color: ColorUtil.Color_185_184_184),
) )
], ],
), ),
@ -1540,71 +1578,68 @@ class MeetingMainPageState extends State<MeetingMainPage> {
), ),
], ],
)); ));
/// gridview /// gridview
pageList.add(Container( pageList.add(Container(
color: ColorUtil.Color_57_57_57, color: ColorUtil.Color_57_57_57,
child: GridView.builder( child: GridView.builder(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, childAspectRatio: 0.8, crossAxisSpacing: 0), crossAxisCount: 2,
childAspectRatio: 0.8,
crossAxisSpacing: 0),
itemCount: state.cacheUsers.value.length, itemCount: state.cacheUsers.value.length,
itemBuilder: (BuildContext ctx, index) { itemBuilder: (BuildContext ctx, index) {
return Stack( return Stack(
children: [ children: [
state.cacheUsers.value[index].enableCamera == true state.cacheUsers.value[index].enableCamera == true ? state.cacheUsers.value[index].uid ==
? state.cacheUsers.value[index].uid == UserStore.to.userInfoEntity.value!.uid
UserStore.to.userInfoEntity.value!.uid ? AgoraVideoView(
? AgoraVideoView( controller: VideoViewController(
controller: VideoViewController( rtcEngine: state.rctEngine.value!,
rtcEngine: state.rctEngine.value!, canvas: const VideoCanvas(uid: 0, setupMode: VideoViewSetupMode.videoViewSetupAdd)
canvas: const VideoCanvas( ),
uid: 0, )
setupMode: : AgoraVideoView(
VideoViewSetupMode.videoViewSetupAdd)), controller: VideoViewController.remote(
) rtcEngine: state.rctEngine.value!,
: AgoraVideoView( canvas: VideoCanvas(
controller: VideoViewController.remote( uid: int.tryParse(
rtcEngine: state.rctEngine.value!, state.cacheUsers.value[index].uid), setupMode: VideoViewSetupMode.videoViewSetupAdd),
canvas: VideoCanvas( connection: RtcConnection(
uid: int.tryParse( channelId: state.roomNumber.value),
state.cacheUsers.value[index].uid), ),
setupMode: )
VideoViewSetupMode.videoViewSetupAdd), :
connection: RtcConnection( Container(
channelId: state.roomNumber.value), color: ColorUtil.Color_16_19_13,
), child: SizedBox(
) width: double.infinity,
: Container( child: Column(
color: ColorUtil.Color_16_19_13, mainAxisAlignment: MainAxisAlignment.center,
child: SizedBox( children: [
width: double.infinity, Image.asset(
child: Column( 'assets/images/metting_main_no_person.png',
mainAxisAlignment: MainAxisAlignment.center, width: 78.w,
children: [ height: 84.h,
Image.asset(
'assets/images/metting_main_no_person.png',
width: 78.w,
height: 84.h,
),
const SizedBox(height: 12),
Text(
'该用户未开启摄像头...',
style: TextStyle(
color: ColorUtil.Color_255_255_255,
fontSize: 10.sp),
)
],
),
), ),
), const SizedBox(height: 12),
Text(
'该用户未开启摄像头...',
style: TextStyle(
color: ColorUtil.Color_255_255_255,
fontSize: 10.sp
),
)
],
),
),
),
Positioned( Positioned(
left: 4, left: 4,
bottom: 4, bottom: 4,
child: Row( child: Row(
children: [ children: [
Visibility( Visibility(
visible: state.cacheUsers.value[index].uid == visible: state.cacheUsers.value[index].uid == UserStore.to.userInfoEntity.value!.uid,
UserStore.to.userInfoEntity.value!.uid,
child: Image.asset( child: Image.asset(
'assets/images/meeting_main_own.png', 'assets/images/meeting_main_own.png',
width: 24.w, width: 24.w,
@ -1614,56 +1649,59 @@ class MeetingMainPageState extends State<MeetingMainPage> {
Container( Container(
height: 20, height: 20,
margin: const EdgeInsets.only(left: 4), margin: const EdgeInsets.only(left: 4),
padding: const EdgeInsets.only(left: 4, right: 4), padding:
const EdgeInsets.only(left: 4, right: 4),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2), borderRadius: BorderRadius.circular(2),
color: ColorUtil.Color_0_0_0_96), color: ColorUtil.Color_0_0_0_96),
child: state.cacheUsers.value[index].enableMicr == true child: state.cacheUsers.value[index].enableMicr == true
? Row( ? Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center, MainAxisAlignment.center,
children: [ crossAxisAlignment:
SizedBox( CrossAxisAlignment.center,
width: 20.w, children: [
height: 20.h, SizedBox(
child: LiquidCustomProgressIndicator( width: 20.w,
value: state.cacheUsers.value[index] height: 20.h,
.volume ?? child: LiquidCustomProgressIndicator(
0.0, value:
valueColor: state.cacheUsers.value[index]
const AlwaysStoppedAnimation( .volume ??
ColorUtil.Color_2_177_136), 0.0,
backgroundColor: valueColor:
ColorUtil.Color_255_255_255, const AlwaysStoppedAnimation(
direction: Axis.vertical, ColorUtil
shapePath: .Color_2_177_136),
ViewSvgPath.getMicrpphonePath()), backgroundColor:
), ColorUtil.Color_255_255_255,
Text( direction: Axis.vertical,
state.cacheUsers.value[index].userName, shapePath: ViewSvgPath
style: TextStyle( .getMicrpphonePath()),
fontSize: 12.sp, ),
color: ColorUtil.Color_255_255_255),
) ],
], )
)
: Row( : Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center, MainAxisAlignment.center,
children: [ crossAxisAlignment:
Image.asset( CrossAxisAlignment.center,
'assets/images/meeting_main_microphone_open.png', children: [
width: 20.w, Image.asset(
height: 20.h, 'assets/images/meeting_main_microphone_open.png',
), width: 20.w,
Text( height: 20.h,
state.cacheUsers.value[index].userName, ),
style: TextStyle( Text(
fontSize: 12.sp, state.cacheUsers.value[index].userName,
color: ColorUtil.Color_255_255_255), style: TextStyle(
) fontSize: 12.sp,
], color: ColorUtil
), .Color_255_255_255),
)
],
),
) )
], ],
), ),
@ -1674,4 +1712,217 @@ class MeetingMainPageState extends State<MeetingMainPage> {
)); ));
return pageList[position]; return pageList[position];
} }
/// -
Widget returnPageSelf(int position){
debugPrint("wgs输出===:全员观看是自己时布局");
var pageList = [];
///
pageList.add(Stack(
alignment: Alignment.center,
children: [
AgoraVideoView(
controller: VideoViewController(
rtcEngine: state.rctEngine.value!,
canvas: const VideoCanvas(uid: 0, setupMode: VideoViewSetupMode.videoViewSetupAdd),
),
),
/*Positioned(
bottom: 110,
child: GestureDetector(
child: Image.asset(
'assets/images/meeting_main_hang_up.png',
width: 50.w,
height: 50.h,
),
onTap: () {
},
),
),*/
Positioned(
top: 16,
right: 16,
child: Container(
height: 30,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: ColorUtil.Color_0_0_0_96),
padding: const EdgeInsets.only(left: 12, right: 12),
child: Row(
children: [
Text(
'正在讲话:',
style: TextStyle(
fontSize: 10.sp,
color: ColorUtil.Color_185_184_184),
),
SizedBox(
width: 20.w,
height: 20.h,
child: LiquidCustomProgressIndicator(
value:
state.spokesmanVolume.value,
valueColor:
const AlwaysStoppedAnimation(
ColorUtil
.Color_2_177_136),
backgroundColor:
ColorUtil.Color_255_255_255,
direction: Axis.vertical,
shapePath: ViewSvgPath
.getMicrpphonePath()),
),
Text(
state.spokesman.value,
style: TextStyle(
fontSize: 10.sp,
color: ColorUtil.Color_185_184_184),
)
],
),
),
),
],
));
/// gridview
pageList.add(Container(
color: ColorUtil.Color_57_57_57,
child: GridView.builder(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: 0.8,
crossAxisSpacing: 0),
itemCount: state.cacheUsers.value.length,
itemBuilder: (BuildContext ctx, index) {
return Stack(
children: [
state.cacheUsers.value[index].enableCamera == true ? state.cacheUsers.value[index].uid ==
UserStore.to.userInfoEntity.value!.uid
? AgoraVideoView(
controller: VideoViewController(
rtcEngine: state.rctEngine.value!,
canvas: const VideoCanvas(uid: 0, setupMode: VideoViewSetupMode.videoViewSetupAdd)
),
)
: AgoraVideoView(
controller: VideoViewController.remote(
rtcEngine: state.rctEngine.value!,
canvas: VideoCanvas(
uid: int.tryParse(
state.cacheUsers.value[index].uid), setupMode: VideoViewSetupMode.videoViewSetupAdd),
connection: RtcConnection(
channelId: state.roomNumber.value),
),
)
:
Container(
color: ColorUtil.Color_16_19_13,
child: SizedBox(
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/images/metting_main_no_person.png',
width: 78.w,
height: 84.h,
),
const SizedBox(height: 12),
Text(
'该用户未开启摄像头...',
style: TextStyle(
color: ColorUtil.Color_255_255_255,
fontSize: 10.sp
),
)
],
),
),
),
Positioned(
left: 4,
bottom: 4,
child: Row(
children: [
Visibility(
visible: state.cacheUsers.value[index].uid == UserStore.to.userInfoEntity.value!.uid,
child: Image.asset(
'assets/images/meeting_main_own.png',
width: 24.w,
height: 24.h,
),
),
Container(
height: 20,
margin: const EdgeInsets.only(left: 4),
padding:
const EdgeInsets.only(left: 4, right: 4),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: ColorUtil.Color_0_0_0_96),
child: state.cacheUsers.value[index].enableMicr == true
? Row(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
SizedBox(
width: 20.w,
height: 20.h,
child: LiquidCustomProgressIndicator(
value:
state.cacheUsers.value[index]
.volume ??
0.0,
valueColor:
const AlwaysStoppedAnimation(
ColorUtil
.Color_2_177_136),
backgroundColor:
ColorUtil.Color_255_255_255,
direction: Axis.vertical,
shapePath: ViewSvgPath
.getMicrpphonePath()),
),
Text(
state.cacheUsers.value[index].userName,
style: TextStyle(
fontSize: 12.sp,
color: ColorUtil
.Color_255_255_255),
)
],
)
: Row(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Image.asset(
'assets/images/meeting_main_microphone_open.png',
width: 20.w,
height: 20.h,
),
Text(
state.cacheUsers.value[index].userName,
style: TextStyle(
fontSize: 12.sp,
color: ColorUtil
.Color_255_255_255),
)
],
),
)
],
),
)
],
);
}),
));
return pageList[position];
}
} }

View File

@ -7,7 +7,6 @@ import Foundation
import agora_rtc_engine import agora_rtc_engine
import device_info_plus import device_info_plus
import flutter_inappwebview_macos
import geolocator_apple import geolocator_apple
import iris_method_channel import iris_method_channel
import package_info_plus import package_info_plus
@ -17,7 +16,6 @@ import sqflite_darwin
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AgoraRtcNgPlugin.register(with: registry.registrar(forPlugin: "AgoraRtcNgPlugin")) AgoraRtcNgPlugin.register(with: registry.registrar(forPlugin: "AgoraRtcNgPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
IrisMethodChannelPlugin.register(with: registry.registrar(forPlugin: "IrisMethodChannelPlugin")) IrisMethodChannelPlugin.register(with: registry.registrar(forPlugin: "IrisMethodChannelPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))

File diff suppressed because it is too large Load Diff

View File

@ -86,8 +86,7 @@ dependencies:
preload_page_view: ^0.2.0 preload_page_view: ^0.2.0
# webview # webview
#webview_flutter: ^3.0.4 webview_flutter: ^3.0.4
flutter_inappwebview: ^6.1.5
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

View File

@ -7,7 +7,6 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <agora_rtc_engine/agora_rtc_engine_plugin.h> #include <agora_rtc_engine/agora_rtc_engine_plugin.h>
#include <flutter_inappwebview_windows/flutter_inappwebview_windows_plugin_c_api.h>
#include <geolocator_windows/geolocator_windows.h> #include <geolocator_windows/geolocator_windows.h>
#include <iris_method_channel/iris_method_channel_plugin_c_api.h> #include <iris_method_channel/iris_method_channel_plugin_c_api.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h> #include <permission_handler_windows/permission_handler_windows_plugin.h>
@ -15,8 +14,6 @@
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
AgoraRtcEnginePluginRegisterWithRegistrar( AgoraRtcEnginePluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("AgoraRtcEnginePlugin")); registry->GetRegistrarForPlugin("AgoraRtcEnginePlugin"));
FlutterInappwebviewWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterInappwebviewWindowsPluginCApi"));
GeolocatorWindowsRegisterWithRegistrar( GeolocatorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("GeolocatorWindows")); registry->GetRegistrarForPlugin("GeolocatorWindows"));
IrisMethodChannelPluginCApiRegisterWithRegistrar( IrisMethodChannelPluginCApiRegisterWithRegistrar(

View File

@ -4,7 +4,6 @@
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
agora_rtc_engine agora_rtc_engine
flutter_inappwebview_windows
geolocator_windows geolocator_windows
iris_method_channel iris_method_channel
permission_handler_windows permission_handler_windows