Merge pull request #364 from Astagor/browse_passive_users
Browse passive users - fixed for filmstripauto_join_3.3
commit
042bc95b3a
|
|
@ -304,12 +304,18 @@ export default class RoomClient
|
||||||
{
|
{
|
||||||
case String.fromCharCode(37):
|
case String.fromCharCode(37):
|
||||||
{
|
{
|
||||||
this._spotlights.setPrevAsSelected();
|
const newPeerId = this._spotlights.getPrevAsSelected(
|
||||||
|
store.getState().room.selectedPeerId);
|
||||||
|
|
||||||
|
if (newPeerId) this.setSelectedPeer(newPeerId);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case String.fromCharCode(39):
|
case String.fromCharCode(39):
|
||||||
{
|
{
|
||||||
this._spotlights.setNextAsSelected();
|
const newPeerId = this._spotlights.getNextAsSelected(
|
||||||
|
store.getState().room.selectedPeerId);
|
||||||
|
|
||||||
|
if (newPeerId) this.setSelectedPeer(newPeerId);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'A': // Activate advanced mode
|
case 'A': // Activate advanced mode
|
||||||
|
|
|
||||||
|
|
@ -46,90 +46,72 @@ export default class Spotlights extends EventEmitter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setNextAsSelected()
|
getNextAsSelected(peerId)
|
||||||
{
|
{
|
||||||
let peerId = null;
|
let newSelectedPeer = null;
|
||||||
|
|
||||||
if (this._selectedSpotlights.length > 0)
|
if (peerId == null && this._unmutablePeerList.length > 0)
|
||||||
{
|
|
||||||
peerId = this._selectedSpotlights[0];
|
|
||||||
}
|
|
||||||
else if (this._unmutablePeerList.length > 0)
|
|
||||||
{
|
{
|
||||||
peerId = this._unmutablePeerList[0];
|
peerId = this._unmutablePeerList[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peerId != null &&
|
if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length)
|
||||||
this._currentSpotlights.length < this._unmutablePeerList.length)
|
|
||||||
{
|
{
|
||||||
const oldIndex = this._unmutablePeerList.indexOf(peerId);
|
const oldIndex = this._unmutablePeerList.indexOf(peerId);
|
||||||
|
|
||||||
let index = oldIndex;
|
let index = oldIndex;
|
||||||
|
|
||||||
index++;
|
index++;
|
||||||
do
|
for (let i = 0; i < this._unmutablePeerList.length; i++)
|
||||||
{
|
{
|
||||||
if (index >= this._unmutablePeerList.length)
|
if (index >= this._unmutablePeerList.length)
|
||||||
{
|
{
|
||||||
index = 0;
|
index = 0;
|
||||||
}
|
}
|
||||||
const newSelectedPeer = this._unmutablePeerList[index];
|
newSelectedPeer = this._unmutablePeerList[index];
|
||||||
|
|
||||||
if (!this._currentSpotlights.includes(newSelectedPeer))
|
if (!this._currentSpotlights.includes(newSelectedPeer))
|
||||||
{
|
{
|
||||||
this.setPeerSpotlight(newSelectedPeer);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
if (index === oldIndex)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} while (true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setPrevAsSelected()
|
return newSelectedPeer;
|
||||||
{
|
|
||||||
let peerId = null;
|
|
||||||
|
|
||||||
if (this._selectedSpotlights.length > 0)
|
|
||||||
{
|
|
||||||
peerId = this._selectedSpotlights[0];
|
|
||||||
}
|
}
|
||||||
else if (this._unmutablePeerList.length > 0)
|
|
||||||
|
getPrevAsSelected(peerId)
|
||||||
|
{
|
||||||
|
let newSelectedPeer = null;
|
||||||
|
|
||||||
|
if (peerId == null && this._unmutablePeerList.length > 0)
|
||||||
{
|
{
|
||||||
peerId = this._unmutablePeerList[0];
|
peerId = this._unmutablePeerList[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peerId != null &&
|
if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length)
|
||||||
this._currentSpotlights.length < this._unmutablePeerList.length)
|
|
||||||
{
|
{
|
||||||
const oldIndex = this._unmutablePeerList.indexOf(peerId);
|
const oldIndex = this._unmutablePeerList.indexOf(peerId);
|
||||||
|
|
||||||
let index = oldIndex;
|
let index = oldIndex;
|
||||||
|
|
||||||
index--;
|
index--;
|
||||||
do
|
for (let i = 0; i < this._unmutablePeerList.length; i++)
|
||||||
{
|
{
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
{
|
{
|
||||||
index = this._unmutablePeerList.length - 1;
|
index = this._unmutablePeerList.length - 1;
|
||||||
}
|
}
|
||||||
const newSelectedPeer = this._unmutablePeerList[index];
|
newSelectedPeer = this._unmutablePeerList[index];
|
||||||
|
|
||||||
if (!this._currentSpotlights.includes(newSelectedPeer))
|
if (!this._currentSpotlights.includes(newSelectedPeer))
|
||||||
{
|
{
|
||||||
this.setPeerSpotlight(newSelectedPeer);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
index--;
|
index--;
|
||||||
if (index === oldIndex)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} while (true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return newSelectedPeer;
|
||||||
}
|
}
|
||||||
|
|
||||||
setPeerSpotlight(peerId)
|
setPeerSpotlight(peerId)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue