-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(recording) allow highlighting meeting recording moments #10981
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
react/features/recording/components/Recording/AbstractHighlightButton.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// @flow | ||
|
||
import { Component } from 'react'; | ||
|
||
import { getActiveSession, isHighlightMeetingMomentDisabled } from '../..'; | ||
import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet'; | ||
import { highlightMeetingMoment } from '../../actions.any'; | ||
|
||
export type Props = { | ||
|
||
/** | ||
* Whether or not the conference is in audio only mode. | ||
*/ | ||
_audioOnly: boolean, | ||
|
||
/** | ||
* Invoked to obtain translated strings. | ||
*/ | ||
t: Function | ||
}; | ||
|
||
/** | ||
* Abstract class for the {@code AbstractHighlightButton} component. | ||
*/ | ||
export default class AbstractHighlightButton<P: Props> extends Component<P> { | ||
/** | ||
* Initializes a new AbstractVideoTrack instance. | ||
* | ||
* @param {Object} props - The read-only properties with which the new | ||
* instance is to be initialized. | ||
*/ | ||
constructor(props: Props) { | ||
super(props); | ||
|
||
this._onClick = this._onClick.bind(this); | ||
} | ||
|
||
/** | ||
* Handles clicking / pressing the button. | ||
* | ||
* @override | ||
* @protected | ||
* @returns {void} | ||
*/ | ||
_onClick() { | ||
const { dispatch } = this.props; | ||
|
||
dispatch(highlightMeetingMoment()); | ||
} | ||
} | ||
|
||
/** | ||
* Maps (parts of) the Redux state to the associated | ||
* {@code AbstractVideoQualityLabel}'s props. | ||
* | ||
* @param {Object} state - The Redux state. | ||
* @private | ||
* @returns {{ | ||
* _audioOnly: boolean | ||
* }} | ||
*/ | ||
export function _abstractMapStateToProps(state: Object) { | ||
const isRecordingRunning = getActiveSession(state, JitsiRecordingConstants.mode.FILE); | ||
const isButtonDisabled = isHighlightMeetingMomentDisabled(state); | ||
const { webhookProxyUrl } = state['features/base/config']; | ||
|
||
return { | ||
_disabled: !isRecordingRunning || isButtonDisabled, | ||
_visible: Boolean(webhookProxyUrl) | ||
}; | ||
} |
94 changes: 94 additions & 0 deletions
94
react/features/recording/components/Recording/web/HighlightButton.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
// @flow | ||
|
||
import { withStyles } from '@material-ui/core'; | ||
import React from 'react'; | ||
|
||
import { translate } from '../../../../base/i18n'; | ||
import { IconHighlight } from '../../../../base/icons'; | ||
import { Label } from '../../../../base/label'; | ||
import { connect } from '../../../../base/redux'; | ||
import { Tooltip } from '../../../../base/tooltip'; | ||
import BaseTheme from '../../../../base/ui/components/BaseTheme'; | ||
import AbstractHighlightButton, { | ||
_abstractMapStateToProps, | ||
type Props as AbstractProps | ||
} from '../AbstractHighlightButton'; | ||
|
||
type Props = AbstractProps & { | ||
_disabled: boolean, | ||
|
||
/** | ||
* The message to show within the label's tooltip. | ||
*/ | ||
_tooltipKey: string, | ||
|
||
/** | ||
* Flag controlling visibility of the component. | ||
*/ | ||
_visible: boolean, | ||
}; | ||
|
||
/** | ||
* Creates the styles for the component. | ||
* | ||
* @param {Object} theme - The current UI theme. | ||
* | ||
* @returns {Object} | ||
*/ | ||
const styles = theme => { | ||
return { | ||
regular: { | ||
background: theme.palette.field02, | ||
margin: '0 4px 4px 4px' | ||
}, | ||
disabled: { | ||
background: theme.palette.text02, | ||
margin: '0 4px 4px 4px' | ||
} | ||
}; | ||
}; | ||
|
||
/** | ||
* React {@code Component} responsible for displaying an action that | ||
* allows users to highlight a meeting moment. | ||
*/ | ||
export class HighlightButton extends AbstractHighlightButton<Props> { | ||
|
||
/** | ||
* Implements React's {@link Component#render()}. | ||
* | ||
* @inheritdoc | ||
* @returns {ReactElement} | ||
*/ | ||
render() { | ||
const { | ||
_disabled, | ||
_visible, | ||
classes, | ||
t | ||
} = this.props; | ||
|
||
|
||
if (!_visible) { | ||
return null; | ||
} | ||
|
||
const className = _disabled ? classes.disabled : classes.regular; | ||
const tooltipKey = _disabled ? 'recording.highlightMomentDisabled' : 'recording.highlightMoment'; | ||
|
||
return ( | ||
<Tooltip | ||
content = { t(tooltipKey) } | ||
position = { 'bottom' }> | ||
<Label | ||
className = { className } | ||
icon = { IconHighlight } | ||
iconColor = { _disabled ? BaseTheme.palette.text03 : BaseTheme.palette.field01 } | ||
id = 'highlightMeetingLabel' | ||
onClick = { this._onClick } /> | ||
</Tooltip> | ||
); | ||
} | ||
} | ||
|
||
export default withStyles(styles)(translate(connect(_abstractMapStateToProps)(HighlightButton))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// @flow | ||
|
||
export { default as HighlightButton } from './HighlightButton'; | ||
export { default as RecordButton } from './RecordButton'; | ||
export { default as StartRecordingDialog } from './StartRecordingDialog'; | ||
export { default as StopRecordingDialog } from './StopRecordingDialog'; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this one is not documented in config.js (not your fault)