diff --git a/conference.js b/conference.js index 8963cb615b..ea35690a2d 100644 --- a/conference.js +++ b/conference.js @@ -386,9 +386,8 @@ class ConferenceConnector { _onConferenceFailed(err, ...params) { APP.store.dispatch(conferenceFailed(room, err, ...params)); logger.error('CONFERENCE FAILED:', err, ...params); - APP.UI.hideRingOverlay(); - switch (err) { + switch (err) { case ConferenceErrors.CONNECTION_ERROR: { let [msg] = params; @@ -2027,7 +2026,7 @@ export default { */ hangup(requestFeedback = false) { eventEmitter.emit(JitsiMeetConferenceEvents.BEFORE_HANGUP); - APP.UI.hideRingOverlay(); + let requestFeedbackPromise = requestFeedback ? APP.UI.requestFeedbackOnHangup() // false - because the thank you dialog shouldn't be displayed diff --git a/interface_config.js b/interface_config.js index 22508bff9c..f19508bfe8 100644 --- a/interface_config.js +++ b/interface_config.js @@ -70,7 +70,13 @@ var interfaceConfig = { // eslint-disable-line no-unused-vars ENABLE_FEEDBACK_ANIMATION: false, DISABLE_FOCUS_INDICATOR: false, DISABLE_DOMINANT_SPEAKER_INDICATOR: false, - // disables the ringing sound when the RingOverlay is shown. + + /** + * Whether the ringing sound in the call/ring overlay is disabled. If + * {@code undefined}, defaults to {@code false}. + * + * @type {boolean} + */ DISABLE_RINGING: false, AUDIO_LEVEL_PRIMARY_COLOR: "rgba(255,255,255,0.4)", AUDIO_LEVEL_SECONDARY_COLOR: "rgba(255,255,255,0.2)", @@ -82,8 +88,8 @@ var interfaceConfig = { // eslint-disable-line no-unused-vars /** * Whether the mobile app Jitsi Meet is to be promoted to participants - * attempting to join a conference in a mobile Web browser. If undefined, - * default to true. + * attempting to join a conference in a mobile Web browser. If + * {@code undefined}, defaults to {@code true}. * * @type {boolean} */ diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 37e454d06a..92b136a5b6 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -19,18 +19,11 @@ import Filmstrip from "./videolayout/Filmstrip"; import SettingsMenu from "./side_pannels/settings/SettingsMenu"; import Profile from "./side_pannels/profile/Profile"; import Settings from "./../settings/Settings"; -import RingOverlay from "./ring_overlay/RingOverlay"; import UIErrors from './UIErrors'; import { debounce } from "../util/helpers"; - -import { - updateDeviceList -} from '../../react/features/base/devices'; -import { - setAudioMuted, - setVideoMuted -} from '../../react/features/base/media'; +import { updateDeviceList } from '../../react/features/base/devices'; +import { setAudioMuted, setVideoMuted } from '../../react/features/base/media'; import { openDeviceSelectionDialog } from '../../react/features/device-selection'; @@ -368,10 +361,6 @@ UI.start = function () { "closeHtml": '' }; } - - const { callee } = APP.store.getState()['features/jwt']; - - callee && UI.showRingOverlay(); }; /** @@ -492,7 +481,7 @@ UI.getSharedDocumentManager = () => etherpadManager; UI.addUser = function (user) { var id = user.getId(); var displayName = user.getDisplayName(); - UI.hideRingOverlay(); + if (UI.ContactList) UI.ContactList.addContact(id); @@ -1371,17 +1360,6 @@ UI.setCameraButtonEnabled UI.setMicrophoneButtonEnabled = enabled => APP.store.dispatch(setAudioIconEnabled(enabled)); -UI.showRingOverlay = function () { - const { callee } = APP.store.getState()['features/jwt']; - - callee && RingOverlay.show(callee, interfaceConfig.DISABLE_RINGING); - - Filmstrip.toggleFilmstrip(false, false); -}; - -UI.hideRingOverlay - = () => RingOverlay.hide() && Filmstrip.toggleFilmstrip(true, false); - /** * Indicates if any the "top" overlays are currently visible. The check includes * the call/ring overlay, the suspended overlay, the GUM permissions overlay, @@ -1390,16 +1368,11 @@ UI.hideRingOverlay * @returns {*|boolean} {true} if an overlay is visible; {false}, otherwise */ UI.isOverlayVisible = function () { - return this.isRingOverlayVisible() || this.overlayVisible; + return ( + this.overlayVisible + || APP.store.getState()['features/jwt'].callOverlayVisible); }; -/** - * Indicates if the ring overlay is currently visible. - * - * @returns {*|boolean} {true} if the ring overlay is visible, {false} otherwise - */ -UI.isRingOverlayVisible = () => RingOverlay.isVisible(); - /** * Handles user's features changes. */ diff --git a/modules/UI/ring_overlay/RingOverlay.js b/modules/UI/ring_overlay/RingOverlay.js deleted file mode 100644 index e9d58b5e1d..0000000000 --- a/modules/UI/ring_overlay/RingOverlay.js +++ /dev/null @@ -1,178 +0,0 @@ -/* global $, APP */ - -import UIEvents from "../../../service/UI/UIEvents"; - -/** - * Store the current ring overlay instance. - * Note: We want to have only 1 instance at a time. - */ -let overlay = null; - -/** - * Handler for UIEvents.LARGE_VIDEO_AVATAR_VISIBLE event. - * @param {boolean} shown indicates whether the avatar on the large video is - * currently displayed or not. - */ -function onAvatarVisible(shown) { - overlay._changeBackground(shown); -} - -/** - * Shows ring overlay - */ -class RingOverlay { - /** - * - * @param callee The callee (Object) as defined by the JWT support. - * @param {boolean} disableRinging if true the ringing sound wont be played. - */ - constructor(callee, disableRinging) { - this._containerId = 'ringOverlay'; - this._audioContainerId = 'ringOverlayRinging'; - this.isRinging = true; - this.callee = callee; - this.disableRinging = disableRinging; - this.render(); - if (!disableRinging) - this._initAudio(); - this._timeout - = setTimeout( - () => { - this.destroy(); - this.render(); - }, - 30000); - } - - /** - * Initializes the audio element and setups the interval for playing it. - */ - _initAudio() { - this.audio = document.getElementById(this._audioContainerId); - this.audio.play(); - this.interval = setInterval(() => this.audio.play(), 5000); - } - - /** - * Chagnes the background of the ring overlay. - * @param {boolean} solid - if true the new background will be the solid - * one, otherwise the background will be default one. - * NOTE: The method just toggles solidBG css class. - */ - _changeBackground(solid) { - const container = $("#" + this._containerId); - - if (solid) { - container.addClass("solidBG"); - } else { - container.removeClass("solidBG"); - } - } - - /** - * Builds and appends the ring overlay to the html document - */ - _getHtmlStr(callee) { - let callingLabel = this.isRinging ? "

Calling...

" : ""; - let callerStateLabel = this.isRinging ? "" : " isn't available"; - let audioHTML = this.disableRinging ? "" - : "