From 7682e4978784d83850b92f42a34f5bdb252a7cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Fri, 6 Nov 2020 10:11:59 +0100 Subject: [PATCH] feat(BrowserCapabilities) drop supportsVideo It has been `true` for a very long time. --- css/modals/video-quality/_video-quality.scss | 29 --------- lang/main.json | 2 - react/features/base/media/middleware.js | 59 ++++++++----------- .../components/VideoQualitySlider.web.js | 51 ++-------------- 4 files changed, 29 insertions(+), 112 deletions(-) diff --git a/css/modals/video-quality/_video-quality.scss b/css/modals/video-quality/_video-quality.scss index dd7f5a5ab..aceec1429 100644 --- a/css/modals/video-quality/_video-quality.scss +++ b/css/modals/video-quality/_video-quality.scss @@ -1,9 +1,4 @@ .video-quality-dialog { - .hide-warning { - height: 0; - visibility: hidden; - } - .video-quality-dialog-title { margin-bottom: 10px; } @@ -109,30 +104,6 @@ word-spacing: unset; } } - - &.video-not-supported { - .video-quality-dialog-labels { - color: gray; - } - - .video-quality-dialog-slider { - @mixin sliderTrackDisabledStyles() { - background: rgba(14, 22, 36, 0.1); - } - - &::-ms-track { - @include sliderTrackDisabledStyles(); - } - - &::-moz-range-track { - @include sliderTrackDisabledStyles(); - } - - &::-webkit-slider-runnable-track { - @include sliderTrackDisabledStyles(); - } - } - } } .modal-dialog-form { diff --git a/lang/main.json b/lang/main.json index f62cc54a5..1ded454fe 100644 --- a/lang/main.json +++ b/lang/main.json @@ -837,8 +837,6 @@ "ld": "LD", "ldTooltip": "Viewing low definition video", "lowDefinition": "Low definition", - "onlyAudioAvailable": "Only audio is available", - "onlyAudioSupported": "We only support audio in this browser.", "sd": "SD", "sdTooltip": "Viewing standard definition video", "standardDefinition": "Standard definition" diff --git a/react/features/base/media/middleware.js b/react/features/base/media/middleware.js index 9e160d1e1..15f7c7dd7 100644 --- a/react/features/base/media/middleware.js +++ b/react/features/base/media/middleware.js @@ -10,7 +10,6 @@ import { import { APP_STATE_CHANGED } from '../../mobile/background'; import { SET_AUDIO_ONLY, setAudioOnly } from '../audio-only'; import { isRoomValid, SET_ROOM } from '../conference'; -import JitsiMeetJS from '../lib-jitsi-meet'; import { MiddlewareRegistry } from '../redux'; import { getPropertyValue } from '../settings'; import { isLocalVideoTrackDesktop, setTrackMuted, TRACK_ADDED } from '../tracks'; @@ -162,41 +161,33 @@ function _setRoom({ dispatch, getState }, next, action) { // XXX After the introduction of the "Video <-> Voice" toggle on the // WelcomePage, startAudioOnly is utilized even outside of // conferences/meetings. - let audioOnly; + const audioOnly + = Boolean( + getPropertyValue( + state, + 'startAudioOnly', + /* sources */ { + // FIXME Practically, base/config is (really) correct + // only if roomIsValid. At the time of this writing, + // base/config is overwritten by URL params which leaves + // base/config incorrect on the WelcomePage after + // leaving a conference which explicitly overwrites + // base/config with URL params. + config: roomIsValid, - if (JitsiMeetJS.mediaDevices.supportsVideo()) { - audioOnly - = Boolean( - getPropertyValue( - state, - 'startAudioOnly', - /* sources */ { - // FIXME Practically, base/config is (really) correct - // only if roomIsValid. At the time of this writing, - // base/config is overwritten by URL params which leaves - // base/config incorrect on the WelcomePage after - // leaving a conference which explicitly overwrites - // base/config with URL params. - config: roomIsValid, + // XXX We've already overwritten base/config with + // urlParams if roomIsValid. However, settings are more + // important than the server-side config. Consequently, + // we need to read from urlParams anyway. We also + // probably want to read from urlParams when + // !roomIsValid. + urlParams: true, - // XXX We've already overwritten base/config with - // urlParams if roomIsValid. However, settings are more - // important than the server-side config. Consequently, - // we need to read from urlParams anyway. We also - // probably want to read from urlParams when - // !roomIsValid. - urlParams: true, - - // The following don't have complications around whether - // they are defined or not: - jwt: false, - settings: true - })); - } else { - // Default to audio-only if the (execution) environment does not - // support (sending and/or receiving) video. - audioOnly = true; - } + // The following don't have complications around whether + // they are defined or not: + jwt: false, + settings: true + })); sendAnalytics(createStartAudioOnlyEvent(audioOnly)); logger.log(`Start audio only set to ${audioOnly.toString()}`); diff --git a/react/features/video-quality/components/VideoQualitySlider.web.js b/react/features/video-quality/components/VideoQualitySlider.web.js index 18031f64e..b652666cf 100644 --- a/react/features/video-quality/components/VideoQualitySlider.web.js +++ b/react/features/video-quality/components/VideoQualitySlider.web.js @@ -1,13 +1,11 @@ // @flow -import InlineMessage from '@atlaskit/inline-message'; import React, { Component } from 'react'; import type { Dispatch } from 'redux'; import { createToolbarEvent, sendAnalytics } from '../../analytics'; import { setAudioOnly } from '../../base/audio-only'; import { translate } from '../../base/i18n'; -import JitsiMeetJS from '../../base/lib-jitsi-meet'; import { connect } from '../../base/redux'; import { setPreferredVideoQuality } from '../actions'; import { VIDEO_QUALITY_LEVELS } from '../constants'; @@ -57,12 +55,6 @@ type Props = { */ _sendrecvVideoQuality: Number, - /** - * Whether or not displaying video is supported in the current - * environment. If false, the slider will be disabled. - */ - _videoSupported: Boolean, - /** * Invoked to request toggling of audio only mode. */ @@ -141,25 +133,14 @@ class VideoQualitySlider extends Component { * @returns {ReactElement} */ render() { - const { _videoSupported, t } = this.props; + const { t } = this.props; const activeSliderOption = this._mapCurrentQualityToSliderValue(); - let classNames = 'video-quality-dialog'; - let warning = null; - - if (!_videoSupported) { - classNames += ' video-not-supported'; - warning = this._renderAudioOnlyLockedMessage(); - } - return ( -
+

{ t('videoStatus.callQuality') }

-
- { warning } -
{ /* FIXME: onChange and onMouseUp are both used for @@ -168,7 +149,6 @@ class VideoQualitySlider extends Component { */ } { ); } - /** - * Creates a React Element for notifying that the browser is in audio only - * and cannot be changed. - * - * @private - * @returns {ReactElement} - */ - _renderAudioOnlyLockedMessage() { - const { t } = this.props; - - return ( - - { t('videoStatus.onlyAudioSupported') } - - ); - } - /** * Creates React Elements to display mock tick marks with associated labels. * @@ -393,11 +355,7 @@ class VideoQualitySlider extends Component { * * @param {Object} state - The Redux state. * @private - * @returns {{ - * _audioOnly: boolean, - * _p2p: boolean, - * _sendrecvVideoQuality: number - * }} + * @returns {Props} */ function _mapStateToProps(state) { const { enabled: audioOnly } = state['features/base/audio-only']; @@ -407,8 +365,7 @@ function _mapStateToProps(state) { return { _audioOnly: audioOnly, _p2p: p2p, - _sendrecvVideoQuality: preferredVideoQuality, - _videoSupported: JitsiMeetJS.mediaDevices.supportsVideo() + _sendrecvVideoQuality: preferredVideoQuality }; }