Skip to content

Commit

Permalink
fix(shared-video): Remove disable button action from web.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Dec 22, 2024
1 parent 54d0219 commit 27916df
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 84 deletions.
2 changes: 1 addition & 1 deletion modules/API/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ import { toggleScreenshotCaptureSummary } from '../../react/features/screenshot-
import { isScreenshotCaptureEnabled } from '../../react/features/screenshot-capture/functions';
import SettingsDialog from '../../react/features/settings/components/web/SettingsDialog';
import { SETTINGS_TABS } from '../../react/features/settings/constants';
import { playSharedVideo, stopSharedVideo } from '../../react/features/shared-video/actions.any';
import { playSharedVideo, stopSharedVideo } from '../../react/features/shared-video/actions';
import { extractYoutubeIdOrURL } from '../../react/features/shared-video/functions';
import { setRequestingSubtitles, toggleRequestingSubtitles } from '../../react/features/subtitles/actions';
import { isAudioMuteButtonDisabled } from '../../react/features/toolbox/functions';
Expand Down
1 change: 0 additions & 1 deletion react/features/shared-video/actions.native.ts

This file was deleted.

File renamed without changes.
19 changes: 0 additions & 19 deletions react/features/shared-video/actions.web.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IReduxState, IStore } from '../../../app/types';
import { getCurrentConference } from '../../../base/conference/functions';
import { IJitsiConference } from '../../../base/conference/reducer';
import { getLocalParticipant } from '../../../base/participants/functions';
import { setSharedVideoStatus } from '../../actions.any';
import { setSharedVideoStatus } from '../../actions';
import { PLAYBACK_STATUSES } from '../../constants';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { translate } from '../../../base/i18n/functions';
import { IconPlay } from '../../../base/icons/svg';
import { getLocalParticipant } from '../../../base/participants/functions';
import AbstractButton, { IProps as AbstractButtonProps } from '../../../base/toolbox/components/AbstractButton';
import { toggleSharedVideo } from '../../actions.native';
import { toggleSharedVideo } from '../../actions';
import { isSharingStatus } from '../../functions';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { showWarningNotification } from '../../../notifications/actions';
import { NOTIFICATION_TIMEOUT_TYPE } from '../../../notifications/constants';
import { dockToolbox } from '../../../toolbox/actions';
import { muteLocal } from '../../../video-menu/actions.any';
import { setSharedVideoStatus, stopSharedVideo } from '../../actions.any';
import { setSharedVideoStatus, stopSharedVideo } from '../../actions';
import { PLAYBACK_STATUSES } from '../../constants';

const logger = Logger.getLogger(__filename);
Expand Down
15 changes: 7 additions & 8 deletions react/features/shared-video/components/web/SharedVideoButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { connect } from 'react-redux';
import { IReduxState } from '../../../app/types';
import { translate } from '../../../base/i18n/functions';
import { IconPlay } from '../../../base/icons/svg';
import { getLocalParticipant } from '../../../base/participants/functions';
import AbstractButton, { IProps as AbstractButtonProps } from '../../../base/toolbox/components/AbstractButton';
import { toggleSharedVideo } from '../../actions.any';
import { toggleSharedVideo } from '../../actions';
import { isSharingStatus } from '../../functions';

interface IProps extends AbstractButtonProps {
Expand Down Expand Up @@ -83,16 +84,14 @@ class SharedVideoButton extends AbstractButton<IProps> {
* @returns {IProps}
*/
function _mapStateToProps(state: IReduxState) {
const {
disabled: sharedVideoBtnDisabled,
status: sharedVideoStatus
} = state['features/shared-video'];
const { ownerId, status: sharedVideoStatus } = state['features/shared-video'];
const localParticipantId = getLocalParticipant(state)?.id;
const isSharing = isSharingStatus(sharedVideoStatus ?? '');

return {
_isDisabled: Boolean(sharedVideoBtnDisabled),
_sharingVideo: isSharingStatus(sharedVideoStatus ?? '')
_isDisabled: isSharing && ownerId !== localParticipantId,
_sharingVideo: isSharing
};
}


export default translate(connect(_mapStateToProps)(SharedVideoButton));
1 change: 0 additions & 1 deletion react/features/shared-video/middleware.native.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
setAllowedUrlDomians,
setSharedVideoStatus,
showConfirmPlayingDialog
} from './actions.any';
} from './actions';
import {
DEFAULT_ALLOWED_URL_DOMAINS,
PLAYBACK_START,
Expand Down
41 changes: 0 additions & 41 deletions react/features/shared-video/middleware.web.ts

This file was deleted.

9 changes: 1 addition & 8 deletions react/features/shared-video/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const initialState = {
export interface ISharedVideoState {
allowedUrlDomains: Array<string>;
confirmShowVideo?: boolean;
disabled?: boolean;
muted?: boolean;
ownerId?: string;
status?: string;
Expand All @@ -30,7 +29,7 @@ export interface ISharedVideoState {
*/
ReducerRegistry.register<ISharedVideoState>('features/shared-video',
(state = initialState, action): ISharedVideoState => {
const { videoUrl, status, time, ownerId, disabled, muted, volume } = action;
const { videoUrl, status, time, ownerId, muted, volume } = action;

switch (action.type) {
case RESET_SHARED_VIDEO_STATUS:
Expand All @@ -55,12 +54,6 @@ ReducerRegistry.register<ISharedVideoState>('features/shared-video',
volume
};

case SET_DISABLE_BUTTON:
return {
...state,
disabled
};

case SET_ALLOWED_URL_DOMAINS: {
return {
...state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { isWhiteboardParticipant } from '../../../base/participants/functions';
import { IParticipant } from '../../../base/participants/types';
import ContextMenu from '../../../base/ui/components/web/ContextMenu';
import ContextMenuItemGroup from '../../../base/ui/components/web/ContextMenuItemGroup';
import { stopSharedVideo } from '../../../shared-video/actions.any';
import { stopSharedVideo } from '../../../shared-video/actions';
import { getParticipantMenuButtonsWithNotifyClick, showOverflowDrawer } from '../../../toolbox/functions.web';
import { NOTIFY_CLICK_MODE } from '../../../toolbox/types';
import { setWhiteboardOpen } from '../../../whiteboard/actions';
Expand Down

0 comments on commit 27916df

Please sign in to comment.