2022-11-08 19:15:49 +00:00
|
|
|
import { JitsiTrackStreamingStatus } from '../base/lib-jitsi-meet';
|
2022-11-01 12:36:32 +00:00
|
|
|
import { ITrack } from '../base/tracks/types';
|
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;
|
|
|
|
}
|