|
|
|
@ -1,9 +1,11 @@ |
|
|
|
|
// @flow
|
|
|
|
|
|
|
|
|
|
import Logger from '@jitsi/logger'; |
|
|
|
|
import { batch } from 'react-redux'; |
|
|
|
|
|
|
|
|
|
import { CONFERENCE_JOIN_IN_PROGRESS, CONFERENCE_LEFT } from '../base/conference/actionTypes'; |
|
|
|
|
import { getCurrentConference } from '../base/conference/functions'; |
|
|
|
|
import { MEDIA_TYPE } from '../base/media'; |
|
|
|
|
import { |
|
|
|
|
PARTICIPANT_LEFT, |
|
|
|
|
getLocalParticipant, |
|
|
|
@ -18,9 +20,13 @@ import { |
|
|
|
|
resetSharedVideoStatus, |
|
|
|
|
setSharedVideoStatus |
|
|
|
|
} from './actions.any'; |
|
|
|
|
import { SHARED_VIDEO, VIDEO_PLAYER_PARTICIPANT_NAME } from './constants'; |
|
|
|
|
import { SHARED_VIDEO, VIDEO_PLAYER_PARTICIPANT_NAME, PLAYBACK_STATUSES } from './constants'; |
|
|
|
|
import { isSharingStatus } from './functions'; |
|
|
|
|
|
|
|
|
|
const logger = Logger.getLogger(__filename); |
|
|
|
|
|
|
|
|
|
declare var APP: Object; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Middleware that captures actions related to video sharing and updates |
|
|
|
|
* components not hooked into redux. |
|
|
|
@ -74,6 +80,10 @@ MiddlewareRegistry.register(store => next => action => { |
|
|
|
|
const conference = getCurrentConference(state); |
|
|
|
|
const localParticipantId = getLocalParticipant(state)?.id; |
|
|
|
|
const { videoUrl, status, ownerId, time, muted, volume } = action; |
|
|
|
|
const operator = status === PLAYBACK_STATUSES.PLAYING ? 'is' : ''; |
|
|
|
|
|
|
|
|
|
logger.debug(`User with id: ${ownerId} ${operator} ${status} video sharing.`); |
|
|
|
|
APP.API.notifyAudioOrVideoSharingToggled(MEDIA_TYPE.VIDEO, status, ownerId); |
|
|
|
|
|
|
|
|
|
if (localParticipantId === ownerId) { |
|
|
|
|
sendShareVideoCommand({ |
|
|
|
@ -92,6 +102,8 @@ MiddlewareRegistry.register(store => next => action => { |
|
|
|
|
const localParticipantId = getLocalParticipant(state)?.id; |
|
|
|
|
const { ownerId: stateOwnerId, videoUrl: statevideoUrl } = state['features/shared-video']; |
|
|
|
|
|
|
|
|
|
logger.debug(`User with id: ${stateOwnerId} stop video sharing.`); |
|
|
|
|
APP.API.notifyAudioOrVideoSharingToggled(MEDIA_TYPE.VIDEO, 'stop', stateOwnerId); |
|
|
|
|
if (localParticipantId === stateOwnerId) { |
|
|
|
|
const conference = getCurrentConference(state); |
|
|
|
|
|
|
|
|
|