Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Replace quality warning with tooltips on the local media butt…
…ons"

This reverts commit b92a161.
  • Loading branch information
danxuliu committed Jul 20, 2020
commit 2e3592fc786447e7d77de2179642c765259b4157
3 changes: 3 additions & 0 deletions css/icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
&.icon-screen-off {
background-image: url(icon-color-path('screen-off', 'actions', 'fff', 1, true));
}
&.icon-error {
background-image: url(icon-color-path('error', 'actions', 'fff', 1, true));
}
}

.icon-favorite {
Expand Down
24 changes: 0 additions & 24 deletions src/components/CallView/shared/LocalMediaControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,6 @@ export default {
type: Boolean,
default: false,
},
qualityWarningAudioTooltip: {
type: Object,
default: null,
},
qualityWarningVideoTooltip: {
type: Object,
default: null,
},
qualityWarningScreenTooltip: {
type: Object,
default: null,
},
},

data() {
Expand Down Expand Up @@ -152,10 +140,6 @@ export default {
}
}

if (this.qualityWarningAudioTooltip) {
return this.qualityWarningAudioTooltip
}

if (this.speakingWhileMutedNotification) {
return {
content: this.speakingWhileMutedNotification,
Expand Down Expand Up @@ -212,10 +196,6 @@ export default {
return t('spreed', 'No camera')
}

if (this.qualityWarningVideoTooltip) {
return this.qualityWarningVideoTooltip
}

if (this.model.attributes.videoEnabled) {
return t('spreed', 'Disable video (v)')
}
Expand Down Expand Up @@ -256,10 +236,6 @@ export default {
return null
}

if (this.qualityWarningScreenTooltip) {
return this.qualityWarningScreenTooltip
}

return (this.model.attributes.localScreen || this.splitScreenSharingMenu) ? t('spreed', 'Screensharing options') : t('spreed', 'Enable screensharing')
},

Expand Down
48 changes: 41 additions & 7 deletions src/components/CallView/shared/LocalVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
class="videoContainer videoView"
:class="videoContainerClass"
:aria-label="videoContainerAriaLabel">
<transition name="fade">
<span v-show="showQualityWarning"
v-tooltip="qualityWarningTooltip"
:aria-label="qualityWarningAriaLabel"
class="qualityWarning forced-white icon icon-error" />
</transition>
<video v-show="localMediaModel.attributes.videoEnabled"
id="localVideo"
ref="video"
Expand Down Expand Up @@ -51,9 +57,6 @@
:model="localMediaModel"
:local-call-participant-model="localCallParticipantModel"
:screen-sharing-button-hidden="isSidebar"
:quality-warning-audio-tooltip="qualityWarningAudioTooltip"
:quality-warning-video-tooltip="qualityWarningVideoTooltip"
:quality-warning-screen-tooltip="qualityWarningScreenTooltip"
@switchScreenToId="$emit('switchScreenToId', $event)" />
</transition>
</div>
Expand All @@ -75,6 +78,10 @@ export default {

name: 'LocalVideo',

directives: {
tooltip: Tooltip,
},

components: {
Avatar,
LocalMediaControls,
Expand Down Expand Up @@ -219,14 +226,29 @@ export default {
},

// The quality warning tooltip is automatically shown only if the
// quality warning (dimmed video) has not been shown in the last minute.
// Otherwise the tooltip is hidden even if the warning is shown,
// although the tooltip can be shown anyway by hovering on the media
// button.
// quality warning has not been shown in the last minute. Otherwise the
// tooltip is hidden even if the warning is shown, although the tooltip
// can be shown anyway by hovering on the warning.
showQualityWarningTooltip() {
return !this.qualityWarningWasRecentlyShownTimeout
},

qualityWarningTooltip() {
if (this.qualityWarningAudioTooltip) {
return this.qualityWarningAudioTooltip
}

if (this.qualityWarningVideoTooltip) {
return this.qualityWarningVideoTooltip
}

if (this.qualityWarningScreenTooltip) {
return this.qualityWarningScreenTooltip
}

return null
},

qualityWarningAudioTooltip() {
if (!this.showQualityWarning || !this.localMediaModel.attributes.audioEnabled) {
return null
Expand Down Expand Up @@ -433,4 +455,16 @@ export default {
}
}

.qualityWarning {
position: absolute;
right: 0;

width: 44px;
height: 44px;
background-size: 24px;

/* Needed to show in front of the avatar container. */
z-index: 10;
}

</style>