revert commented code that were due to zoom issue
parent
cd15cf1a39
commit
12ec392fc2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1,258 +1,258 @@
|
|||||||
// import 'dart:async';
|
import 'dart:async';
|
||||||
//
|
|
||||||
// import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
// import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
// import 'package:flutter_zoom_videosdk/flutter_zoom_view.dart' as FlutterZoomView;
|
import 'package:flutter_zoom_videosdk/flutter_zoom_view.dart' as FlutterZoomView;
|
||||||
// import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart';
|
import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart';
|
||||||
//
|
|
||||||
// const SHOW_TALKING_ICON_DURATION = 2000;
|
const SHOW_TALKING_ICON_DURATION = 2000;
|
||||||
//
|
|
||||||
// class VideoView extends FlutterZoomView.ZoomView {
|
class VideoView extends FlutterZoomView.ZoomView {
|
||||||
// const VideoView({
|
const VideoView({
|
||||||
// super.key,
|
super.key,
|
||||||
// required super.user,
|
required super.user,
|
||||||
// required super.sharing,
|
required super.sharing,
|
||||||
// required super.preview,
|
required super.preview,
|
||||||
// required super.focused,
|
required super.focused,
|
||||||
// required super.hasMultiCamera,
|
required super.hasMultiCamera,
|
||||||
// required super.multiCameraIndex,
|
required super.multiCameraIndex,
|
||||||
// required super.videoAspect,
|
required super.videoAspect,
|
||||||
// required super.fullScreen,
|
required super.fullScreen,
|
||||||
// required super.resolution,
|
required super.resolution,
|
||||||
// required super.isPiPView,
|
required super.isPiPView,
|
||||||
// });
|
});
|
||||||
//
|
|
||||||
// @override
|
@override
|
||||||
// Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// var isVideoOn = useState(false);
|
var isVideoOn = useState(false);
|
||||||
// var isTalking = useState(false);
|
var isTalking = useState(false);
|
||||||
// var isMuted = useState(false);
|
var isMuted = useState(false);
|
||||||
// var isMounted = useIsMounted();
|
var isMounted = useIsMounted();
|
||||||
// var zoom = ZoomVideoSdk();
|
var zoom = ZoomVideoSdk();
|
||||||
// var isSharing = useState(false);
|
var isSharing = useState(false);
|
||||||
// user?.audioStatus?.isMuted().then((muted) => isMuted.value = muted);
|
user?.audioStatus?.isMuted().then((muted) => isMuted.value = muted);
|
||||||
//
|
|
||||||
// useEffect(() {
|
useEffect(() {
|
||||||
// updateVideoStatus() {
|
updateVideoStatus() {
|
||||||
// if (user == null) return;
|
if (user == null) return;
|
||||||
// Future<void>.microtask(() async {
|
Future<void>.microtask(() async {
|
||||||
// if (isMounted()) {
|
if (isMounted()) {
|
||||||
// isVideoOn.value = (await user!.videoStatus!.isOn());
|
isVideoOn.value = (await user!.videoStatus!.isOn());
|
||||||
// isSharing.value = sharing;
|
isSharing.value = sharing;
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// resetAudioStatus() {
|
resetAudioStatus() {
|
||||||
// isTalking.value = false;
|
isTalking.value = false;
|
||||||
// isMuted.value = false;
|
isMuted.value = false;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// updateAudioStatus() async {
|
updateAudioStatus() async {
|
||||||
// if (!isMounted()) return;
|
if (!isMounted()) return;
|
||||||
// var talking = await user?.audioStatus?.isTalking();
|
var talking = await user?.audioStatus?.isTalking();
|
||||||
// var muted = await user?.audioStatus?.isMuted();
|
var muted = await user?.audioStatus?.isMuted();
|
||||||
// isMuted.value = muted!;
|
isMuted.value = muted!;
|
||||||
// isTalking.value = talking!;
|
isTalking.value = talking!;
|
||||||
// if (talking) {
|
if (talking) {
|
||||||
// Timer(
|
Timer(
|
||||||
// const Duration(milliseconds: SHOW_TALKING_ICON_DURATION),
|
const Duration(milliseconds: SHOW_TALKING_ICON_DURATION),
|
||||||
// () => {
|
() => {
|
||||||
// if (isMounted())
|
if (isMounted())
|
||||||
// {
|
{
|
||||||
// isTalking.value = false,
|
isTalking.value = false,
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// updateVideoStatus();
|
updateVideoStatus();
|
||||||
// return null;
|
return null;
|
||||||
// }, [zoom, user]);
|
}, [zoom, user]);
|
||||||
//
|
|
||||||
// ImageIcon audioStatusIcon;
|
ImageIcon audioStatusIcon;
|
||||||
// if (isTalking.value) {
|
if (isTalking.value) {
|
||||||
// audioStatusIcon = const ImageIcon(
|
audioStatusIcon = const ImageIcon(
|
||||||
// AssetImage("assets/images/png/zoom/talking@2x.png"),
|
AssetImage("assets/images/png/zoom/talking@2x.png"),
|
||||||
// );
|
);
|
||||||
// } else if (isMuted.value) {
|
} else if (isMuted.value) {
|
||||||
// audioStatusIcon = const ImageIcon(
|
audioStatusIcon = const ImageIcon(
|
||||||
// AssetImage("assets/images/png/zoom/muted@2x.png"),
|
AssetImage("assets/images/png/zoom/muted@2x.png"),
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
// // Pass parameters to the platform side.
|
// Pass parameters to the platform side.
|
||||||
// final Map<String, dynamic> creationParams = <String, dynamic>{};
|
final Map<String, dynamic> creationParams = <String, dynamic>{};
|
||||||
// creationParams.putIfAbsent("userId", () => user?.userId);
|
creationParams.putIfAbsent("userId", () => user?.userId);
|
||||||
// creationParams.putIfAbsent("sharing", () => sharing);
|
creationParams.putIfAbsent("sharing", () => sharing);
|
||||||
// creationParams.putIfAbsent("preview", () => preview);
|
creationParams.putIfAbsent("preview", () => preview);
|
||||||
// creationParams.putIfAbsent("focused", () => focused);
|
creationParams.putIfAbsent("focused", () => focused);
|
||||||
// creationParams.putIfAbsent("hasMultiCamera", () => hasMultiCamera);
|
creationParams.putIfAbsent("hasMultiCamera", () => hasMultiCamera);
|
||||||
// if (videoAspect.isEmpty) {
|
if (videoAspect.isEmpty) {
|
||||||
// creationParams.putIfAbsent("videoAspect", () => VideoAspect.PanAndScan);
|
creationParams.putIfAbsent("videoAspect", () => VideoAspect.PanAndScan);
|
||||||
// } else {
|
} else {
|
||||||
// creationParams.putIfAbsent("videoAspect", () => videoAspect);
|
creationParams.putIfAbsent("videoAspect", () => videoAspect);
|
||||||
// }
|
}
|
||||||
// creationParams.putIfAbsent("fullScreen", () => fullScreen);
|
creationParams.putIfAbsent("fullScreen", () => fullScreen);
|
||||||
// if (resolution.isNotEmpty) {
|
if (resolution.isNotEmpty) {
|
||||||
// creationParams.putIfAbsent("videoAspect", () => videoAspect);
|
creationParams.putIfAbsent("videoAspect", () => videoAspect);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// if (fullScreen) {
|
if (fullScreen) {
|
||||||
// if (sharing) {
|
if (sharing) {
|
||||||
// return Container(
|
return Container(
|
||||||
// height: MediaQuery.of(context).size.height,
|
height: MediaQuery.of(context).size.height,
|
||||||
// width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
// alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
// child: FlutterZoomView.View(creationParams: creationParams),
|
child: FlutterZoomView.View(creationParams: creationParams),
|
||||||
// );
|
);
|
||||||
// } else if (isVideoOn.value) {
|
} else if (isVideoOn.value) {
|
||||||
// return Container(
|
return Container(
|
||||||
// height: MediaQuery.of(context).size.height,
|
height: MediaQuery.of(context).size.height,
|
||||||
// width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
// alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
// child: FlutterZoomView.View(creationParams: creationParams),
|
child: FlutterZoomView.View(creationParams: creationParams),
|
||||||
// );
|
);
|
||||||
// } else {
|
} else {
|
||||||
// return Container(
|
return Container(
|
||||||
// margin: const EdgeInsets.symmetric(vertical: 0),
|
margin: const EdgeInsets.symmetric(vertical: 0),
|
||||||
// child: Container(
|
child: Container(
|
||||||
// alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
// child: const Image(
|
child: const Image(
|
||||||
// image: AssetImage("assets/images/png/zoom/default-avatar.png"),
|
image: AssetImage("assets/images/png/zoom/default-avatar.png"),
|
||||||
// )),
|
)),
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
// } else {
|
} else {
|
||||||
// if (isVideoOn.value || sharing) {
|
if (isVideoOn.value || sharing) {
|
||||||
// return Container(
|
return Container(
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
// height: 110,
|
height: 110,
|
||||||
// width: 110,
|
width: 110,
|
||||||
// child: Stack(
|
child: Stack(
|
||||||
// children: [
|
children: [
|
||||||
// Container(
|
Container(
|
||||||
// height: 110,
|
height: 110,
|
||||||
// width: 110,
|
width: 110,
|
||||||
// decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
// color: const Color(0xff232323),
|
color: const Color(0xff232323),
|
||||||
// border: Border.all(
|
border: Border.all(
|
||||||
// color: const Color(0xff666666),
|
color: const Color(0xff666666),
|
||||||
// width: 1,
|
width: 1,
|
||||||
// ),
|
),
|
||||||
// borderRadius: const BorderRadius.all(Radius.circular(8)),
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
// ),
|
),
|
||||||
// alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
// child: FlutterZoomView.View(creationParams: creationParams),
|
child: FlutterZoomView.View(creationParams: creationParams),
|
||||||
// ),
|
),
|
||||||
// Container(
|
Container(
|
||||||
// height: 110,
|
height: 110,
|
||||||
// width: 110,
|
width: 110,
|
||||||
// decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
// borderRadius: BorderRadius.all(Radius.circular(8)),
|
borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// Container(
|
Container(
|
||||||
// alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
// child: Container(
|
child: Container(
|
||||||
// height: 20,
|
height: 20,
|
||||||
// width: 110,
|
width: 110,
|
||||||
// decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
// color: Colors.black26,
|
color: Colors.black26,
|
||||||
// borderRadius: BorderRadius.all(Radius.circular(8)),
|
borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// Container(
|
Container(
|
||||||
// alignment: Alignment.bottomLeft,
|
alignment: Alignment.bottomLeft,
|
||||||
// margin: const EdgeInsets.only(left: 5),
|
margin: const EdgeInsets.only(left: 5),
|
||||||
// child: Text(
|
child: Text(
|
||||||
// user!.userName,
|
user!.userName,
|
||||||
// textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
// style: const TextStyle(
|
style: const TextStyle(
|
||||||
// color: Colors.white,
|
color: Colors.white,
|
||||||
// fontSize: 12,
|
fontSize: 12,
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// Container(
|
Container(
|
||||||
// alignment: Alignment.bottomRight,
|
alignment: Alignment.bottomRight,
|
||||||
// margin: const EdgeInsets.only(right: 5, bottom: 5),
|
margin: const EdgeInsets.only(right: 5, bottom: 5),
|
||||||
// // height: 110,
|
// height: 110,
|
||||||
// // width: 110,
|
// width: 110,
|
||||||
// child: Image(
|
child: Image(
|
||||||
// height: 12,
|
height: 12,
|
||||||
// width: 12,
|
width: 12,
|
||||||
// image: isMuted.value ? const AssetImage("assets/images/png/zoom/muted@2x.png") : const AssetImage("assets/images/png/zoom/talking@2x.png"),
|
image: isMuted.value ? const AssetImage("assets/images/png/zoom/muted@2x.png") : const AssetImage("assets/images/png/zoom/talking@2x.png"),
|
||||||
// fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
// ),
|
),
|
||||||
// )
|
)
|
||||||
// ],
|
],
|
||||||
// ),
|
),
|
||||||
// );
|
);
|
||||||
// } else {
|
} else {
|
||||||
// return Container(
|
return Container(
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
// height: 110,
|
height: 110,
|
||||||
// width: 110,
|
width: 110,
|
||||||
// child: Stack(
|
child: Stack(
|
||||||
// children: [
|
children: [
|
||||||
// Container(
|
Container(
|
||||||
// height: 110,
|
height: 110,
|
||||||
// width: 110,
|
width: 110,
|
||||||
// decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
// color: const Color(0xff232323),
|
color: const Color(0xff232323),
|
||||||
// border: Border.all(
|
border: Border.all(
|
||||||
// color: const Color(0xff666666),
|
color: const Color(0xff666666),
|
||||||
// width: 1,
|
width: 1,
|
||||||
// ),
|
),
|
||||||
// borderRadius: const BorderRadius.all(Radius.circular(8)),
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
// ),
|
),
|
||||||
// alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
// child: Container(
|
child: Container(
|
||||||
// alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
// child: const Image(
|
child: const Image(
|
||||||
// height: 60,
|
height: 60,
|
||||||
// width: 60,
|
width: 60,
|
||||||
// image: AssetImage("assets/images/png/zoom/default-avatar.png"),
|
image: AssetImage("assets/images/png/zoom/default-avatar.png"),
|
||||||
// )),
|
)),
|
||||||
// ),
|
),
|
||||||
// Align(
|
Align(
|
||||||
// alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
// child: Container(
|
child: Container(
|
||||||
// height: 20,
|
height: 20,
|
||||||
// width: 110,
|
width: 110,
|
||||||
// decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
// color: Colors.black26,
|
color: Colors.black26,
|
||||||
// borderRadius: BorderRadius.all(Radius.circular(8)),
|
borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// Container(
|
Container(
|
||||||
// alignment: Alignment.bottomLeft,
|
alignment: Alignment.bottomLeft,
|
||||||
// margin: const EdgeInsets.only(left: 5),
|
margin: const EdgeInsets.only(left: 5),
|
||||||
// child: Text(
|
child: Text(
|
||||||
// user!.userName,
|
user!.userName,
|
||||||
// textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
// style: const TextStyle(
|
style: const TextStyle(
|
||||||
// color: Colors.white,
|
color: Colors.white,
|
||||||
// fontSize: 12,
|
fontSize: 12,
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// Container(
|
Container(
|
||||||
// alignment: Alignment.bottomRight,
|
alignment: Alignment.bottomRight,
|
||||||
// margin: const EdgeInsets.only(right: 5, bottom: 5),
|
margin: const EdgeInsets.only(right: 5, bottom: 5),
|
||||||
// child: Image(
|
child: Image(
|
||||||
// height: 12,
|
height: 12,
|
||||||
// width: 12,
|
width: 12,
|
||||||
// image: isMuted.value ? const AssetImage("assets/images/png/zoom/muted@2x.png") : const AssetImage("assets/images/png/zoom/talking@2x.png"),
|
image: isMuted.value ? const AssetImage("assets/images/png/zoom/muted@2x.png") : const AssetImage("assets/images/png/zoom/talking@2x.png"),
|
||||||
// fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// ],
|
],
|
||||||
// ),
|
),
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue