mirror of
https://github.com/DerTyp7/teamspeak-obs-overlay.git
synced 2025-10-30 05:07:12 +01:00
Merge pull request #22 from DerTyp876/16-hide-non-talking-clients
16 hide non talking clients
This commit is contained in:
11
README.md
11
README.md
@@ -14,7 +14,7 @@ This App uses the new "Remote Apps" feature of Teamspeak 5.
|
|||||||
|
|
||||||
1. Download the `index.html` of the latest release from [here](https://github.com/DerTyp876/ts5-obs-overlay/releases/tag/v1.0.0)
|
1. Download the `index.html` of the latest release from [here](https://github.com/DerTyp876/ts5-obs-overlay/releases/tag/v1.0.0)
|
||||||

|

|
||||||
1.1. (optional) You can rename the file. Just remember using the new file name in the future instead of `index.html`
|
1.1. (optional) You can rename the file. Just remember using the new file name in the future instead of `index.html`
|
||||||
2. Go into the Teamspeak 5 Settings and enable "Remote Apps"
|
2. Go into the Teamspeak 5 Settings and enable "Remote Apps"
|
||||||

|

|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ This App uses the new "Remote Apps" feature of Teamspeak 5.
|
|||||||
You can customize the overlay by adding parameters to the URL of the Browser Source.
|
You can customize the overlay by adding parameters to the URL of the Browser Source.
|
||||||
|
|
||||||
1. Open your Browser Source settings
|
1. Open your Browser Source settings
|
||||||
2. **Untick** the checkbox "Local File"
|
2. **Untick** the checkbox "Local File"
|
||||||
3. Add `file://` to the beginning of the URL
|
3. Add `file://` to the beginning of the URL
|
||||||

|

|
||||||
4. Start adding parameters like discribed below
|
4. Start adding parameters like discribed below
|
||||||
@@ -47,9 +47,10 @@ Real example: `file://C:/Users/.../index.html?remoteAppPort=5899`
|
|||||||
|
|
||||||
This is a list of all available parameters (all parameters are optional):
|
This is a list of all available parameters (all parameters are optional):
|
||||||
|
|
||||||
| Parameter | Description | Default |
|
| Parameter | Description | Type | Default |
|
||||||
| --------------- | -------------------------------------- | ------- |
|
| ---------------- | -------------------------------------- | ------- | ------- |
|
||||||
| `remoteAppPort` | The port of the Teamspeak 5 remote app | `5899` |
|
| `remoteAppPort` | The port of the Teamspeak 5 remote app | number | `5899` |
|
||||||
|
| `hideNonTalking` | Hide all non-talking clients | boolean | `false` |
|
||||||
|
|
||||||
## Setup (Developer)
|
## Setup (Developer)
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ export default function App() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const remoteAppPort = searchParams.get("remoteAppPort");
|
const remoteAppPort = searchParams.get("remoteAppPort");
|
||||||
|
|
||||||
|
console.log(searchParams.get("hideNonTalking"));
|
||||||
const tsConnection: ITS5ConnectionHandler = new TS5ConnectionHandler(
|
const tsConnection: ITS5ConnectionHandler = new TS5ConnectionHandler(
|
||||||
parseInt(remoteAppPort ?? "5899"),
|
parseInt(remoteAppPort ?? "5899"),
|
||||||
setConnections,
|
setConnections,
|
||||||
@@ -55,6 +56,7 @@ export default function App() {
|
|||||||
return (
|
return (
|
||||||
<div className="App">
|
<div className="App">
|
||||||
<Viewer
|
<Viewer
|
||||||
|
hideNonTalking={searchParams.get("hideNonTalking") === "true"}
|
||||||
clients={
|
clients={
|
||||||
clients.map((client) => {
|
clients.map((client) => {
|
||||||
if (client.channel?.id === currentChannel?.id && client.channel.connection.id === activeConnectionId) {
|
if (client.channel?.id === currentChannel?.id && client.channel.connection.id === activeConnectionId) {
|
||||||
|
|||||||
@@ -5,16 +5,27 @@ export default function Viewer({
|
|||||||
clients,
|
clients,
|
||||||
channel,
|
channel,
|
||||||
showChannelName = false,
|
showChannelName = false,
|
||||||
|
hideNonTalking = false,
|
||||||
}: {
|
}: {
|
||||||
clients: IClient[] | undefined;
|
clients: IClient[] | undefined;
|
||||||
channel: IChannel | undefined;
|
channel: IChannel | undefined;
|
||||||
showChannelName?: boolean;
|
showChannelName?: boolean;
|
||||||
|
hideNonTalking?: boolean;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div className="viewer">
|
<div className="viewer">
|
||||||
{showChannelName ? <h3>{channel?.properties.name}</h3> : null}
|
{showChannelName ? <h3>{channel?.properties.name}</h3> : null}
|
||||||
{clients?.map((client) => {
|
{clients?.map((client) => {
|
||||||
if (client) {
|
if (client) {
|
||||||
|
//* Non-talking client
|
||||||
|
if (
|
||||||
|
hideNonTalking &&
|
||||||
|
(client.properties.inputMuted || client.properties.outputMuted || client.talkStatus == 0)
|
||||||
|
) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
//* Normal client
|
||||||
return (
|
return (
|
||||||
<div className="client" key={`${client.id}-${client.channel?.connection.id}`}>
|
<div className="client" key={`${client.id}-${client.channel?.connection.id}`}>
|
||||||
{client.properties.outputMuted ? (
|
{client.properties.outputMuted ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user