@scarlett-player/gestures 1.12.0 → 1.14.0

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/README.md CHANGED
@@ -41,6 +41,7 @@ const player = await createPlayer({
41
41
  ## Behaviour
42
42
 
43
43
  - Not installed for audio: when `mediaType` is `'audio'` at init the plugin stays inactive.
44
+ - The tap surface stands down entirely while a `@scarlett-player/clips` session is open, and comes back when it closes: the editor turns the whole picture into drag handles and a toolbar, and a double-tap-to-seek layer over that is two features competing for the same finger.
44
45
  - Seeking is refused while Chromecast or AirPlay is active, on live streams with no seekable range, and on VOD until a finite duration is known.
45
46
  - On live DVR a seek is clamped to the seekable range. A forward tap at the live edge announces "Already at the live edge" instead of showing a ripple.
46
47
  - Each tap in a run adds `seekSeconds`; the label shows the cumulative total. A tap in the opposite zone ends the run rather than reversing it, and a drag or a second finger cancels it.
package/dist/index.cjs CHANGED
@@ -354,7 +354,7 @@ var GestureOverlay = class {
354
354
  };
355
355
 
356
356
  // src/version.ts
357
- var PKG_VERSION = true ? "1.12.0" : "0.0.0-dev";
357
+ var PKG_VERSION = true ? "1.13.0" : "0.0.0-dev";
358
358
 
359
359
  // src/index.ts
360
360
  function hasCoarsePointer() {
@@ -367,6 +367,7 @@ function hasCoarsePointer() {
367
367
  return false;
368
368
  }
369
369
  }
370
+ var CLIP_OPEN_KEY = "clipOpen";
370
371
  function createGesturesPlugin(config = {}) {
371
372
  let api = null;
372
373
  let overlay = null;
@@ -374,6 +375,7 @@ function createGesturesPlugin(config = {}) {
374
375
  let active = false;
375
376
  let runSeconds = 0;
376
377
  let pendingHide = null;
378
+ let clipOpen = false;
377
379
  const seekSeconds = config.seekSeconds ?? 10;
378
380
  const doubleTapWindowMs = config.doubleTapWindowMs ?? DEFAULT_RECOGNIZER_OPTIONS.doubleTapWindowMs;
379
381
  const leftZone = config.zones?.left ?? DEFAULT_RECOGNIZER_OPTIONS.leftZone;
@@ -479,7 +481,7 @@ function createGesturesPlugin(config = {}) {
479
481
  };
480
482
  const syncSurface = () => {
481
483
  if (!active || !api) return;
482
- const wantsSurface = api.getState("mediaType") !== "audio";
484
+ const wantsSurface = api.getState("mediaType") === "video" && !clipOpen;
483
485
  if (wantsSurface && !overlay) {
484
486
  overlay = new GestureOverlay(api.container, { onPointer, feedback });
485
487
  overlay.setZoneWidths(leftZone, rightZone);
@@ -512,7 +514,14 @@ function createGesturesPlugin(config = {}) {
512
514
  });
513
515
  syncSurface();
514
516
  const unsubscribe = api.subscribeToState((event) => {
515
- if (event.key === "mediaType") syncSurface();
517
+ if (event.key === "mediaType") {
518
+ syncSurface();
519
+ return;
520
+ }
521
+ if (event.key === CLIP_OPEN_KEY) {
522
+ clipOpen = Boolean(event.value);
523
+ syncSurface();
524
+ }
516
525
  });
517
526
  api.onDestroy(() => {
518
527
  unsubscribe();
@@ -531,6 +540,7 @@ function createGesturesPlugin(config = {}) {
531
540
  recognizer = null;
532
541
  active = false;
533
542
  runSeconds = 0;
543
+ clipOpen = false;
534
544
  api = null;
535
545
  },
536
546
  ownsTapInteraction() {
package/dist/index.js CHANGED
@@ -323,7 +323,7 @@ var GestureOverlay = class {
323
323
  };
324
324
 
325
325
  // src/version.ts
326
- var PKG_VERSION = true ? "1.12.0" : "0.0.0-dev";
326
+ var PKG_VERSION = true ? "1.13.0" : "0.0.0-dev";
327
327
 
328
328
  // src/index.ts
329
329
  function hasCoarsePointer() {
@@ -336,6 +336,7 @@ function hasCoarsePointer() {
336
336
  return false;
337
337
  }
338
338
  }
339
+ var CLIP_OPEN_KEY = "clipOpen";
339
340
  function createGesturesPlugin(config = {}) {
340
341
  let api = null;
341
342
  let overlay = null;
@@ -343,6 +344,7 @@ function createGesturesPlugin(config = {}) {
343
344
  let active = false;
344
345
  let runSeconds = 0;
345
346
  let pendingHide = null;
347
+ let clipOpen = false;
346
348
  const seekSeconds = config.seekSeconds ?? 10;
347
349
  const doubleTapWindowMs = config.doubleTapWindowMs ?? DEFAULT_RECOGNIZER_OPTIONS.doubleTapWindowMs;
348
350
  const leftZone = config.zones?.left ?? DEFAULT_RECOGNIZER_OPTIONS.leftZone;
@@ -448,7 +450,7 @@ function createGesturesPlugin(config = {}) {
448
450
  };
449
451
  const syncSurface = () => {
450
452
  if (!active || !api) return;
451
- const wantsSurface = api.getState("mediaType") !== "audio";
453
+ const wantsSurface = api.getState("mediaType") === "video" && !clipOpen;
452
454
  if (wantsSurface && !overlay) {
453
455
  overlay = new GestureOverlay(api.container, { onPointer, feedback });
454
456
  overlay.setZoneWidths(leftZone, rightZone);
@@ -481,7 +483,14 @@ function createGesturesPlugin(config = {}) {
481
483
  });
482
484
  syncSurface();
483
485
  const unsubscribe = api.subscribeToState((event) => {
484
- if (event.key === "mediaType") syncSurface();
486
+ if (event.key === "mediaType") {
487
+ syncSurface();
488
+ return;
489
+ }
490
+ if (event.key === CLIP_OPEN_KEY) {
491
+ clipOpen = Boolean(event.value);
492
+ syncSurface();
493
+ }
485
494
  });
486
495
  api.onDestroy(() => {
487
496
  unsubscribe();
@@ -500,6 +509,7 @@ function createGesturesPlugin(config = {}) {
500
509
  recognizer = null;
501
510
  active = false;
502
511
  runSeconds = 0;
512
+ clipOpen = false;
503
513
  api = null;
504
514
  },
505
515
  ownsTapInteraction() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scarlett-player/gestures",
3
- "version": "1.12.0",
3
+ "version": "1.14.0",
4
4
  "description": "Gestures Plugin for Scarlett Player - double-tap seek zones and tap to toggle controls",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -30,7 +30,7 @@
30
30
  "tsup": "^8.5.1",
31
31
  "typescript": "^5.3.0",
32
32
  "vitest": "^1.6.0",
33
- "@scarlett-player/core": "1.12.0"
33
+ "@scarlett-player/core": "1.14.0"
34
34
  },
35
35
  "keywords": [
36
36
  "video",