@applicaster/zapp-react-native-utils 15.0.0-alpha.7591121530 → 15.0.0-alpha.8526950782

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.
@@ -31,6 +31,10 @@ export const BUTTON_ACCESSIBILITY_KEYS = {
31
31
  hint: "accessibility_close_mini_hint",
32
32
  },
33
33
  },
34
+ back_to_live: {
35
+ label: "back_to_live_label",
36
+ hint: "",
37
+ },
34
38
  maximize: {
35
39
  label: "accessibility_maximize_label",
36
40
  hint: "accessibility_maximize_hint",
@@ -250,6 +250,10 @@ export class Player {
250
250
  return false;
251
251
  }
252
252
 
253
+ if (!Number.isFinite(duration)) {
254
+ return this.getSeekableDuration() > 0;
255
+ }
256
+
253
257
  return duration > 0;
254
258
  };
255
259
 
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import { Player } from "./player";
3
3
  import { usePlayer } from "./usePlayer";
4
4
 
5
- type PlayerState = {
5
+ export type PlayerState = {
6
6
  currentTime: number;
7
7
  duration: number;
8
8
  seekableDuration: number;
@@ -10,6 +10,8 @@ type PlayerState = {
10
10
  isPaused: boolean;
11
11
  isBuffering: boolean;
12
12
  isReadyToPlay: boolean;
13
+ trackState?: QuickBrickPlayer.TracksState;
14
+ isAd: boolean;
13
15
  };
14
16
 
15
17
  export const usePlayerState = (
@@ -24,6 +26,8 @@ export const usePlayerState = (
24
26
  isPaused: null,
25
27
  isBuffering: false,
26
28
  isReadyToPlay: false,
29
+ trackState: null,
30
+ isAd: false,
27
31
  });
28
32
 
29
33
  const player: Player = usePlayer(playerId);
@@ -37,6 +41,8 @@ export const usePlayerState = (
37
41
  isPaused: player.isPaused(),
38
42
  isBuffering: player.isBuffering(),
39
43
  isReadyToPlay: player.isReadyToPlay(),
44
+ trackState: player.getTracksState(),
45
+ isAd: player.isAd(),
40
46
  });
41
47
  }, [player]);
42
48
 
@@ -54,10 +60,16 @@ export const usePlayerState = (
54
60
  onPlayerPause: onPlayerChangeState,
55
61
  onPlayerResume: onPlayerChangeState,
56
62
  onPlayerSeekComplete: onPlayerChangeState,
63
+ onTracksChanged: onPlayerChangeState,
64
+ onAdBreakBegin: onPlayerChangeState,
65
+ onAdBreakEnd: onPlayerChangeState,
66
+ onAdBegin: onPlayerChangeState,
67
+ onAdEnd: onPlayerChangeState,
68
+ onAdError: onPlayerChangeState,
57
69
  },
58
70
  });
59
71
  }
60
- }, [player]);
72
+ }, [listenerId, onPlayerChangeState, player]);
61
73
 
62
74
  return state;
63
75
  };
@@ -335,6 +335,13 @@ function getPlayerConfiguration({ platform, version }) {
335
335
  };
336
336
 
