@applicaster/zapp-react-native-ui-components 15.1.0-rc.5 → 15.1.0-rc.6

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.
@@ -624,48 +624,7 @@ export class LiveImage implements QuickBrickPlayer.SharedPlayerCallBacks {
624
624
  return this._preparePromise;
625
625
  }
626
626
 
627
- this._preparePromise = (async (): Promise<boolean> => {
628
- // 1. Run hooks if configured
629
- let entry = this.factoryConfig.entry;
630
-
631
- if (this.preloadHooks?.length) {
632
- const result = await executePreloadHooks({
633
- preloadHooks: this.preloadHooks,
634
- entry,
635
- });
636
-
637
- if (result) {
638
- this.processedEntry = result;
639
- entry = result;
640
- } else {
641
- return false;
642
- }
643
- }
644
-
645
- // 2. Create the player with the correct entry
646
- const factoryItem = playerFactory({
647
- player: this.factoryConfig.player,
648
- playerId: this.factoryConfig.playerId,
649
- autoplay: false,
650
- entry,
651
- muted: this.initiallyMuted,
652
- playerPluginId: this.factoryConfig.playerPluginId,
653
- screenConfig: this.factoryConfig.screenConfig,
654
- playerRole: PlayerRole.Cell,
655
- });
656
-
657
- if (!factoryItem) {
658
- throw new Error("Player factory returned null");
659
- }
660
-
661
- this.player = factoryItem.controller;
662
- this.component = factoryItem.Component;
663
-
664
- // 3. Register callbacks — player now exists
665
- this.player.addListener({ id: "live-image", listener: this });
666
-
667
- return true;
668
- })()
627
+ this._preparePromise = this.createPreparedPlayer()
669
628
  .then((result) => {
670
629
  this._preparePromise = null;
671
630
 
@@ -685,6 +644,45 @@ export class LiveImage implements QuickBrickPlayer.SharedPlayerCallBacks {
685
644
  return this._preparePromise;
686
645
  }
687
646
 
647
+ private async createPreparedPlayer(): Promise<boolean> {
648
+ let entry = this.factoryConfig.entry;
649
+
650
+ if (this.preloadHooks?.length) {
651
+ const result = await executePreloadHooks({
652
+ preloadHooks: this.preloadHooks,
653
+ entry,
654
+ });
655
+
656
+ if (!result) return false;
657
+
658
+ this.processedEntry = result;
659
+ entry = result;
660
+ }
661
+
662
+ const factoryItem = await playerFactory({
663
+ player: this.factoryConfig.player,
664
+ playerId: this.factoryConfig.playerId,
665
+ autoplay: false,
666
+ entry,
667
+ muted: this.initiallyMuted,
668
+ playerPluginId: this.factoryConfig.playerPluginId,
669
+ screenConfig: this.factoryConfig.screenConfig,
670
+ playerRole: PlayerRole.Cell,
671
+ });
672
+
673
+ if (!factoryItem) {
674
+ throw new Error(
675
+ `Player factory returned null (playerId: ${this.factoryConfig.playerId}, playerPluginId: ${this.factoryConfig.playerPluginId})`
676
+ );
677
+ }
678
+
679
+ this.player = factoryItem.controller;
680
+ this.component = factoryItem.Component;
681
+ this.player.addListener({ id: "live-image", listener: this });
682
+
683
+ return true;
684
+ }
685
+
688
686
  public getPlayer = (): Player | null => {
689
687
  return this.player;
690
688
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "15.1.0-rc.5",
3
+ "version": "15.1.0-rc.6",
4
4
  "description": "Applicaster Zapp React Native ui components for the Quick Brick App",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/applicaster-types": "15.1.0-rc.5",
32
- "@applicaster/zapp-react-native-bridge": "15.1.0-rc.5",
33
- "@applicaster/zapp-react-native-redux": "15.1.0-rc.5",
34
- "@applicaster/zapp-react-native-utils": "15.1.0-rc.5",
31
+ "@applicaster/applicaster-types": "15.1.0-rc.6",
32
+ "@applicaster/zapp-react-native-bridge": "15.1.0-rc.6",
33
+ "@applicaster/zapp-react-native-redux": "15.1.0-rc.6",
34
+ "@applicaster/zapp-react-native-utils": "15.1.0-rc.6",
35
35
  "fast-json-stable-stringify": "^2.1.0",
36
36
  "promise": "^8.3.0",
37
37
  "url": "^0.11.0",