|
|
|
@ -1,5 +1,21 @@ |
|
|
|
|
/* global $ */ |
|
|
|
|
/* global $, APP */ |
|
|
|
|
/* jshint -W101 */ |
|
|
|
|
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_DISPLAYED event. |
|
|
|
|
* @param {boolean} shown indicates whether the avatar on the large video is |
|
|
|
|
* currently displayed or not. |
|
|
|
|
*/ |
|
|
|
|
function onAvatarDisplayed(shown) { |
|
|
|
|
overlay._changeBackground(shown); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Shows ring overlay |
|
|
|
@ -19,6 +35,21 @@ class RingOverlay { |
|
|
|
|
this._setAudioTimeout(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 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 |
|
|
|
|
*/ |
|
|
|
@ -74,12 +105,6 @@ class RingOverlay { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Store the current ring overlay instance. |
|
|
|
|
* Note: We want to have only 1 instance at a time. |
|
|
|
|
*/ |
|
|
|
|
let overlay = null; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
/** |
|
|
|
|
* Shows the ring overlay for the passed callee. |
|
|
|
@ -92,6 +117,8 @@ export default { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
overlay = new RingOverlay(callee); |
|
|
|
|
APP.UI.addListener(UIEvents.LARGE_VIDEO_AVATAR_DISPLAYED, |
|
|
|
|
onAvatarDisplayed); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -104,6 +131,8 @@ export default { |
|
|
|
|
} |
|
|
|
|
overlay.destroy(); |
|
|
|
|
overlay = null; |
|
|
|
|
APP.UI.removeListener(UIEvents.LARGE_VIDEO_AVATAR_DISPLAYED, |
|
|
|
|
onAvatarDisplayed); |
|
|
|
|
return true; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|