|
@@ -223,7 +223,7 @@ $(document).bind('remotestreamadded.jingle', function (event, data, sid) {
|
223
|
223
|
var sess = connection.jingle.sessions[sid];
|
224
|
224
|
if (data.stream.id === 'mixedmslabel') return;
|
225
|
225
|
var videoTracks = data.stream.getVideoTracks();
|
226
|
|
- console.log("waiting..", videoTracks, selector[0]);
|
|
226
|
+// console.log("waiting..", videoTracks, selector[0]);
|
227
|
227
|
|
228
|
228
|
if (videoTracks.length === 0 || selector[0].currentTime > 0) {
|
229
|
229
|
RTC.attachMediaStream(selector, data.stream); // FIXME: why do i have to do this for FF?
|
|
@@ -673,6 +673,32 @@ $(document).bind('passwordrequired.muc', function (event, jid) {
|
673
|
673
|
});
|
674
|
674
|
});
|
675
|
675
|
|
|
676
|
+$(document).bind('audiomuted.muc', function (event, jid, isMuted) {
|
|
677
|
+ var videoSpanId = null;
|
|
678
|
+ if (jid === connection.emuc.myroomjid) {
|
|
679
|
+ videoSpanId = 'localVideoContainer';
|
|
680
|
+ } else {
|
|
681
|
+ ensurePeerContainerExists(jid);
|
|
682
|
+ videoSpanId = 'participant_' + Strophe.getResourceFromJid(jid);
|
|
683
|
+ }
|
|
684
|
+
|
|
685
|
+ if (videoSpanId)
|
|
686
|
+ showAudioIndicator(videoSpanId, isMuted);
|
|
687
|
+});
|
|
688
|
+
|
|
689
|
+$(document).bind('videomuted.muc', function (event, jid, isMuted) {
|
|
690
|
+ var videoSpanId = null;
|
|
691
|
+ if (jid === connection.emuc.myroomjid) {
|
|
692
|
+ videoSpanId = 'localVideoContainer';
|
|
693
|
+ } else {
|
|
694
|
+ ensurePeerContainerExists(jid);
|
|
695
|
+ videoSpanId = 'participant_' + Strophe.getResourceFromJid(jid);
|
|
696
|
+ }
|
|
697
|
+
|
|
698
|
+ if (videoSpanId)
|
|
699
|
+ showAudioIndicator(videoSpanId, isMuted);
|
|
700
|
+});
|
|
701
|
+
|
676
|
702
|
/**
|
677
|
703
|
* Updates the large video with the given new video source.
|
678
|
704
|
*/
|
|
@@ -744,11 +770,11 @@ function isVideoSrcDesktop(videoSrc){
|
744
|
770
|
function setLargeVideoVisible(isVisible) {
|
745
|
771
|
if (isVisible) {
|
746
|
772
|
$('#largeVideo').css({visibility:'visible'});
|
747
|
|
- $('#watermark').css({visibility:'visible'});
|
|
773
|
+ $('.watermark').css({visibility:'visible'});
|
748
|
774
|
}
|
749
|
775
|
else {
|
750
|
776
|
$('#largeVideo').css({visibility:'hidden'});
|
751
|
|
- $('#watermark').css({visibility:'hidden'});
|
|
777
|
+ $('.watermark').css({visibility:'hidden'});
|
752
|
778
|
}
|
753
|
779
|
}
|
754
|
780
|
|
|
@@ -757,35 +783,49 @@ function getConferenceHandler() {
|
757
|
783
|
}
|
758
|
784
|
|
759
|
785
|
function toggleVideo() {
|
760
|
|
- if (!(connection && connection.jingle.localVideo)) return;
|
|
786
|
+ if (!(connection && connection.jingle.localVideo))
|
|
787
|
+ return;
|
761
|
788
|
|
762
|
789
|
var sess = getConferenceHandler();
|
763
|
790
|
if (sess) {
|
764
|
791
|
sess.toggleVideoMute(
|
765
|
792
|
function(isMuted){
|
766
|
793
|
if(isMuted) {
|
767
|
|
- $('#video').removeClass("fa fa-video-camera fa-lg");
|
768
|
|
- $('#video').addClass("fa fa-video-camera no-fa-video-camera fa-lg");
|
|
794
|
+ $('#video').removeClass("icon-camera");
|
|
795
|
+ $('#video').addClass("icon-camera icon-camera-disabled");
|
769
|
796
|
} else {
|
770
|
|
- $('#video').removeClass("fa fa-video-camera no-fa-video-camera fa-lg");
|
771
|
|
- $('#video').addClass("fa fa-video-camera fa-lg");
|
|
797
|
+ $('#video').removeClass("icon-camera icon-camera-disabled");
|
|
798
|
+ $('#video').addClass("icon-camera");
|
772
|
799
|
}
|
773
|
800
|
}
|
774
|
801
|
);
|
775
|
802
|
}
|
|
803
|
+
|
776
|
804
|
var sess = focus || activecall;
|
777
|
805
|
if (!sess) {
|
778
|
806
|
return;
|
779
|
807
|
}
|
|
808
|
+
|
780
|
809
|
sess.pendingop = ismuted ? 'unmute' : 'mute';
|
|
810
|
+// connection.emuc.addVideoInfoToPresence(!ismuted);
|
|
811
|
+// connection.emuc.sendPresence();
|
|
812
|
+
|
781
|
813
|
sess.modifySources();
|
782
|
814
|
}
|
783
|
815
|
|
|
816
|
+/**
|
|
817
|
+ * Mutes / unmutes audio for the local participant.
|
|
818
|
+ */
|
784
|
819
|
function toggleAudio() {
|
785
|
|
- if (!(connection && connection.jingle.localAudio)) return;
|
|
820
|
+ if (!(connection && connection.jingle.localAudio))
|
|
821
|
+ return;
|
786
|
822
|
var localAudio = connection.jingle.localAudio;
|
787
|
823
|
for (var idx = 0; idx < localAudio.getAudioTracks().length; idx++) {
|
788
|
|
- localAudio.getAudioTracks()[idx].enabled = !localAudio.getAudioTracks()[idx].enabled;
|
|
824
|
+ var audioEnabled = localAudio.getAudioTracks()[idx].enabled;
|
|
825
|
+
|
|
826
|
+ localAudio.getAudioTracks()[idx].enabled = !audioEnabled;
|
|
827
|
+ connection.emuc.addAudioInfoToPresence(audioEnabled); //isMuted is the opposite of audioEnabled
|
|
828
|
+ connection.emuc.sendPresence();
|
789
|
829
|
}
|
790
|
830
|
}
|
791
|
831
|
|
|
@@ -1561,6 +1601,62 @@ function createEditDisplayNameButton() {
|
1561
|
1601
|
return editButton;
|
1562
|
1602
|
}
|
1563
|
1603
|
|
|
1604
|
+/**
|
|
1605
|
+ * Shows audio muted indicator over small videos.
|
|
1606
|
+ */
|
|
1607
|
+function showAudioIndicator(videoSpanId, isMuted) {
|
|
1608
|
+ var audioMutedSpan = $('#' + videoSpanId + '>span.audioMuted');
|
|
1609
|
+
|
|
1610
|
+ if (isMuted === 'false') {
|
|
1611
|
+ if (audioMutedSpan.length > 0) {
|
|
1612
|
+ audioMutedSpan.remove();
|
|
1613
|
+ }
|
|
1614
|
+ }
|
|
1615
|
+ else {
|
|
1616
|
+ var videoMutedSpan = $('#' + videoSpanId + '>span.videoMuted');
|
|
1617
|
+
|
|
1618
|
+ audioMutedSpan = document.createElement('span');
|
|
1619
|
+ audioMutedSpan.className = 'audioMuted';
|
|
1620
|
+ if (videoMutedSpan) {
|
|
1621
|
+ audioMutedSpan.right = '30px';
|
|
1622
|
+ }
|
|
1623
|
+ $('#' + videoSpanId)[0].appendChild(audioMutedSpan);
|
|
1624
|
+
|
|
1625
|
+ var mutedIndicator = document.createElement('i');
|
|
1626
|
+ mutedIndicator.className = 'icon-mic-disabled';
|
|
1627
|
+ mutedIndicator.title = "Participant is muted";
|
|
1628
|
+ audioMutedSpan.appendChild(mutedIndicator);
|
|
1629
|
+ }
|
|
1630
|
+}
|
|
1631
|
+
|
|
1632
|
+/**
|
|
1633
|
+ * Shows video muted indicator over small videos.
|
|
1634
|
+ */
|
|
1635
|
+function showVideoIndicator(videoSpanId, isMuted) {
|
|
1636
|
+ var videoMutedSpan = $('#' + videoSpanId + '>span.videoMuted');
|
|
1637
|
+
|
|
1638
|
+ if (isMuted === 'false') {
|
|
1639
|
+ if (videoMutedSpan.length > 0) {
|
|
1640
|
+ videoMutedSpan.remove();
|
|
1641
|
+ }
|
|
1642
|
+ }
|
|
1643
|
+ else {
|
|
1644
|
+ var audioMutedSpan = $('#' + videoSpanId + '>span.audioMuted');
|
|
1645
|
+
|
|
1646
|
+ videoMutedSpan = document.createElement('span');
|
|
1647
|
+ videoMutedSpan.className = 'videoMuted';
|
|
1648
|
+ if (audioMutedSpan) {
|
|
1649
|
+ videoMutedSpan.right = '30px';
|
|
1650
|
+ }
|
|
1651
|
+ $('#' + videoSpanId)[0].appendChild(videoMutedSpan);
|
|
1652
|
+
|
|
1653
|
+ var mutedIndicator = document.createElement('i');
|
|
1654
|
+ mutedIndicator.className = 'icon-camera-disabled';
|
|
1655
|
+ mutedIndicator.title = "Participant has stopped the camera.";
|
|
1656
|
+ videoMutedSpan.appendChild(mutedIndicator);
|
|
1657
|
+ }
|
|
1658
|
+}
|
|
1659
|
+
|
1564
|
1660
|
/**
|
1565
|
1661
|
* Resizes and repositions videos in full screen mode.
|
1566
|
1662
|
*/
|