@applicaster/zapp-react-native-utils 15.1.5-rc.1 → 15.1.5

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.
@@ -8,7 +8,7 @@ import {
8
8
  } from "../appUtils/playerManager";
9
9
  import { Player } from "../appUtils/playerManager/player";
10
10
  import { AnalyticPlayerListener } from "./AnalyticPlayerListener";
11
- import { PlayerRole } from "../appUtils/playerManager/conts";
11
+ import { PlayerRole } from "../appUtils/playerManager/const";
12
12
 
13
13
  enum PlayerAnalyticsTrackerType {
14
14
  PlayerAnalyticsTracker = "PlayerAnalyticsTracker",
@@ -59,6 +59,7 @@ type PlayNextConfig = {
59
59
  export type PlayNextState = PlayNextConfig & {
60
60
  triggerTime: number;
61
61
  handleUserCancelPlayNext: () => void;
62
+ hidePlayNext: () => void;
62
63
  };
63
64
 
64
65
  export class OverlaysObserver {
@@ -76,7 +77,7 @@ export class OverlaysObserver {
76
77
  private chapterMarkerEvents: ChapterMarkerEvent[];
77
78
  readonly player: Player;
78
79
  private playNextConfig?: PlayNextConfig;
79
- private isCanceledByUser = false;
80
+ private isPlayNextSuppressed = false;
80
81
 
81
82
  constructor({ player }: ChapterMarkersObserverProps) {
82
83
  this.chapterSubject = new BehaviorSubject(null);
@@ -143,11 +144,15 @@ export class OverlaysObserver {
143
144
  return this.titleSummarySubject.asObservable().pipe(distinctUntilChanged());
144
145
  }
145
146
 
146
- handleUserCancelPlayNext = () => {
147
- this.isCanceledByUser = true;
147
+ hidePlayNext = () => {
148
+ this.isPlayNextSuppressed = true;
148
149
  this.playNextSubject.next(null);
149
150
  };
150
151
 
152
+ handleUserCancelPlayNext = () => {
153
+ this.hidePlayNext();
154
+ };
155
+
151
156
  preparePlayNext = async () => {
152
157
  try {
153
158
  const plugins = appStore.get("plugins");
@@ -270,7 +275,7 @@ export class OverlaysObserver {
270
275
 
271
276
  // TODO: Hack for video end, will be replaced with playlist prev/next in the future
272
277
  getPlayNextEntry = () =>
273
- !this.isCanceledByUser ? this.playNextConfig?.entry : null;
278
+ !this.isPlayNextSuppressed ? this.playNextConfig?.entry : null;
274
279
 
275
280
  prepareChapterMarkers = () => {
276
281
  const chapterMarkers: ChapterMarkerOriginal[] =
@@ -353,7 +358,7 @@ export class OverlaysObserver {
353
358
  const shouldPlayNextBeVisible = currentTime > triggerTime;
354
359
 
355
360
  if (shouldPlayNextBeVisible) {
356
- if (this.isCanceledByUser) {
361
+ if (this.isPlayNextSuppressed) {
357
362
  return;
358
363
  }
359
364
 
@@ -361,10 +366,11 @@ export class OverlaysObserver {
361
366
  ...this.playNextConfig,
362
367
  triggerTime,
363
368
  handleUserCancelPlayNext: this.handleUserCancelPlayNext,
369
+ hidePlayNext: this.hidePlayNext,
364
370
  });
365
371
  } else {
366
372
  this.playNextSubject.next(null);
367
- this.isCanceledByUser = false;
373
+ this.isPlayNextSuppressed = false;
368
374
  }
369
375
  };
370
376
 
@@ -10,7 +10,7 @@ jest.mock("@applicaster/zapp-react-native-utils/pluginUtils", () => ({
10
10
  mockFindPluginByIdentifier(id, plugins),
11
11
  }));
12
12
 
13
- import { PlayerRole } from "../conts";
13
+ import { PlayerRole } from "../const";
14
14
  import { playerFactory } from "../playerFactory";
15
15
 
16
16
  const fakeComponent = () => null;
@@ -67,3 +67,23 @@ export enum PlayerRole {
67
67
  Chromecast = "Chromecast",
68
68
  Unspecified = "Unspecified",
69
69
  }
70
+
71
+ /**
72
+ * The playback engine backing a web player. Published on
73
+ * `window.applicaster.playerType` when a player is created, so that plugins
74
+ * observing the player can tell which engine they are looking at instead of
75
+ * inferring it from the API the instance happens to expose.
76
+ *
77
+ * Keep in sync with `ApplicasterGlobals["playerType"]` in applicaster-types.
78
+ */
79
+ export enum WebPlayerEngine {
80
+ Videojs = "videojs",
81
+ Hlsjs = "hlsjs",
82
+ Dashjs = "dashjs",
83
+ }
84
+
85
+ export enum PLAYER_EVENTS {
86
+ PlayNextTriggered = "play_next_triggered",
87
+ }
88
+
89
+ export type PlayNextTriggeredEvent = { id: string };
@@ -9,7 +9,7 @@ import {
9
9
  unsubscribeToDeviceNetworkChanges,
10
10
  } from "@applicaster/quick-brick-core/App/NetworkStatusProvider/utils";
11
11
  import { setUserLanguagePreference } from "./userLanguagePreference";
12
- import { PlayerRole } from "./conts";
12
+ import { PlayerRole } from "./const";
13
13
  import { RNPlayerManager } from "./nativePlayerManager";
14
14
 
15
15
  const { log_error, log_debug, log_warning } = createLogger({
@@ -3,7 +3,7 @@ import { BehaviorSubject } from "rxjs";
3
3
  import { isEmptyOrNil } from "@applicaster/zapp-react-native-utils/cellUtils";
4
4
  import { createLogger, utilsLogger } from "../../logger";
5
5
  import { getBoolFromConfigValue } from "../../configurationUtils";
6
- import { PlayerRole, SharedPlayerCallBacksKeys } from "./conts";
6
+ import { PlayerRole, SharedPlayerCallBacksKeys } from "./const";
7
7
  import { OverlaysObserver } from "./OverlayObserver/OverlaysObserver";
8
8
  import { TVSeekController } from "../../reactHooks/player/TVSeekControlller/TVSeekController";
9
9
 
@@ -1,7 +1,7 @@
1
1
  import { appStore } from "@applicaster/zapp-react-native-redux/AppStore";
2
2
  import { findPluginByIdentifier } from "@applicaster/zapp-react-native-utils/pluginUtils";
3
3
  import { Player } from "./player";
4
- import { PlayerRole } from "./conts";
4
+ import { PlayerRole } from "./const";
5
5
 
6
6
  type PlayerFactoryItem = {
7
7
  Component: any;
@@ -3,7 +3,7 @@ import { isEmptyOrNil } from "@applicaster/zapp-react-native-utils/cellUtils";
3
3
  import { createLogger, utilsLogger } from "../../logger";
4
4
  import { Player } from "./player";
5
5
  import { findNodeHandle } from "react-native";
6
- import { PlayerRole } from "./conts";
6
+ import { PlayerRole } from "./const";
7
7
  import { toBooleanWithDefaultFalse } from "../../booleanUtils";
8
8
  import { RNPlayerManager } from "./nativePlayerManager";
9
9
 
@@ -3,7 +3,7 @@ import { useConfiguration } from "../../reactHooks/useConfiguration";
3
3
  import { useEffect } from "react";
4
4
  import { playerManager } from "./index";
5
5
  import { useValidatePlayerConfig } from "../../playerUtils/useValidatePlayerConfig";
6
- import { PlayerRole } from "./conts";
6
+ import { PlayerRole } from "./const";
7
7
  import { isAppleTV } from "@applicaster/zapp-react-native-ui-components/Helpers/Platform";
8
8
  import { TVSeekController } from "../../reactHooks/player/TVSeekControlller/TVSeekController";
9
9
  import { KeyInputHandler } from "../keyInputHandler/KeyInputHandler";
@@ -1,7 +1,7 @@
1
1
  import { localStorage } from "@applicaster/zapp-react-native-bridge/ZappStorage/LocalStorage";
2
2
  import { sessionStorage } from "@applicaster/zapp-react-native-bridge/ZappStorage/SessionStorage";
3
3
  import { createLogger, utilsLogger } from "../../logger";
4
- import { userPreferencesNamespace } from "./conts";
4
+ import { userPreferencesNamespace } from "./const";
5
5
 
6
6
  export const preferredAudioLanguageStorageKey = "preferred_audio_language";
7
7
 
@@ -3464,13 +3464,13 @@ function getPlayerConfiguration({ platform, version }) {
3464
3464
  label: "Advanced Player Styles",
3465
3465
  type: "text_input",
3466
3466
  multiline: true,
3467
- initial_value: `.vjs-text-track-cue {
3468
- inset: unset !important;
3469
- top: 94% !important;
3467
+ initial_value: `.vjs-text-track-cue {
3468
+ top: auto !important;
3470
3469
  bottom: 0 !important;
3471
3470
  left: 0 !important;
3472
- right: 0 !important;
3471
+ right: auto !important;
3473
3472
  width: 100% !important;
3473
+ height: auto !important;
3474
3474
  }`,
3475
3475
  label_tooltip:
3476
3476
  "This field allows you to inject custom CSS styles to override default player styles. The styles will be injected into the document head and can be used to customize the appearance of the player. Leave empty to use only default styles.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "15.1.5-rc.1",
3
+ "version": "15.1.5",
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.1.5-rc.1",
30
+ "@applicaster/applicaster-types": "15.1.5",
31
31
  "buffer": "^5.2.1",
32
32
  "camelize": "^1.0.0",
33
33
  "dayjs": "^1.11.10",