@basmilius/apple-sdk 0.13.2 → 0.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +12 -0
- package/dist/index.mjs +51 -7
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -1779,6 +1779,18 @@ declare class CompanionLinkManager extends EventEmitter<EventMap> {
|
|
|
1779
1779
|
* Stops the active Siri session on the device.
|
|
1780
1780
|
*/
|
|
1781
1781
|
siriStop(): Promise<void>;
|
|
1782
|
+
/** @internal */
|
|
1783
|
+
onAttentionStateChanged(state: AttentionState$1): void;
|
|
1784
|
+
/** @internal */
|
|
1785
|
+
onMediaControlFlagsChanged(flags: number, capabilities: MediaCapabilities): void;
|
|
1786
|
+
/** @internal */
|
|
1787
|
+
onNowPlayingInfoChanged(info: Record<string, unknown> | null): void;
|
|
1788
|
+
/** @internal */
|
|
1789
|
+
onSupportedActionsChanged(actions: Record<string, unknown>): void;
|
|
1790
|
+
/** @internal */
|
|
1791
|
+
onTextInputChanged(state: TextInputState$1): void;
|
|
1792
|
+
/** @internal */
|
|
1793
|
+
onVolumeAvailabilityChanged(available: boolean): void;
|
|
1782
1794
|
/**
|
|
1783
1795
|
* Handles the stream close event. Emits 'disconnected' with unexpected=true if not intentional.
|
|
1784
1796
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -3130,9 +3130,16 @@ var AirPlayManager = class extends EventEmitter {
|
|
|
3130
3130
|
clearInterval(this.#feedbackInterval);
|
|
3131
3131
|
this.#feedbackInterval = void 0;
|
|
3132
3132
|
}
|
|
3133
|
+
this.#prevDataStream?.off("error", this.onError);
|
|
3134
|
+
this.#prevDataStream?.off("timeout", this.onTimeout);
|
|
3135
|
+
this.#prevEventStream?.off("error", this.onError);
|
|
3136
|
+
this.#prevEventStream?.off("timeout", this.onTimeout);
|
|
3137
|
+
this.#prevDataStream = void 0;
|
|
3138
|
+
this.#prevEventStream = void 0;
|
|
3133
3139
|
this.#cleanupPlayUrl();
|
|
3134
3140
|
this.#cleanupStream();
|
|
3135
3141
|
this.#unsubscribe();
|
|
3142
|
+
this.#artwork.clear();
|
|
3136
3143
|
this.#protocol.disconnect();
|
|
3137
3144
|
this.emit("disconnected", false);
|
|
3138
3145
|
}
|
|
@@ -3819,6 +3826,12 @@ var CompanionLinkManager = class extends EventEmitter {
|
|
|
3819
3826
|
this.onClose = this.onClose.bind(this);
|
|
3820
3827
|
this.onError = this.onError.bind(this);
|
|
3821
3828
|
this.onTimeout = this.onTimeout.bind(this);
|
|
3829
|
+
this.onAttentionStateChanged = this.onAttentionStateChanged.bind(this);
|
|
3830
|
+
this.onMediaControlFlagsChanged = this.onMediaControlFlagsChanged.bind(this);
|
|
3831
|
+
this.onNowPlayingInfoChanged = this.onNowPlayingInfoChanged.bind(this);
|
|
3832
|
+
this.onSupportedActionsChanged = this.onSupportedActionsChanged.bind(this);
|
|
3833
|
+
this.onTextInputChanged = this.onTextInputChanged.bind(this);
|
|
3834
|
+
this.onVolumeAvailabilityChanged = this.onVolumeAvailabilityChanged.bind(this);
|
|
3822
3835
|
}
|
|
3823
3836
|
/**
|
|
3824
3837
|
* Connects to the Companion Link device, performs pair-verify, and sets up
|
|
@@ -4151,14 +4164,21 @@ var CompanionLinkManager = class extends EventEmitter {
|
|
|
4151
4164
|
this.#protocol.context.logger.error("Heartbeat failed", err);
|
|
4152
4165
|
}
|
|
4153
4166
|
}, 15e3);
|
|
4154
|
-
if (this.#state)
|
|
4167
|
+
if (this.#state) {
|
|
4168
|
+
this.#state.off("attentionStateChanged", this.onAttentionStateChanged);
|
|
4169
|
+
this.#state.off("mediaControlFlagsChanged", this.onMediaControlFlagsChanged);
|
|
4170
|
+
this.#state.off("nowPlayingInfoChanged", this.onNowPlayingInfoChanged);
|
|
4171
|
+
this.#state.off("supportedActionsChanged", this.onSupportedActionsChanged);
|
|
4172
|
+
this.#state.off("textInputChanged", this.onTextInputChanged);
|
|
4173
|
+
this.#state.off("volumeAvailabilityChanged", this.onVolumeAvailabilityChanged);
|
|
4174
|
+
}
|
|
4155
4175
|
this.#state = new CompanionLinkState(this.#protocol);
|
|
4156
|
-
this.#state.on("attentionStateChanged",
|
|
4157
|
-
this.#state.on("mediaControlFlagsChanged",
|
|
4158
|
-
this.#state.on("nowPlayingInfoChanged",
|
|
4159
|
-
this.#state.on("supportedActionsChanged",
|
|
4160
|
-
this.#state.on("textInputChanged",
|
|
4161
|
-
this.#state.on("volumeAvailabilityChanged",
|
|
4176
|
+
this.#state.on("attentionStateChanged", this.onAttentionStateChanged);
|
|
4177
|
+
this.#state.on("mediaControlFlagsChanged", this.onMediaControlFlagsChanged);
|
|
4178
|
+
this.#state.on("nowPlayingInfoChanged", this.onNowPlayingInfoChanged);
|
|
4179
|
+
this.#state.on("supportedActionsChanged", this.onSupportedActionsChanged);
|
|
4180
|
+
this.#state.on("textInputChanged", this.onTextInputChanged);
|
|
4181
|
+
this.#state.on("volumeAvailabilityChanged", this.onVolumeAvailabilityChanged);
|
|
4162
4182
|
this.#state.subscribe();
|
|
4163
4183
|
await this.#state.fetchInitialState();
|
|
4164
4184
|
} catch (err) {
|
|
@@ -4167,6 +4187,30 @@ var CompanionLinkManager = class extends EventEmitter {
|
|
|
4167
4187
|
throw err;
|
|
4168
4188
|
}
|
|
4169
4189
|
}
|
|
4190
|
+
/** @internal */
|
|
4191
|
+
onAttentionStateChanged(state) {
|
|
4192
|
+
this.emit("attentionStateChanged", state);
|
|
4193
|
+
}
|
|
4194
|
+
/** @internal */
|
|
4195
|
+
onMediaControlFlagsChanged(flags, capabilities) {
|
|
4196
|
+
this.emit("mediaControlFlagsChanged", flags, capabilities);
|
|
4197
|
+
}
|
|
4198
|
+
/** @internal */
|
|
4199
|
+
onNowPlayingInfoChanged(info) {
|
|
4200
|
+
this.emit("nowPlayingInfoChanged", info);
|
|
4201
|
+
}
|
|
4202
|
+
/** @internal */
|
|
4203
|
+
onSupportedActionsChanged(actions) {
|
|
4204
|
+
this.emit("supportedActionsChanged", actions);
|
|
4205
|
+
}
|
|
4206
|
+
/** @internal */
|
|
4207
|
+
onTextInputChanged(state) {
|
|
4208
|
+
this.emit("textInputChanged", state);
|
|
4209
|
+
}
|
|
4210
|
+
/** @internal */
|
|
4211
|
+
onVolumeAvailabilityChanged(available) {
|
|
4212
|
+
this.emit("volumeAvailabilityChanged", available);
|
|
4213
|
+
}
|
|
4170
4214
|
/**
|
|
4171
4215
|
* Handles the stream close event. Emits 'disconnected' with unexpected=true if not intentional.
|
|
4172
4216
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basmilius/apple-sdk",
|
|
3
3
|
"description": "High-level SDK for controlling Apple devices (Apple TV, HomePod) via AirPlay and Companion Link.",
|
|
4
|
-
"version": "0.13.
|
|
4
|
+
"version": "0.13.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": {
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@basmilius/apple-airplay": "0.13.
|
|
49
|
-
"@basmilius/apple-common": "0.13.
|
|
50
|
-
"@basmilius/apple-companion-link": "0.13.
|
|
51
|
-
"@basmilius/apple-encoding": "0.13.
|
|
52
|
-
"@basmilius/apple-raop": "0.13.
|
|
48
|
+
"@basmilius/apple-airplay": "0.13.3",
|
|
49
|
+
"@basmilius/apple-common": "0.13.3",
|
|
50
|
+
"@basmilius/apple-companion-link": "0.13.3",
|
|
51
|
+
"@basmilius/apple-encoding": "0.13.3",
|
|
52
|
+
"@basmilius/apple-raop": "0.13.3"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/bun": "^1.3.11",
|