切换前置/后置摄像头

This commit is contained in:
fuenmao 2024-12-02 15:08:19 +08:00
parent 535eb2e54e
commit c3e394255a
2 changed files with 22 additions and 9 deletions

View File

@ -579,4 +579,9 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
await state.rctEngine.value?.stopPreview();
}
}
/// /
Future<void> switchCamera() async {
await state.rctEngine.value?.switchCamera();
}
}

View File

@ -72,15 +72,23 @@ class MeetingMainPage extends StatelessWidget {
}
},
),
Row(
children: [
SizedBox(width: 16.w),
Image.asset(
'assets/images/meeting_main_rotate_camera.png',
width: 20.w,
height: 20.h,
)
],
Visibility(
visible: state.isOpenCamera.value,
child: GestureDetector(
child: Row(
children: [
SizedBox(width: 16.w),
Image.asset(
'assets/images/meeting_main_rotate_camera.png',
width: 20.w,
height: 20.h,
)
],
),
onTap: (){
logic.switchCamera();
},
),
)
],
),