@basmilius/apple-devices 0.0.102 → 0.0.103

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -12
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -1591,18 +1591,20 @@ class device_default extends EventEmitter2 {
1591
1591
  }
1592
1592
  }
1593
1593
  async#onClose() {
1594
- await this.disconnectSafely();
1595
- this.emit("disconnected", false);
1594
+ reporter2.net("#onClose() called on airplay device.");
1595
+ if (!this.#disconnect) {
1596
+ await this.disconnectSafely();
1597
+ this.emit("disconnected", true);
1598
+ } else {
1599
+ this.emit("disconnected", false);
1600
+ }
1596
1601
  }
1597
1602
  async#onError(err) {
1598
1603
  reporter2.error("AirPlay error", err);
1599
- await this.disconnectSafely();
1600
- this.emit("disconnected", true);
1601
1604
  }
1602
1605
  async#onTimeout() {
1603
1606
  reporter2.error("AirPlay timeout");
1604
- await this.disconnectSafely();
1605
- this.emit("disconnected", true);
1607
+ await this.#protocol.rtsp.destroy();
1606
1608
  }
1607
1609
  async#setup() {
1608
1610
  const keys = this.#keys;
@@ -1746,18 +1748,20 @@ class device_default2 extends EventEmitter3 {
1746
1748
  }
1747
1749
  }
1748
1750
  async#onClose() {
1749
- await this.disconnectSafely();
1750
- this.emit("disconnected", false);
1751
+ reporter3.net("#onClose() called on companion link device.");
1752
+ if (!this.#disconnect) {
1753
+ await this.disconnectSafely();
1754
+ this.emit("disconnected", true);
1755
+ } else {
1756
+ this.emit("disconnected", false);
1757
+ }
1751
1758
  }
1752
1759
  async#onError(err) {
1753
1760
  reporter3.error("Companion Link error", err);
1754
- await this.disconnectSafely();
1755
- this.emit("disconnected", true);
1756
1761
  }
1757
1762
  async#onTimeout() {
1758
1763
  reporter3.error("Companion Link timeout");
1759
- await this.disconnectSafely();
1760
- this.emit("disconnected", true);
1764
+ await this.#protocol.socket.destroy();
1761
1765
  }
1762
1766
  async#setup() {
1763
1767
  const keys = this.#keys;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@basmilius/apple-devices",
3
3
  "description": "Exposes various Apple devices to connect with either AirPlay or Companion Link.",
4
- "version": "0.0.102",
4
+ "version": "0.0.103",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": {
@@ -43,10 +43,10 @@
43
43
  }
44
44
  },
45
45
  "dependencies": {
46
- "@basmilius/apple-airplay": "0.0.102",
47
- "@basmilius/apple-common": "0.0.102",
48
- "@basmilius/apple-companion-link": "0.0.102",
49
- "@basmilius/apple-encoding": "0.0.102"
46
+ "@basmilius/apple-airplay": "0.0.103",
47
+ "@basmilius/apple-common": "0.0.103",
48
+ "@basmilius/apple-companion-link": "0.0.103",
49
+ "@basmilius/apple-encoding": "0.0.103"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@basmilius/tools": "^2.23.0",