mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Show error if camera could not be enabled.
This commit is contained in:
parent
b29f8aa1e6
commit
14a2b10989
5 changed files with 16 additions and 2 deletions
|
@ -2030,6 +2030,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_group_call_chat_no_camera" = "You can't turn on video in this chat.";
|
"lng_group_call_chat_no_camera" = "You can't turn on video in this chat.";
|
||||||
"lng_group_call_chat_no_screen" = "You can't share your screen in this chat.";
|
"lng_group_call_chat_no_screen" = "You can't share your screen in this chat.";
|
||||||
"lng_group_call_failed_screen" = "An error occured. Screencast has stopped.";
|
"lng_group_call_failed_screen" = "An error occured. Screencast has stopped.";
|
||||||
|
"lng_group_call_failed_camera" = "Could not enable camera. Perhaps another app is using the camera already. Try closing other apps.";
|
||||||
"lng_group_call_tooltip_screen" = "Share screen";
|
"lng_group_call_tooltip_screen" = "Share screen";
|
||||||
"lng_group_call_tooltip_camera" = "Your camera is off. Click here to enable camera.";
|
"lng_group_call_tooltip_camera" = "Your camera is off. Click here to enable camera.";
|
||||||
"lng_group_call_tooltip_microphone" = "You are on mute. Click here to speak.";
|
"lng_group_call_tooltip_microphone" = "You are on mute. Click here to speak.";
|
||||||
|
|
|
@ -1989,6 +1989,10 @@ bool GroupCall::emitShareCameraError() {
|
||||||
|
|
||||||
void GroupCall::emitShareCameraError(Error error) {
|
void GroupCall::emitShareCameraError(Error error) {
|
||||||
_cameraState = Webrtc::VideoState::Inactive;
|
_cameraState = Webrtc::VideoState::Inactive;
|
||||||
|
if (error == Error::CameraFailed
|
||||||
|
&& Webrtc::GetVideoInputList().empty()) {
|
||||||
|
error = Error::NoCamera;
|
||||||
|
}
|
||||||
_errors.fire_copy(error);
|
_errors.fire_copy(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2042,8 +2046,14 @@ void GroupCall::setupOutgoingVideo() {
|
||||||
_cameraCapture = _delegate->groupCallGetVideoCapture(
|
_cameraCapture = _delegate->groupCallGetVideoCapture(
|
||||||
_cameraInputId);
|
_cameraInputId);
|
||||||
if (!_cameraCapture) {
|
if (!_cameraCapture) {
|
||||||
return emitShareCameraError(Error::NoCamera);
|
return emitShareCameraError(Error::CameraFailed);
|
||||||
}
|
}
|
||||||
|
const auto weak = base::make_weak(this);
|
||||||
|
_cameraCapture->setOnFatalError([=] {
|
||||||
|
crl::on_main(weak, [=] {
|
||||||
|
emitShareCameraError(Error::CameraFailed);
|
||||||
|
});
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
_cameraCapture->switchToDevice(_cameraInputId.toStdString());
|
_cameraCapture->switchToDevice(_cameraInputId.toStdString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,7 @@ enum class VideoQuality {
|
||||||
|
|
||||||
enum class Error {
|
enum class Error {
|
||||||
NoCamera,
|
NoCamera,
|
||||||
|
CameraFailed,
|
||||||
ScreenFailed,
|
ScreenFailed,
|
||||||
MutedNoCamera,
|
MutedNoCamera,
|
||||||
MutedNoScreen,
|
MutedNoScreen,
|
||||||
|
|
|
@ -155,6 +155,8 @@ void Toasts::setupError() {
|
||||||
const auto key = [&] {
|
const auto key = [&] {
|
||||||
switch (error) {
|
switch (error) {
|
||||||
case Error::NoCamera: return tr::lng_call_error_no_camera;
|
case Error::NoCamera: return tr::lng_call_error_no_camera;
|
||||||
|
case Error::CameraFailed:
|
||||||
|
return tr::lng_group_call_failed_camera;
|
||||||
case Error::ScreenFailed:
|
case Error::ScreenFailed:
|
||||||
return tr::lng_group_call_failed_screen;
|
return tr::lng_group_call_failed_screen;
|
||||||
case Error::MutedNoCamera:
|
case Error::MutedNoCamera:
|
||||||
|
|
2
Telegram/ThirdParty/tgcalls
vendored
2
Telegram/ThirdParty/tgcalls
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit c17d4326200e5f544fa73addaa41c20c02d07dbd
|
Subproject commit 22331d17e2e52dd21c6563f3e37ed74864be9584
|
Loading…
Add table
Reference in a new issue