You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2017/09/22 05:29:44 UTC
openmeetings git commit: [OPENMEETINGS-1644] mic status is improved
Repository: openmeetings
Updated Branches:
refs/heads/master 9f8fb3540 -> d12cf904e
[OPENMEETINGS-1644] mic status is improved
Project: http://git-wip-us.apache.org/repos/asf/openmeetings/repo
Commit: http://git-wip-us.apache.org/repos/asf/openmeetings/commit/d12cf904
Tree: http://git-wip-us.apache.org/repos/asf/openmeetings/tree/d12cf904
Diff: http://git-wip-us.apache.org/repos/asf/openmeetings/diff/d12cf904
Branch: refs/heads/master
Commit: d12cf904e3328aa835317cbee37d542aaa547a21
Parents: 9f8fb35
Author: Maxim Solodovnik <so...@gmail.com>
Authored: Fri Sep 22 12:29:37 2017 +0700
Committer: Maxim Solodovnik <so...@gmail.com>
Committed: Fri Sep 22 12:29:37 2017 +0700
----------------------------------------------------------------------
.../org/apache/openmeetings/web/room/room.js | 39 ++++++++++++--------
1 file changed, 24 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/d12cf904/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
index a57c1c6..a505865 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
@@ -140,27 +140,33 @@ var Video = (function() {
vc.width(w).height(h);
swf.attr('width', w).attr('height', h);
}
+ function _handleMicStatus(state) {
+ if (!f.is(":visible")) {
+ return;
+ }
+ if (state) {
+ f.find('.off').hide();
+ f.find('.on').show();
+ f.addClass('ui-state-highlight');
+ t.addClass('ui-state-highlight');
+ } else {
+ f.find('.off').show();
+ f.find('.on').hide();
+ f.removeClass('ui-state-highlight');
+ t.removeClass('ui-state-highlight');
+ }
+ }
function _handleVolume(val) {
handle.text(val);
var ico = vol.find('.ui-icon');
if (val > 0 && ico.hasClass('ui-icon-volume-off')) {
ico.toggleClass('ui-icon-volume-off ui-icon-volume-on');
vol.removeClass('ui-state-error');
- if (f.is(":visible")) {
- f.find('.off').hide();
- f.find('.on').show();
- f.addClass('ui-state-highlight');
- t.addClass('ui-state-highlight');
- }
+ _handleMicStatus(true);
} else if (val == 0 && ico.hasClass('ui-icon-volume-on')) {
ico.toggleClass('ui-icon-volume-on ui-icon-volume-off');
vol.addClass('ui-state-error');
- if (f.is(":visible")) {
- f.find('.off').show();
- f.find('.on').hide();
- f.removeClass('ui-state-highlight');
- t.removeClass('ui-state-highlight');
- }
+ _handleMicStatus(false);
}
if (swf[0].setVolume !== undefined) {
swf[0].setVolume(val);
@@ -280,10 +286,11 @@ var Video = (function() {
_handleVolume(ui.value);
}
});
- if (!VideoUtil.hasAudio(c)) {
+ let hasAudio = VideoUtil.hasAudio(c);
+ _handleMicStatus(hasAudio);
+ if (!hasAudio) {
vol.hide();
}
- //TODO add mute, ADD refresh
}
vc = v.find('.video');
vc.width(_w).height(_h);
@@ -315,7 +322,9 @@ var Video = (function() {
var opts = Room.getOptions();
c.screenActivities = _c.screenActivities;
c.activities = _c.activities;
- if (VideoUtil.hasAudio(c)) {
+ let hasAudio = VideoUtil.hasAudio(c);
+ _handleMicStatus(hasAudio);
+ if (hasAudio) {
vol.show();
} else {
vol.hide();