Skip to content

Commit

Permalink
Remove previously deprecated APIs (#948)
Browse files Browse the repository at this point in the history
* Remove previously deprecated APIs

* Create three-badgers-warn.md
  • Loading branch information
lukasIO committed Jan 10, 2024
1 parent 831322d commit fe84452
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 45 deletions.
5 changes: 5 additions & 0 deletions .changeset/three-badgers-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-client": major
---

Remove previously deprecated APIs
6 changes: 0 additions & 6 deletions src/api/SignalClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ interface ConnectOpts extends SignalOptions {
// public options
export interface SignalOptions {
autoSubscribe: boolean;
/** @deprecated */
publishOnly?: string;
adaptiveStream?: boolean;
maxRetries: number;
e2eeEnabled: boolean;
Expand Down Expand Up @@ -824,10 +822,6 @@ function createConnectionParams(token: string, info: ClientInfo, opts: ConnectOp
params.set('browser_version', info.browserVersion);
}

if (opts.publishOnly !== undefined) {
params.set('publish', opts.publishOnly);
}

if (opts.adaptiveStream) {
params.set('adaptive_stream', '1');
}
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { LogLevel, getLogger, setLogExtension, setLogLevel } from './logger';
import { DataPacket_Kind, DisconnectReason } from './proto/livekit_models_pb';
import DefaultReconnectPolicy from './room/DefaultReconnectPolicy';
import Room, { ConnectionState, RoomState } from './room/Room';
import Room, { ConnectionState } from './room/Room';
import LocalParticipant from './room/participant/LocalParticipant';
import Participant, { ConnectionQuality } from './room/participant/Participant';
import type { ParticipantTrackPermission } from './room/participant/ParticipantTrackPermission';
Expand Down Expand Up @@ -58,7 +58,6 @@ export {
getLogger,
Room,
ConnectionState,
RoomState,
DataPacket_Kind,
DisconnectReason,
Participant,
Expand Down
6 changes: 0 additions & 6 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,6 @@ export interface InternalRoomConnectOptions {
*/
rtcConfig?: RTCConfiguration;

/**
* @deprecated
* publish only mode
*/
publishOnly?: string;

/** specifies how often an initial join connection is allowed to retry (only applicable if server is not reachable) */
maxRetries: number;

Expand Down
15 changes: 0 additions & 15 deletions src/room/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ export enum ConnectionState {

const connectionReconcileFrequency = 2 * 1000;

/** @deprecated RoomState has been renamed to [[ConnectionState]] */
export const RoomState = ConnectionState;

/**
* In LiveKit, a room is the logical grouping for a list of participants.
* Participants in a room can publish tracks, and subscribe to others' tracks.
Expand Down Expand Up @@ -517,7 +514,6 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
token,
{
autoSubscribe: connectOptions.autoSubscribe,
publishOnly: connectOptions.publishOnly,
adaptiveStream:
typeof roomOptions.adaptiveStream === 'object' ? true : roomOptions.adaptiveStream,
maxRetries: connectOptions.maxRetries,
Expand Down Expand Up @@ -930,15 +926,6 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
return !this.isVideoPlaybackBlocked;
}

/**
* Returns the active audio output device used in this room.
* @return the previously successfully set audio output device ID or an empty string if the default device is used.
* @deprecated use `getActiveDevice('audiooutput')` instead
*/
getActiveAudioOutputDevice(): string {
return this.options.audioOutput?.deviceId ?? '';
}

getActiveDevice(kind: MediaDeviceKind): string | undefined {
return this.localParticipant.activeDeviceMap.get(kind);
}
Expand Down Expand Up @@ -1960,8 +1947,6 @@ export type RoomEventCallbacks = {
reconnecting: () => void;
reconnected: () => void;
disconnected: (reason?: DisconnectReason) => void;
/** @deprecated stateChanged has been renamed to connectionStateChanged */
stateChanged: (state: ConnectionState) => void;
connectionStateChanged: (state: ConnectionState) => void;
mediaDevicesChanged: () => void;
participantConnected: (participant: RemoteParticipant) => void;
Expand Down
4 changes: 0 additions & 4 deletions src/room/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import { AudioPresets, ScreenSharePresets, VideoPresets } from './track/options'
export const defaultVideoCodec = 'vp8';

export const publishDefaults: TrackPublishDefaults = {
/**
* @deprecated
*/
audioBitrate: AudioPresets.music.maxBitrate,
audioPreset: AudioPresets.music,
dtx: true,
red: true,
Expand Down
5 changes: 0 additions & 5 deletions src/room/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ export enum RoomEvent {
*/
ConnectionStateChanged = 'connectionStateChanged',

/**
* @deprecated StateChanged has been renamed to ConnectionStateChanged
*/
StateChanged = 'connectionStateChanged',

/**
* When input or output devices on the machine have changed.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/room/participant/LocalParticipant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ export default class LocalParticipant extends Participant {
} else if (track.kind === Track.Kind.Audio) {
encodings = [
{
maxBitrate: opts.audioPreset?.maxBitrate ?? opts.audioBitrate,
maxBitrate: opts.audioPreset?.maxBitrate,
priority: opts.audioPreset?.priority ?? 'high',
networkPriority: opts.audioPreset?.priority ?? 'high',
},
Expand Down
6 changes: 0 additions & 6 deletions src/room/track/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ export interface TrackPublishDefaults {
*/
videoCodec?: VideoCodec;

/**
* max audio bitrate, defaults to [[AudioPresets.music]]
* @deprecated use `audioPreset` instead
*/
audioBitrate?: number;

/**
* which audio preset should be used for publishing (audio) tracks
* defaults to [[AudioPresets.music]]
Expand Down

0 comments on commit fe84452

Please sign in to comment.