@applicaster/zapp-react-native-ui-components 12.0.4-alpha.7284824515 → 12.0.4-rc.0
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.
|
@@ -244,27 +244,25 @@ const PlayerLiveImageComponent = (props: Props) => {
|
|
|
244
244
|
}, [item.id]);
|
|
245
245
|
|
|
246
246
|
React.useEffect(() => {
|
|
247
|
-
if (
|
|
248
|
-
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
const isPlayerRegistered = playerManager.isPlayerRegistered(playerId);
|
|
247
|
+
if (playerManager) {
|
|
248
|
+
const isPlayerRegistered = playerManager.isPlayerRegistered(playerId);
|
|
252
249
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
250
|
+
if (isPlayerRegistered) {
|
|
251
|
+
log_error(
|
|
252
|
+
`PlayerLiveImageComponent: player ${playerId} already registered`
|
|
253
|
+
);
|
|
254
|
+
} else {
|
|
255
|
+
playerManager.registerPlayer({
|
|
256
|
+
id: playerId,
|
|
257
|
+
playerController: controller,
|
|
258
|
+
});
|
|
262
259
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
260
|
+
return () => {
|
|
261
|
+
playerManager.unregisterPlayer(playerId);
|
|
262
|
+
};
|
|
263
|
+
}
|
|
266
264
|
}
|
|
267
|
-
}, [liveImageItem, playerId, controller
|
|
265
|
+
}, [liveImageItem, playerId, controller]);
|
|
268
266
|
|
|
269
267
|
const onPositionUpdated = React.useCallback(
|
|
270
268
|
(data) => {
|
|
@@ -5,7 +5,6 @@ import * as PlayerFactory from "@applicaster/zapp-react-native-utils/appUtils/pl
|
|
|
5
5
|
import { Player } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/player";
|
|
6
6
|
import { ThemeContext } from "@applicaster/zapp-react-native-utils/theme";
|
|
7
7
|
import * as navigationHooks from "@applicaster/zapp-react-native-utils/reactHooks/navigation";
|
|
8
|
-
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils/playerManager";
|
|
9
8
|
|
|
10
9
|
import { PlayerLiveImage } from "../PlayerLiveImageComponent";
|
|
11
10
|
import * as useNavigationHooks from "@applicaster/zapp-react-native-utils/reactHooks/navigation/useNavigation";
|
|
@@ -34,7 +33,7 @@ const mockStore = configureStore();
|
|
|
34
33
|
|
|
35
34
|
const store = mockStore({ appData: {} });
|
|
36
35
|
|
|
37
|
-
const Wrapper = ({ children }: { children: React.
|
|
36
|
+
const Wrapper = ({ children }: { children: React.ReactChildren }) => (
|
|
38
37
|
/* @ts-ignore */
|
|
39
38
|
<Provider store={store}>
|
|
40
39
|
<ThemeContext.Provider
|
|
@@ -114,53 +113,4 @@ describe("PlayerLiveImageComponent", () => {
|
|
|
114
113
|
|
|
115
114
|
// TODO: implement this test
|
|
116
115
|
});
|
|
117
|
-
|
|
118
|
-
it("should register the player for normal item", () => {
|
|
119
|
-
render(
|
|
120
|
-
<Wrapper>
|
|
121
|
-
<PlayerLiveImage {...defaultProps} />
|
|
122
|
-
</Wrapper>
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
const isPlayerRegistered = playerManager.isPlayerRegistered(
|
|
126
|
-
defaultProps.playerId
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
expect(isPlayerRegistered).toBe(true);
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
it("should unregister the player for normal item", () => {
|
|
133
|
-
const component = render(
|
|
134
|
-
<Wrapper>
|
|
135
|
-
<PlayerLiveImage {...defaultProps} />
|
|
136
|
-
</Wrapper>
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
component.unmount();
|
|
140
|
-
|
|
141
|
-
const isPlayerRegistered = playerManager.isPlayerRegistered(
|
|
142
|
-
defaultProps.playerId
|
|
143
|
-
);
|
|
144
|
-
|
|
145
|
-
expect(isPlayerRegistered).toBe(false);
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
it("should not register the player for 'pre-measurement' item", () => {
|
|
149
|
-
const props = {
|
|
150
|
-
...defaultProps,
|
|
151
|
-
item: {
|
|
152
|
-
...defaultProps.item,
|
|
153
|
-
id: "pre-measurement-1",
|
|
154
|
-
},
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
render(
|
|
158
|
-
<Wrapper>
|
|
159
|
-
<PlayerLiveImage {...props} />
|
|
160
|
-
</Wrapper>
|
|
161
|
-
);
|
|
162
|
-
|
|
163
|
-
const isPlayerRegistered = playerManager.isPlayerRegistered(props.playerId);
|
|
164
|
-
expect(isPlayerRegistered).toBe(false);
|
|
165
|
-
});
|
|
166
116
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "12.0.4-
|
|
3
|
+
"version": "12.0.4-rc.0",
|
|
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",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"redux-mock-store": "^1.5.3"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@applicaster/applicaster-types": "12.0.4-
|
|
38
|
-
"@applicaster/zapp-react-native-bridge": "12.0.4-
|
|
39
|
-
"@applicaster/zapp-react-native-redux": "12.0.4-
|
|
40
|
-
"@applicaster/zapp-react-native-utils": "12.0.4-
|
|
37
|
+
"@applicaster/applicaster-types": "12.0.4-rc.0",
|
|
38
|
+
"@applicaster/zapp-react-native-bridge": "12.0.4-rc.0",
|
|
39
|
+
"@applicaster/zapp-react-native-redux": "12.0.4-rc.0",
|
|
40
|
+
"@applicaster/zapp-react-native-utils": "12.0.4-rc.0",
|
|
41
41
|
"promise": "^8.3.0",
|
|
42
42
|
"react-router-native": "^5.1.2",
|
|
43
43
|
"url": "^0.11.0",
|