@scalemule/nextjs 0.1.49 → 0.1.50
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/audio.js +5 -1
- package/dist/audio.mjs +5 -1
- package/package.json +1 -1
package/dist/audio.js
CHANGED
|
@@ -1197,6 +1197,7 @@ var NetworkPlayerClient = class {
|
|
|
1197
1197
|
this.target = null;
|
|
1198
1198
|
this.connected = false;
|
|
1199
1199
|
this.pending = false;
|
|
1200
|
+
this.handoffRequested = false;
|
|
1200
1201
|
this.openedAt = 0;
|
|
1201
1202
|
this.lastSeen = 0;
|
|
1202
1203
|
this.latest = null;
|
|
@@ -1213,10 +1214,11 @@ var NetworkPlayerClient = class {
|
|
|
1213
1214
|
this.lastSeen = Date.now();
|
|
1214
1215
|
if (!this.connected) {
|
|
1215
1216
|
const local = this.controller.getSnapshot();
|
|
1216
|
-
const handoff = this.
|
|
1217
|
+
const handoff = this.handoffRequested && !data.snapshot.queue.length && local.queue.length > 0;
|
|
1217
1218
|
this.controller.pause();
|
|
1218
1219
|
this.connected = true;
|
|
1219
1220
|
this.pending = false;
|
|
1221
|
+
this.handoffRequested = false;
|
|
1220
1222
|
if (handoff) this.post({ kind: "adopt", snapshot: local, play: local.status === "playing" || local.status === "loading" });
|
|
1221
1223
|
}
|
|
1222
1224
|
this.latest = data.snapshot;
|
|
@@ -1251,6 +1253,7 @@ var NetworkPlayerClient = class {
|
|
|
1251
1253
|
return;
|
|
1252
1254
|
}
|
|
1253
1255
|
this.pending = true;
|
|
1256
|
+
this.handoffRequested = true;
|
|
1254
1257
|
this.openedAt = Date.now();
|
|
1255
1258
|
}
|
|
1256
1259
|
command(command) {
|
|
@@ -1262,6 +1265,7 @@ var NetworkPlayerClient = class {
|
|
|
1262
1265
|
disconnect(notice) {
|
|
1263
1266
|
if (this.latest) this.controller.restore(this.latest);
|
|
1264
1267
|
this.connected = false;
|
|
1268
|
+
this.handoffRequested = false;
|
|
1265
1269
|
this.target = null;
|
|
1266
1270
|
this.latest = null;
|
|
1267
1271
|
this.update(null, notice);
|
package/dist/audio.mjs
CHANGED
|
@@ -1177,6 +1177,7 @@ var NetworkPlayerClient = class {
|
|
|
1177
1177
|
this.target = null;
|
|
1178
1178
|
this.connected = false;
|
|
1179
1179
|
this.pending = false;
|
|
1180
|
+
this.handoffRequested = false;
|
|
1180
1181
|
this.openedAt = 0;
|
|
1181
1182
|
this.lastSeen = 0;
|
|
1182
1183
|
this.latest = null;
|
|
@@ -1193,10 +1194,11 @@ var NetworkPlayerClient = class {
|
|
|
1193
1194
|
this.lastSeen = Date.now();
|
|
1194
1195
|
if (!this.connected) {
|
|
1195
1196
|
const local = this.controller.getSnapshot();
|
|
1196
|
-
const handoff = this.
|
|
1197
|
+
const handoff = this.handoffRequested && !data.snapshot.queue.length && local.queue.length > 0;
|
|
1197
1198
|
this.controller.pause();
|
|
1198
1199
|
this.connected = true;
|
|
1199
1200
|
this.pending = false;
|
|
1201
|
+
this.handoffRequested = false;
|
|
1200
1202
|
if (handoff) this.post({ kind: "adopt", snapshot: local, play: local.status === "playing" || local.status === "loading" });
|
|
1201
1203
|
}
|
|
1202
1204
|
this.latest = data.snapshot;
|
|
@@ -1231,6 +1233,7 @@ var NetworkPlayerClient = class {
|
|
|
1231
1233
|
return;
|
|
1232
1234
|
}
|
|
1233
1235
|
this.pending = true;
|
|
1236
|
+
this.handoffRequested = true;
|
|
1234
1237
|
this.openedAt = Date.now();
|
|
1235
1238
|
}
|
|
1236
1239
|
command(command) {
|
|
@@ -1242,6 +1245,7 @@ var NetworkPlayerClient = class {
|
|
|
1242
1245
|
disconnect(notice) {
|
|
1243
1246
|
if (this.latest) this.controller.restore(this.latest);
|
|
1244
1247
|
this.connected = false;
|
|
1248
|
+
this.handoffRequested = false;
|
|
1245
1249
|
this.target = null;
|
|
1246
1250
|
this.latest = null;
|
|
1247
1251
|
this.update(null, notice);
|
package/package.json
CHANGED