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/08/25 01:54:47 UTC

openmeetings git commit: [OPENMEETINGS-1644] volume button handling is improved

Repository: openmeetings
Updated Branches:
  refs/heads/master 88b7b5228 -> 8914bf4c2


[OPENMEETINGS-1644] volume button handling is improved


Project: http://git-wip-us.apache.org/repos/asf/openmeetings/repo
Commit: http://git-wip-us.apache.org/repos/asf/openmeetings/commit/8914bf4c
Tree: http://git-wip-us.apache.org/repos/asf/openmeetings/tree/8914bf4c
Diff: http://git-wip-us.apache.org/repos/asf/openmeetings/diff/8914bf4c

Branch: refs/heads/master
Commit: 8914bf4c2df07aec080cb200eb522cfd1f2cf520
Parents: 88b7b52
Author: Maxim Solodovnik <so...@gmail.com>
Authored: Fri Aug 25 08:54:38 2017 +0700
Committer: Maxim Solodovnik <so...@gmail.com>
Committed: Fri Aug 25 08:54:38 2017 +0700

----------------------------------------------------------------------
 .../apache/openmeetings/web/room/RoomPanel.html |  2 +-
 .../org/apache/openmeetings/web/room/room.js    | 35 ++++++++++++++++----
 2 files changed, 29 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8914bf4c/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.html
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.html
index d19ef2c..64b6077 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.html
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.html
@@ -53,7 +53,7 @@
 		</div>
 		<div id="video-volume-btn">
 			<a class="ui-dialog-titlebar-volume ui-corner-all ui-state-default" href="#" wicket:message="title:volume.label" role="button" data-toggle="dropdown">
-				<span class="ui-icon ui-icon-volume-off"><wicket:message key="volume.label"/></span>
+				<span class="ui-icon ui-icon-volume-on"><wicket:message key="volume.label"/></span>
 			</a>
 			<ul class="dropdown-menu video volume">
 				<li>

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8914bf4c/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 076e863..75f4dfb 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
@@ -156,6 +156,19 @@ var Video = (function() {
 		vc.width(w).height(h);
 		swf.attr('width', w).attr('height', h);
 	}
+	function _handleVolume(handle, val) {
+		handle.text(val);
+		var ico = vol.find('.ui-icon');
+		if (val > 0 && ico.hasClass('ui-icon-volume-off')) {
+			//vol.find('.ui-icon').removeClass('ui-icon-volume-off').addClass('ui-icon-volume-on');
+			ico.toggleClass('ui-icon-volume-off ui-icon-volume-on');
+			vol.removeClass('ui-state-error');
+		} 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');
+		}
+		swf[0].setVolume(val);
+	}
 	function _init(_box, _uid, _c, _pos) {
 		c = _c;
 		box = _box;
@@ -193,11 +206,20 @@ var Video = (function() {
 		if (!VideoUtil.isSharing(c)) {
 			v.parent().find('.ui-dialog-titlebar-buttonpane').append($('#video-volume-btn').children().clone());
 			var volume = v.parent().find('.dropdown-menu.video.volume');
-			vol = v.parent().find('.ui-dialog-titlebar-volume').click(function(e) {
-				e.stopImmediatePropagation();
-				volume.toggle();
-			}).dblclick(function(e) {
-				e.stopImmediatePropagation();
+			vol = v.parent().find('.ui-dialog-titlebar-volume')
+				.on('mouseenter', function(e) {
+					e.stopImmediatePropagation();
+					volume.toggle();
+				})
+				.click(function(e) {
+					//MUTE
+					e.stopImmediatePropagation();
+					//volume.toggle();
+				}).dblclick(function(e) {
+					e.stopImmediatePropagation();
+				});
+			volume.on('mouseout', function() {
+				$(this).hide();
 			});
 			var handle = v.parent().find('.slider .handle');
 			v.parent().find('.slider').slider({
@@ -210,8 +232,7 @@ var Video = (function() {
 					handle.text($(this).slider("value"));
 				}
 				, slide: function(event, ui) {
-					handle.text(ui.value);
-					swf[0].setVolume(ui.value);
+					_handleVolume(handle, ui.value);
 				}
 			});
 			if (!VideoUtil.hasAudio(c)) {