зеркало из https://github.com/nextcloud/spreed.git
The webrtc library already keeps state lets use that
The webrtc lib already holds the video and audio state (of the local video). We should make use of this to avoid getting out of sync for whatever reason. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Родитель
0255dffa4e
Коммит
37dcc6c6cd
22
js/app.js
22
js/app.js
|
@ -128,28 +128,22 @@
|
|||
});
|
||||
});
|
||||
|
||||
var videoHidden = false;
|
||||
$('#hideVideo').click(function() {
|
||||
if (videoHidden) {
|
||||
OCA.SpreedMe.webrtc.resumeVideo();
|
||||
$(this).data('title', 'Disable video').removeClass('video-disabled');
|
||||
videoHidden = false;
|
||||
} else {
|
||||
if (OCA.SpreedMe.webrtc.webrtc.isVideoEnabled()) {
|
||||
OCA.SpreedMe.webrtc.pauseVideo();
|
||||
$(this).data('title', 'Enable video').addClass('video-disabled');
|
||||
videoHidden = true;
|
||||
} else {
|
||||
OCA.SpreedMe.webrtc.resumeVideo();
|
||||
$(this).data('title', 'Disable video').removeClass('video-disabled');
|
||||
}
|
||||
});
|
||||
var audioMuted = false;
|
||||
$('#mute').click(function() {
|
||||
if (audioMuted) {
|
||||
OCA.SpreedMe.webrtc.unmute();
|
||||
$(this).data('title', 'Mute audio').removeClass('audio-disabled');
|
||||
audioMuted = false;
|
||||
} else {
|
||||
if (OCA.SpreedMe.webrtc.webrtc.isAudioEnabled()) {
|
||||
OCA.SpreedMe.webrtc.mute();
|
||||
$(this).data('title', 'Enable audio').addClass('audio-disabled');
|
||||
audioMuted = true;
|
||||
} else {
|
||||
OCA.SpreedMe.webrtc.unmute();
|
||||
$(this).data('title', 'Mute audio').removeClass('audio-disabled');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче