@applicaster/zapp-react-native-ui-components 16.0.0-rc.5 → 16.0.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.
|
@@ -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.
|
|
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.
|
|
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.
|
|
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,
|
|
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": "16.0.0-rc.
|
|
3
|
+
"version": "16.0.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": "16.0.0-rc.
|
|
32
|
-
"@applicaster/zapp-react-native-bridge": "16.0.0-rc.
|
|
33
|
-
"@applicaster/zapp-react-native-redux": "16.0.0-rc.
|
|
34
|
-
"@applicaster/zapp-react-native-utils": "16.0.0-rc.
|
|
31
|
+
"@applicaster/applicaster-types": "16.0.0-rc.6",
|
|
32
|
+
"@applicaster/zapp-react-native-bridge": "16.0.0-rc.6",
|
|
33
|
+
"@applicaster/zapp-react-native-redux": "16.0.0-rc.6",
|
|
34
|
+
"@applicaster/zapp-react-native-utils": "16.0.0-rc.6",
|
|
35
35
|
"fast-json-stable-stringify": "^2.1.0",
|
|
36
36
|
"promise": "^8.3.0",
|
|
37
37
|
"url": "^0.11.0",
|