|
|
@@ -23,16 +23,16 @@ function onAvatarDisplayed(shown) {
|
|
23
|
23
|
class RingOverlay {
|
|
24
|
24
|
/**
|
|
25
|
25
|
* @param callee instance of User class from TokenData.js
|
|
26
|
|
- * @param {boolean} dontPlayAudio if true the ringing sound wont be played.
|
|
|
26
|
+ * @param {boolean} disableRingingSound if true the ringing sound wont be played.
|
|
27
|
27
|
*/
|
|
28
|
|
- constructor(callee, dontPlayAudio) {
|
|
|
28
|
+ constructor(callee, disableRingingSound) {
|
|
29
|
29
|
this._containerId = 'ringOverlay';
|
|
30
|
30
|
this._audioContainerId = 'ringOverlayRinging';
|
|
31
|
31
|
this.isRinging = true;
|
|
32
|
32
|
this.callee = callee;
|
|
33
|
|
- this.dontPlayAudio = dontPlayAudio;
|
|
|
33
|
+ this.disableRingingSound = disableRingingSound;
|
|
34
|
34
|
this.render();
|
|
35
|
|
- if(!dontPlayAudio)
|
|
|
35
|
+ if(!disableRingingSound)
|
|
36
|
36
|
this._initAudio();
|
|
37
|
37
|
this._timeout = setTimeout(() => {
|
|
38
|
38
|
this.destroy();
|
|
|
@@ -68,10 +68,11 @@ class RingOverlay {
|
|
68
|
68
|
* Builds and appends the ring overlay to the html document
|
|
69
|
69
|
*/
|
|
70
|
70
|
_getHtmlStr(callee) {
|
|
71
|
|
- let callingLabel = this.isRinging? "<p>Calling...</p>" : "";
|
|
72
|
|
- let callerStateLabel = this.isRinging? "" : " isn't available";
|
|
73
|
|
- let audioHTML = this.dontPlayAudio? "" :
|
|
74
|
|
- `<audio id="${this._audioContainerId}" src="./sounds/ring.ogg" />`;
|
|
|
71
|
+ let callingLabel = this.isRinging ? "<p>Calling...</p>" : "";
|
|
|
72
|
+ let callerStateLabel = this.isRinging ? "" : " isn't available";
|
|
|
73
|
+ let audioHTML = this.disableRingingSound ? ""
|
|
|
74
|
+ : "<audio id=\"" + this._audioContainerId
|
|
|
75
|
+ + "\" src=\"./sounds/ring.ogg\" />";
|
|
75
|
76
|
return `
|
|
76
|
77
|
<div id="${this._containerId}" class='ringing' >
|
|
77
|
78
|
<div class='ringing__content'>
|
|
|
@@ -135,14 +136,14 @@ export default {
|
|
135
|
136
|
* Shows the ring overlay for the passed callee.
|
|
136
|
137
|
* @param callee {class User} the callee. Instance of User class from
|
|
137
|
138
|
* TokenData.js
|
|
138
|
|
- * @param {boolean} dontPlayAudio if true the ringing sound wont be played.
|
|
|
139
|
+ * @param {boolean} disableRingingSound if true the ringing sound wont be played.
|
|
139
|
140
|
*/
|
|
140
|
|
- show(callee, dontPlayAudio = false) {
|
|
|
141
|
+ show(callee, disableRingingSound = false) {
|
|
141
|
142
|
if(overlay) {
|
|
142
|
143
|
this.hide();
|
|
143
|
144
|
}
|
|
144
|
145
|
|
|
145
|
|
- overlay = new RingOverlay(callee, dontPlayAudio);
|
|
|
146
|
+ overlay = new RingOverlay(callee, disableRingingSound);
|
|
146
|
147
|
APP.UI.addListener(UIEvents.LARGE_VIDEO_AVATAR_DISPLAYED,
|
|
147
|
148
|
onAvatarDisplayed);
|
|
148
|
149
|
},
|