2022-02-23 13:30:10 +00:00
|
|
|
import { JitsiParticipantConnectionStatus, JitsiTrackStreamingStatus } from '../base/lib-jitsi-meet';
|
2022-09-27 07:42:30 +00:00
|
|
|
import { Participant } from '../base/participants/types';
|
|
|
|
import { ITrack } from '../base/tracks/reducer';
|
2022-02-23 13:30:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if the passed track's streaming status is active.
|
|
|
|
*
|
|
|
|
* @param {Object} videoTrack - Track reference.
|
|
|
|
* @returns {boolean} - Is streaming status active.
|
|
|
|
*/
|
2022-09-27 07:42:30 +00:00
|
|
|
export function isTrackStreamingStatusActive(videoTrack: ITrack) {
|
2022-02-23 13:30:10 +00:00
|
|
|
const streamingStatus = videoTrack?.streamingStatus;
|
|
|
|
|
|
|
|
return streamingStatus === JitsiTrackStreamingStatus.ACTIVE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if the passed track's streaming status is inactive.
|
|
|
|
*
|
|
|
|
* @param {Object} videoTrack - Track reference.
|
|
|
|
* @returns {boolean} - Is streaming status inactive.
|
|
|
|
*/
|
2022-10-11 10:47:54 +00:00
|
|
|
export function isTrackStreamingStatusInactive(videoTrack?: ITrack) {
|
2022-02-23 13:30:10 +00:00
|
|
|
const streamingStatus = videoTrack?.streamingStatus;
|
|
|
|
|
|
|
|
return streamingStatus === JitsiTrackStreamingStatus.INACTIVE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if the passed track's streaming status is interrupted.
|
|
|
|
*
|
|
|
|
* @param {Object} videoTrack - Track reference.
|
|
|
|
* @returns {boolean} - Is streaming status interrupted.
|
|
|
|
*/
|
2022-10-11 10:47:54 +00:00
|
|
|
export function isTrackStreamingStatusInterrupted(videoTrack?: ITrack) {
|
2022-02-23 13:30:10 +00:00
|
|
|
const streamingStatus = videoTrack?.streamingStatus;
|
|
|
|
|
|
|
|
return streamingStatus === JitsiTrackStreamingStatus.INTERRUPTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-07-14 07:10:08 +00:00
|
|
|
* Checks if the passed participant's connection status is active.
|
2022-02-23 13:30:10 +00:00
|
|
|
*
|
|
|
|
* @param {Object} participant - Participant reference.
|
|
|
|
* @returns {boolean} - Is connection status active.
|
|
|
|
*/
|
2022-09-27 07:42:30 +00:00
|
|
|
export function isParticipantConnectionStatusActive(participant: Participant) {
|
2022-02-23 13:30:10 +00:00
|
|
|
const connectionStatus = participant?.connectionStatus;
|
|
|
|
|
|
|
|
return connectionStatus === JitsiParticipantConnectionStatus.ACTIVE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-07-14 07:10:08 +00:00
|
|
|
* Checks if the passed participant's connection status is inactive.
|
2022-02-23 13:30:10 +00:00
|
|
|
*
|
|
|
|
* @param {Object} participant - Participant reference.
|
|
|
|
* @returns {boolean} - Is connection status inactive.
|
|
|
|
*/
|
2022-09-27 07:42:30 +00:00
|
|
|
export function isParticipantConnectionStatusInactive(participant?: Participant) {
|
2022-02-23 13:30:10 +00:00
|
|
|
const connectionStatus = participant?.connectionStatus;
|
|
|
|
|
|
|
|
return connectionStatus === JitsiParticipantConnectionStatus.INACTIVE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-07-14 07:10:08 +00:00
|
|
|
* Checks if the passed participant's connection status is interrupted.
|
2022-02-23 13:30:10 +00:00
|
|
|
*
|
|
|
|
* @param {Object} participant - Participant reference.
|
|
|
|
* @returns {boolean} - Is connection status interrupted.
|
|
|
|
*/
|
2022-09-27 07:42:30 +00:00
|
|
|
export function isParticipantConnectionStatusInterrupted(participant?: Participant) {
|
2022-02-23 13:30:10 +00:00
|
|
|
const connectionStatus = participant?.connectionStatus;
|
|
|
|
|
|
|
|
return connectionStatus === JitsiParticipantConnectionStatus.INTERRUPTED;
|
|
|
|
}
|