|
|
|
@ -1,6 +1,6 @@ |
|
|
|
|
/* @flow */ |
|
|
|
|
/* eslint-disable no-invalid-this */ |
|
|
|
|
|
|
|
|
|
import Logger from 'jitsi-meet-logger'; |
|
|
|
|
import throttle from 'lodash/throttle'; |
|
|
|
|
import { Component } from 'react'; |
|
|
|
|
|
|
|
|
@ -9,16 +9,18 @@ import { getCurrentConference } from '../../../base/conference'; |
|
|
|
|
import { MEDIA_TYPE } from '../../../base/media'; |
|
|
|
|
import { getLocalParticipant } from '../../../base/participants'; |
|
|
|
|
import { isLocalTrackMuted } from '../../../base/tracks'; |
|
|
|
|
import { showWarningNotification } from '../../../notifications/actions'; |
|
|
|
|
import { dockToolbox } from '../../../toolbox/actions.web'; |
|
|
|
|
import { muteLocal } from '../../../video-menu/actions.any'; |
|
|
|
|
import { setSharedVideoStatus } from '../../actions.any'; |
|
|
|
|
|
|
|
|
|
import { setSharedVideoStatus, stopSharedVideo } from '../../actions.any'; |
|
|
|
|
export const PLAYBACK_STATES = { |
|
|
|
|
PLAYING: 'playing', |
|
|
|
|
PAUSED: 'pause', |
|
|
|
|
STOPPED: 'stop' |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const logger = Logger.getLogger(__filename); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Return true if the diffenrece between the two timees is larger than 5. |
|
|
|
|
* |
|
|
|
@ -41,11 +43,21 @@ export type Props = { |
|
|
|
|
*/ |
|
|
|
|
_conference: Object, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Warning that indicates an incorect video url |
|
|
|
|
*/ |
|
|
|
|
_displayWarning: Function, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Docks the toolbox |
|
|
|
|
*/ |
|
|
|
|
_dockToolbox: Function, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Action to stop video sharing |
|
|
|
|
*/ |
|
|
|
|
_stopSharedVideo: Function, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Indicates whether the local audio is muted |
|
|
|
|
*/ |
|
|
|
@ -197,6 +209,17 @@ class AbstractVideoManager extends Component<Props> { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Handle video error. |
|
|
|
|
* |
|
|
|
|
* @returns {void} |
|
|
|
|
*/ |
|
|
|
|
onError() { |
|
|
|
|
logger.error('Error in the video player'); |
|
|
|
|
this.props._stopSharedVideo(); |
|
|
|
|
this.props._displayWarning(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Handle video playing. |
|
|
|
|
* |
|
|
|
@ -406,9 +429,17 @@ export function _mapStateToProps(state: Object): $Shape<Props> { |
|
|
|
|
*/ |
|
|
|
|
export function _mapDispatchToProps(dispatch: Function): $Shape<Props> { |
|
|
|
|
return { |
|
|
|
|
_displayWarning: () => { |
|
|
|
|
dispatch(showWarningNotification({ |
|
|
|
|
titleKey: 'dialog.shareVideoLinkError' |
|
|
|
|
})); |
|
|
|
|
}, |
|
|
|
|
_dockToolbox: value => { |
|
|
|
|
dispatch(dockToolbox(value)); |
|
|
|
|
}, |
|
|
|
|
_stopSharedVideo: () => { |
|
|
|
|
dispatch(stopSharedVideo()); |
|
|
|
|
}, |
|
|
|
|
_muteLocal: value => { |
|
|
|
|
dispatch(muteLocal(value, MEDIA_TYPE.AUDIO)); |
|
|
|
|
}, |
|
|
|
|