337
337
  if (isTV(platform)) {
338
+ localizations.fields.push({
339
+ key: "back_to_live_label",
340
+ label: "Back to live label",
341
+ initial_value: "Back To Live",
342
+ type: "text_input",
343
+ });
344
+
338
345
  styles.fields.push(
339
346
  fieldsGroup("Always Show Scrub Bar & Timestamp", "", [
340
347
  {
@@ -447,7 +454,7 @@ function getPlayerConfiguration({ platform, version }) {
447
454
  ),
448
455
  fieldsGroup(
449
456
  "Skip Button",
450
- "This section allows you to configure the skip button styles for tv",
457
+ "This section allows you to configure the skip button behaviour",
451
458
  [
452
459
  {
453
460
  type: "switch",
@@ -464,6 +471,12 @@ function getPlayerConfiguration({ platform, version }) {
464
471
  label: "Persistent Button Toggle",
465
472
  initial_value: true,
466
473
  },
474
+ ]
475
+ ),
476
+ fieldsGroup(
477
+ "Labeled Button Style",
478
+ "This section allows you to configure the labeled button styles",
479
+ [
467
480
  {
468
481
  type: "color_picker_rgba",
469
482
  label_tooltip: "",
@@ -619,6 +632,32 @@ function getPlayerConfiguration({ platform, version }) {
619
632
  );
620
633
  }
621
634
 
635
+ if (isTV(platform)) {
636
+ general.fields.push(
637
+ {
638
+ key: "liveSeekingEnabled",
639
+ label: "Live Seeking Enabled",
640
+ initial_value: false,
641
+ type: "switch",
642
+ label_tooltip: "Enable Live Seek",
643
+ },
644
+ {
645
+ key: "minimumAllowedSeekableDurationInSeconds",
646
+ label: "Minimum allowed seekable duration in seconds",
647
+ initial_value: 300,
648
+ type: "number_input",
649
+ label_tooltip:
650
+ "If duration less that this value, player will disable 'liveSeekingEnabled' value",
651
+ },
652
+ {
653
+ key: "live_image",
654
+ label: "Live badge",
655
+ type: "uploader",
656
+ label_tooltip: "Override default live badge / icon",
657
+ }
658
+ );
659
+ }
660
+
622
661
  if (isMobile(platform)) {
623
662
  general.fields.push(
624
663
  {
@@ -959,27 +959,6 @@ const TV_CELL_LABEL_FIELDS = [
959
959
  rules: "conditional",
960
960
  conditions: [{ key: "switch", section: "styles", value: true }],
961
961
  },
962
- {
963
- type: ZAPPIFEST_FIELDS.font_selector.roku,
964
- suffix: "roku font family",
965
- tooltip: "",
966
- rules: "conditional",
967
- conditions: [{ key: "switch", section: "styles", value: true }],
968
- },
969
- {
970
- type: ZAPPIFEST_FIELDS.number_input,
971
- suffix: "roku font size",
972
- tooltip: "",
973
- rules: "conditional",
974
- conditions: [{ key: "switch", section: "styles", value: true }],
975
- },
976
- {
977
- type: ZAPPIFEST_FIELDS.number_input,
978
- suffix: "roku line height",
979
- tooltip: "",
980
- rules: "conditional",
981
- conditions: [{ key: "switch", section: "styles", value: true }],
982
- },
983
962
  {
984
963
  type: ZAPPIFEST_FIELDS.select,
985
964
  suffix: "text alignment",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "15.0.0-alpha.7591121530",
3
+ "version": "15.0.0-alpha.8526950782",
4
4
  "description": "Applicaster Zapp React Native utilities package",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/applicaster/quickbrick#readme",
29
29
  "dependencies": {
30
- "@applicaster/applicaster-types": "15.0.0-alpha.7591121530",
30
+ "@applicaster/applicaster-types": "15.0.0-alpha.8526950782",
31
31
  "buffer": "^5.2.1",
32
32
  "camelize": "^1.0.0",
33
33
  "dayjs": "^1.11.10",
@@ -147,17 +147,34 @@ export class TVSeekController
147
147
 
148
148
  let targetPos = currentPos;
149
149
 
150
- if (this.currentSeekType === SEEK_TYPE.FORWARD) {
151
- targetPos = Math.min(
152
- currentPos + offset,
153
- this.playerController.getSeekableDuration()
154
- );
155
- } else if (this.currentSeekType === SEEK_TYPE.REWIND) {
156
- targetPos = Math.max(0, currentPos - offset);
150
+ const isLive = this.playerController.isLive();
151
+
152
+ if (isLive) {
153
+ if (this.currentSeekType === SEEK_TYPE.REWIND) {
154
+ targetPos = Math.min(
155
+ currentPos + offset,
156
+ this.playerController.getSeekableDuration()
157
+ );
158
+ } else if (this.currentSeekType === SEEK_TYPE.FORWARD) {
159
+ targetPos = Math.max(0, currentPos - offset);
160
+ } else {
161
+ log_warning(
162
+ `TVSeekController: handleDelayedSeek - invalid seek type: ${this.currentSeekType}`
163
+ );
164
+ }
157
165
  } else {
158
- log_warning(
159
- `TVSeekController: handleDelayedSeek - invalid seek type: ${this.currentSeekType}`
160
- );
166
+ if (this.currentSeekType === SEEK_TYPE.FORWARD) {
167
+ targetPos = Math.min(
168
+ currentPos + offset,
169
+ this.playerController.getSeekableDuration()
170
+ );
171
+ } else if (this.currentSeekType === SEEK_TYPE.REWIND) {
172
+ targetPos = Math.max(0, currentPos - offset);
173
+ } else {
174
+ log_warning(
175
+ `TVSeekController: handleDelayedSeek - invalid seek type: ${this.currentSeekType}`
176
+ );
177
+ }
161
178
  }
162
179
 
163
180
  log_debug(