jiti-meet/react/features/shared-video/actions.native.js

55 lines
1.4 KiB
JavaScript
Raw Normal View History

2020-06-12 10:15:16 +00:00
// @flow
import { openDialog } from '../base/dialog';
import { SET_SHARED_VIDEO_STATUS, TOGGLE_SHARED_VIDEO } from './actionTypes';
import { SharedVideoDialog } from './components/native';
2020-06-12 10:15:16 +00:00
/**
* Updates the current known status of the shared video.
2020-06-12 10:15:16 +00:00
*
* @param {string} videoId - The id of the video to be shared.
* @param {string} status - The current status of the video being shared.
* @param {number} time - The current position of the video being shared.
* @param {string} ownerId - The participantId of the user sharing the video.
2020-06-12 10:15:16 +00:00
* @returns {{
* type: SET_SHARED_VIDEO_STATUS,
* ownerId: string,
* status: string,
* time: number,
* videoId: string
* }}
*/
export function setSharedVideoStatus(videoId: string, status: string, time: number, ownerId: string) {
return {
type: SET_SHARED_VIDEO_STATUS,
ownerId,
status,
time,
videoId
};
}
/**
* Starts the flow for starting or stopping a shared video.
2020-06-12 10:15:16 +00:00
*
* @returns {{
* type: TOGGLE_SHARED_VIDEO
* }}
*/
export function toggleSharedVideo() {
return {
type: TOGGLE_SHARED_VIDEO
2020-06-12 10:15:16 +00:00
};
}
/**
* Displays the prompt for entering the video link.
2020-06-12 10:15:16 +00:00
*
* @param {Function} onPostSubmit - The function to be invoked when a valid link is entered.
* @returns {Function}
*/
export function showSharedVideoDialog(onPostSubmit: ?Function) {
return openDialog(SharedVideoDialog, { onPostSubmit });
2020-06-12 10:15:16 +00:00
}