fix(disableSelfView) Fix issue with remote participant video (#10582)
Fix issue where last participant is shown as inactive when the self view is hidden
This commit is contained in:
parent
c705dbaa2f
commit
f8908c143e
|
@ -176,7 +176,9 @@ class Filmstrip extends PureComponent<Props> {
|
|||
* @returns {void}
|
||||
*/
|
||||
_onViewableItemsChanged({ viewableItems = [] }) {
|
||||
if (!this._separateLocalThumbnail && viewableItems[0]?.index === 0) {
|
||||
const { _disableSelfView } = this.props;
|
||||
|
||||
if (!this._separateLocalThumbnail && !_disableSelfView && viewableItems[0]?.index === 0) {
|
||||
// Skip the local thumbnail.
|
||||
viewableItems.shift();
|
||||
}
|
||||
|
@ -189,7 +191,7 @@ class Filmstrip extends PureComponent<Props> {
|
|||
let startIndex = viewableItems[0].index;
|
||||
let endIndex = viewableItems[viewableItems.length - 1].index;
|
||||
|
||||
if (!this._separateLocalThumbnail) {
|
||||
if (!this._separateLocalThumbnail && !_disableSelfView) {
|
||||
// We are off by one in the remote participants array.
|
||||
startIndex -= 1;
|
||||
endIndex -= 1;
|
||||
|
|
|
@ -152,7 +152,9 @@ class TileView extends PureComponent<Props> {
|
|||
* @returns {void}
|
||||
*/
|
||||
_onViewableItemsChanged({ viewableItems = [] }: { viewableItems: Array<Object> }) {
|
||||
if (viewableItems[0]?.index === 0) {
|
||||
const { _disableSelfView } = this.props;
|
||||
|
||||
if (viewableItems[0]?.index === 0 && !_disableSelfView) {
|
||||
// Skip the local thumbnail.
|
||||
viewableItems.shift();
|
||||
}
|
||||
|
@ -163,8 +165,8 @@ class TileView extends PureComponent<Props> {
|
|||
}
|
||||
|
||||
// We are off by one in the remote participants array.
|
||||
const startIndex = viewableItems[0].index - 1;
|
||||
const endIndex = viewableItems[viewableItems.length - 1].index - 1;
|
||||
const startIndex = viewableItems[0].index - (_disableSelfView ? 0 : 1);
|
||||
const endIndex = viewableItems[viewableItems.length - 1].index - (_disableSelfView ? 0 : 1);
|
||||
|
||||
this.props.dispatch(setVisibleRemoteParticipants(startIndex, endIndex));
|
||||
}
|
||||
|
|
|
@ -249,11 +249,11 @@ class Filmstrip extends PureComponent <Props> {
|
|||
* @returns {Object}
|
||||
*/
|
||||
_calculateIndices(startIndex, stopIndex) {
|
||||
const { _currentLayout, _iAmRecorder, _thumbnailsReordered } = this.props;
|
||||
const { _currentLayout, _iAmRecorder, _thumbnailsReordered, _disableSelfView } = this.props;
|
||||
let start = startIndex;
|
||||
let stop = stopIndex;
|
||||
|
||||
if (_thumbnailsReordered) {
|
||||
if (_thumbnailsReordered && !_disableSelfView) {
|
||||
// In tile view, the indices needs to be offset by 1 because the first thumbnail is that of the local
|
||||
// endpoint. The remote participants start from index 1.
|
||||
if (!_iAmRecorder && _currentLayout === LAYOUTS.TILE_VIEW) {
|
||||
|
|
Loading…
Reference in New Issue