admin管理员组文章数量:1125443
I'm trying to build a video calling feature in my Flutter app using Agora.
i am trying to use agora_rtc for video call , the black part above is camera where use can see him self, this feature works will on anroid but in ios appear black screen and no camera opened i setup all permissions for both ios and android anyone can help me with thatenter image description here My code is as follows:
import 'package:flutter/foundation.dart';
import 'package:agora_rtc_engine/agora_rtc_engine.dart';
import 'package:permission_handler/permission_handler.dart';
import 'dart:async';
import 'package:flutter_svg/flutter_svg.dart';
class VideoChatWidget extends StatefulWidget {
const VideoChatWidget({
super.key,
this.width,
this.height,
required this.channelName,
required this.appId,
required this.token,
required this.userData,
});
final double? width;
final double? height;
final String channelName;
final String appId;
final String token;
final ChatsStruct userData;
@override
State<VideoChatWidget> createState() => _VideoChatWidgetState();
}
class _VideoChatWidgetState extends State<VideoChatWidget> {
bool isCameraOff = false;
bool isMuted = false;
late RtcEngine _engine;
bool _localUserJoined = true;
int? _remoteUid;
Timer? _callTimer;
Duration _callDuration = Duration(seconds: 0);
@override
void initState() {
super.initState();
initializeAgora();
_startCallTimer();
}
Future<void> initializeAgora() async {
if (!kIsWeb) {
final permissions =
await [Permission.microphone, Permission.camera].request();
if (permissions.values
.any((status) => status != PermissionStatus.granted)) {
print("Permissions not granted");
return;
}
}
print('
本文标签:
flutterAgorartc camera isnot work on ios deviceStack Overflow
版权声明:本文标题:flutter - Agora_rtc camera isnot work on ios device - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人,
转载请联系作者并注明出处:http://www.betaflare.com/web/1736659397a1946339.html,
本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论