@applicaster/zapp-react-native-ui-components 15.1.0-rc.3 → 15.1.0-rc.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.
@@ -48,7 +48,6 @@ type Position = {
48
48
  type PlayerFactoryConfig = {
49
49
  player: any; // React ref for native view
50
50
  playerId: string;
51
- muted: boolean;
52
51
  playerPluginId: string;
53
52
  screenConfig: Record<string, any>;
54
53
  entry: ZappEntry; // original entry, used as fallback if no hooks
@@ -296,7 +295,7 @@ export class LiveImageManager implements PlayerLifecycleListener {
296
295
 
297
296
  setUserCellPlayerMutedPreference(true);
298
297
 
299
- this.items.forEach((liveImage) => liveImage.player?.mute());
298
+ this.items.forEach((liveImage) => liveImage.mute());
300
299
  };
301
300
 
302
301
  public unmuteAll = () => {
@@ -304,7 +303,7 @@ export class LiveImageManager implements PlayerLifecycleListener {
304
303
 
305
304
  setUserCellPlayerMutedPreference(false);
306
305
 
307
- this.items.forEach((liveImage) => liveImage.player?.unmute());
306
+ this.items.forEach((liveImage) => liveImage.unmute());
308
307
  };
309
308
 
310
309
  public onViewPositionChanged = (item: LiveImage) => {
@@ -574,6 +573,20 @@ export class LiveImage implements QuickBrickPlayer.SharedPlayerCallBacks {
574
573
  left: 0,
575
574
  };
576
575
 
576
+ // Keeps muted state in sync: updates the initial value for deferred
577
+ // player creation and forwards to the player if it already exists.
578
+ public initiallyMuted: boolean = true;
579
+
580
+ mute = () => {
581
+ this.initiallyMuted = true;
582
+ this.player?.mute();
583
+ };
584
+
585
+ unmute = () => {
586
+ this.initiallyMuted = false;
587
+ this.player?.unmute();
588
+ };
589
+
577
590
  positionToString() {
578
591
  if (!this.position) {
579
592
  return "position not set";
@@ -635,7 +648,7 @@ export class LiveImage implements QuickBrickPlayer.SharedPlayerCallBacks {
635
648
  playerId: this.factoryConfig.playerId,
636
649
  autoplay: false,
637
650
  entry,
638
- muted: this.factoryConfig.muted,
651
+ muted: this.initiallyMuted,
639
652
  playerPluginId: this.factoryConfig.playerPluginId,
640
653
  screenConfig: this.factoryConfig.screenConfig,
641
654
  playerRole: PlayerRole.Cell,
@@ -126,14 +126,16 @@ const PlayerLiveImageComponent = (props: Props) => {
126
126
  factoryConfig: {
127
127
  player: ref,
128
128
  playerId,
129
- muted,
130
129
  playerPluginId: playerPluginId,
131
130
  screenConfig: screenConfig,
132
131
  entry: item,
133
132
  },
134
133
  tag: item.title?.toString(),
135
134
  });
136
- }, [playerId, preloadHooks, muted, playerPluginId, screenConfig, item]);
135
+ }, [playerId, preloadHooks, playerPluginId, screenConfig, item]);
136
+
137
+ // Keep the muted state in sync with user preference and player state
138
+ liveImageItem.initiallyMuted = muted;
137
139
 
138
140
  React.useEffect(() => {
139
141
  liveImageItem.setMode = setModeDebounced;
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.3",
3
+ "version": "15.1.0-rc.5",
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.3",
32
- "@applicaster/zapp-react-native-bridge": "15.1.0-rc.3",
33
- "@applicaster/zapp-react-native-redux": "15.1.0-rc.3",
34
- "@applicaster/zapp-react-native-utils": "15.1.0-rc.3",
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",
35
35
  "fast-json-stable-stringify": "^2.1.0",
36
36
  "promise": "^8.3.0",
37
37
  "url": "^0.11.0",