Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove previously deprecated APIs #948

Merged
merged 2 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -55,8 +55,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 @@ -778,10 +776,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, setLogExtension, setLogLevel } from './logger';
import { DataPacket_Kind, DisconnectReason, VideoQuality } 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 @@ -57,7 +57,6 @@ export {
LogLevel,
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 @@ -114,12 +114,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 @@ -499,7 +496,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 @@ -894,15 +890,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 @@ -1865,8 +1852,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 @@ -727,7 +727,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