Skip to content

Commit

Permalink
Merge pull request #167 from TeaSpeak/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
WolverinDEV authored Feb 12, 2021
2 parents 9618350 + c297c44 commit f75a6e2
Show file tree
Hide file tree
Showing 89 changed files with 2,553 additions and 1,513 deletions.
15 changes: 15 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# Changelog:
* **22.01.21**
- Allowing the user to easily change the channel name mode
- Fixed channel name mode parsing
- Improved the modal algorithms as preparation for easier popoutable modals

* **16.01.21**
- Various bugfixes (Thanks to Vafin)

* **15.01.21**
- Fixed the history toggle (Thanks to Vafin)

* **12.01.21**
- Fixed bug where the quick video select popup did not start the video broadcasting
- Fixed a bug where an invalid H264 codec may caused video connection setup failure

* **09.01.21**
- The connect modal now connects when pressing `Enter` on the address line

Expand Down
2 changes: 1 addition & 1 deletion loader/app/loader/script_loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function load_script_url(url: string) : Promise<void> {
const timeout_handle = setTimeout(() => {
cleanup();
reject("timeout");
}, 15 * 1000);
}, 120 * 1000);
script_tag.type = "application/javascript";
script_tag.async = true;
script_tag.defer = true;
Expand Down
7 changes: 5 additions & 2 deletions shared/js/ConnectionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ import {ServerEventLog} from "tc-shared/connectionlog/ServerEventLog";
import {PlaylistManager} from "tc-shared/music/PlaylistManager";
import {connectionHistory} from "tc-shared/connectionlog/History";
import {ConnectParameters} from "tc-shared/ui/modal/connect/Controller";
import {assertMainApplication} from "tc-shared/ui/utils";

assertMainApplication();

export enum InputHardwareState {
MISSING,
Expand Down Expand Up @@ -240,7 +243,7 @@ export class ConnectionHandler {
this.localClient = new LocalClientEntry(this);
this.localClient.channelTree = this.channelTree;

this.events_.register_handler(this);
this.events_.registerHandler(this);
this.pluginCmdRegistry.registerHandler(new W2GPluginCmdHandler());

this.events_.fire("notify_handler_initialized");
Expand Down Expand Up @@ -1073,7 +1076,7 @@ export class ConnectionHandler {
}

destroy() {
this.events_.unregister_handler(this);
this.events_.unregisterHandler(this);
this.cancelAutoReconnect(true);

this.pluginCmdRegistry?.destroy();
Expand Down
3 changes: 3 additions & 0 deletions shared/js/ConnectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import {ConnectionHandler, DisconnectReason} from "./ConnectionHandler";
import {Registry} from "./events";
import {Stage} from "tc-loader";
import * as loader from "tc-loader";
import {assertMainApplication} from "tc-shared/ui/utils";

assertMainApplication();

export interface ConnectionManagerEvents {
notify_handler_created: {
Expand Down
3 changes: 2 additions & 1 deletion shared/js/clientservice/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class ClientServiceConnection {
let address;
address = "client-services.teaspeak.de:27791";
//address = "localhost:1244";
//address = "192.168.40.135:1244";

this.connection = new WebSocket(`wss://${address}/ws-api/v${kApiVersion}`);
this.connection.onclose = event => {
Expand Down Expand Up @@ -375,7 +376,7 @@ export class ClientServices {
} else {
const os = window.detectedBrowser.os;
const osParts = os.split(" ");
if(osParts.last().match(/^[0-9]+$/)) {
if(osParts.last().match(/^[0-9\.]+$/)) {
payload.platform_version = osParts.last();
osParts.splice(osParts.length - 1, 1);
}
Expand Down
6 changes: 3 additions & 3 deletions shared/js/connection/ServerFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class ServerFeatures {
readonly events: Registry<ServerFeatureEvents>;
private readonly connection: ConnectionHandler;
private readonly explicitCommandHandler: ExplicitCommandHandler;
private readonly stateChangeListener: (event: ConnectionEvents["notify_connection_state_changed"]) => void;
private readonly stateChangeListener: () => void;

private featureAwait: Promise<boolean>;
private featureAwaitCallback: (success: boolean) => void;
Expand Down Expand Up @@ -68,7 +68,7 @@ export class ServerFeatures {
}
});

this.connection.events().on("notify_connection_state_changed", this.stateChangeListener = event => {
this.stateChangeListener = this.connection.events().on("notify_connection_state_changed", event => {
if(event.newState === ConnectionState.CONNECTED) {
this.connection.getServerConnection().send_command("listfeaturesupport").catch(error => {
this.disableAllFeatures();
Expand All @@ -95,7 +95,7 @@ export class ServerFeatures {
}

destroy() {
this.connection.events().off(this.stateChangeListener);
this.stateChangeListener();
this.connection.getServerConnection()?.command_handler_boss()?.unregister_explicit_handler("notifyfeaturesupport", this.explicitCommandHandler);

if(this.featureAwaitCallback) {
Expand Down
3 changes: 2 additions & 1 deletion shared/js/connection/rtc/Connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class RetryTimeCalculator {
}

calculateRetryTime() {
return 0;
if(this.retryCount >= 5) {
/* no more retries */
return 0;
Expand Down Expand Up @@ -542,6 +541,8 @@ export class RTCConnection {
this.reset(true);

this.connection.events.on("notify_connection_state_changed", event => this.handleConnectionStateChanged(event));

(window as any).rtp = this;
}

destroy() {
Expand Down
12 changes: 8 additions & 4 deletions shared/js/connection/rtc/SdpUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class SdpProcessor {
rate: 90000,
rtcpFb: [ "nack", "nack pli", "ccm fir", "transport-cc" ],
},
{
window.detectedBrowser.name.indexOf("ios") === -1 && window.detectedBrowser.name !== "safari" ? {
payload: H264_PAYLOAD_TYPE,
codec: "H264",
rate: 90000,
Expand All @@ -57,10 +57,10 @@ export class SdpProcessor {
fmtp: {
"level-asymmetry-allowed": 1,
"packetization-mode": 1,
"profile-level-id": "4d0028",
"profile-level-id": "42001f",
"max-fr": 30,
}
},
} : undefined,
];

private rtpRemoteChannelMapping: {[key: string]: number};
Expand Down Expand Up @@ -150,7 +150,11 @@ export class SdpProcessor {
media.rtcpFb = [];
media.rtcpFbTrrInt = [];

for(let codec of (media.type === "audio" ? this.kAudioCodecs : this.kVideoCodecs)) {
for(const codec of (media.type === "audio" ? this.kAudioCodecs : this.kVideoCodecs)) {
if(!codec) {
continue;
}

media.rtp.push({
payload: codec.payload,
codec: codec.codec,
Expand Down
Loading

0 comments on commit f75a6e2

Please sign in to comment.