|
|
|
@ -53,39 +53,6 @@ export function destroyLocalTracks() { |
|
|
|
|
.map(t => t.jitsiTrack))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns true if the provided JitsiTrack should be rendered as a mirror. |
|
|
|
|
* |
|
|
|
|
* We only want to show a video in mirrored mode when: |
|
|
|
|
* 1) The video source is local, and not remote. |
|
|
|
|
* 2) The video source is a camera, not a desktop (capture). |
|
|
|
|
* 3) The camera is capturing the user, not the environment. |
|
|
|
|
* |
|
|
|
|
* TODO Similar functionality is part of lib-jitsi-meet. This function should be |
|
|
|
|
* removed after https://github.com/jitsi/lib-jitsi-meet/pull/187 is merged.
|
|
|
|
|
* |
|
|
|
|
* @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance. |
|
|
|
|
* @private |
|
|
|
|
* @returns {boolean} |
|
|
|
|
*/ |
|
|
|
|
function _shouldMirror(track) { |
|
|
|
|
return ( |
|
|
|
|
track |
|
|
|
|
&& track.isLocal() |
|
|
|
|
&& track.isVideoTrack() |
|
|
|
|
|
|
|
|
|
// XXX Type of the return value of
|
|
|
|
|
// JitsiLocalTrack#getCameraFacingMode() happens to be named
|
|
|
|
|
// CAMERA_FACING_MODE as well, it's defined by lib-jitsi-meet. Note
|
|
|
|
|
// though that the type of the value on the right side of the
|
|
|
|
|
// equality check is defined by jitsi-meet-react. The type
|
|
|
|
|
// definitions are surely compatible today but that may not be the
|
|
|
|
|
// case tomorrow.
|
|
|
|
|
&& track.getCameraFacingMode() === CAMERA_FACING_MODE.USER |
|
|
|
|
&& !track.isScreenSharing() |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Create an action for when a new track has been signaled to be added to the |
|
|
|
|
* conference. |
|
|
|
@ -240,6 +207,7 @@ function _disposeAndRemoveTracks(tracks) { |
|
|
|
|
* through. |
|
|
|
|
* @param {MEDIA_TYPE} mediaType - The <tt>MEDIA_TYPE</tt> of the first |
|
|
|
|
* <tt>JitsiLocalTrack</tt> to be returned. |
|
|
|
|
* @private |
|
|
|
|
* @returns {JitsiLocalTrack} The first <tt>JitsiLocalTrack</tt>, if any, in the |
|
|
|
|
* specified <tt>tracks</tt> of the specified <tt>mediaType</tt>. |
|
|
|
|
*/ |
|
|
|
@ -287,12 +255,46 @@ function _getLocalTracksToChange(currentTracks, newTracks) { |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns true if the provided JitsiTrack should be rendered as a mirror. |
|
|
|
|
* |
|
|
|
|
* We only want to show a video in mirrored mode when: |
|
|
|
|
* 1) The video source is local, and not remote. |
|
|
|
|
* 2) The video source is a camera, not a desktop (capture). |
|
|
|
|
* 3) The camera is capturing the user, not the environment. |
|
|
|
|
* |
|
|
|
|
* TODO Similar functionality is part of lib-jitsi-meet. This function should be |
|
|
|
|
* removed after https://github.com/jitsi/lib-jitsi-meet/pull/187 is merged.
|
|
|
|
|
* |
|
|
|
|
* @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance. |
|
|
|
|
* @private |
|
|
|
|
* @returns {boolean} |
|
|
|
|
*/ |
|
|
|
|
function _shouldMirror(track) { |
|
|
|
|
return ( |
|
|
|
|
track |
|
|
|
|
&& track.isLocal() |
|
|
|
|
&& track.isVideoTrack() |
|
|
|
|
|
|
|
|
|
// XXX Type of the return value of
|
|
|
|
|
// JitsiLocalTrack#getCameraFacingMode() happens to be named
|
|
|
|
|
// CAMERA_FACING_MODE as well, it's defined by lib-jitsi-meet. Note
|
|
|
|
|
// though that the type of the value on the right side of the
|
|
|
|
|
// equality check is defined by jitsi-meet-react. The type
|
|
|
|
|
// definitions are surely compatible today but that may not be the
|
|
|
|
|
// case tomorrow.
|
|
|
|
|
&& track.getCameraFacingMode() === CAMERA_FACING_MODE.USER |
|
|
|
|
&& !track.isScreenSharing() |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Set new local tracks replacing any existing tracks that were previously |
|
|
|
|
* available. Currently only one audio and one video local tracks are allowed. |
|
|
|
|
* |
|
|
|
|
* @param {(JitsiLocalTrack|JitsiRemoteTrack)[]} [newTracks=[]] - List of new |
|
|
|
|
* media tracks. |
|
|
|
|
* @private |
|
|
|
|
* @returns {Function} |
|
|
|
|
*/ |
|
|
|
|
function _updateLocalTracks(newTracks = []) { |
|
|
|
|