/* global $ */ /* jshint -W101 */ /** * Shows ring overlay */ class RingOverlay { /** * @param callee instance of User class from TokenData.js */ constructor(callee) { this._containerId = 'ringOverlay'; this._audioContainerId = 'ringOverlayRinging'; this.isRinging = true; this.callee = callee; this.render(); this.audio = document.getElementById(this._audioContainerId); this.audio.play(); this._setAudioTimeout(); this._timeout = setTimeout(() => { this.destroy(); this.render(); }, 30000); } /** * Builds and appends the ring overlay to the html document */ _getHtmlStr(callee) { let callingLabel = this.isRinging? "
Calling...
" : ""; let callerStateLabel = this.isRinging? "" : " isn't available"; return `${callee.getName()}${callerStateLabel}