@applicaster/zapp-react-native-ui-components 14.0.0-rc.9 → 14.0.0-rc.90
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.
- package/Components/AnimatedInOut/index.tsx +68 -23
- package/Components/AudioPlayer/index.tsx +15 -0
- package/Components/AudioPlayer/mobile/Layout.tsx +66 -0
- package/Components/AudioPlayer/{__tests__/__snapshots__/audioPlayer.test.js.snap → mobile/__tests__/__snapshots__/audioPlayerMobileLayout.test.js.snap} +2 -2
- package/Components/AudioPlayer/mobile/__tests__/audioPlayerMobileLayout.test.js +18 -0
- package/Components/AudioPlayer/mobile/index.tsx +18 -0
- package/Components/AudioPlayer/{Artwork.tsx → tv/Artwork.tsx} +3 -2
- package/Components/AudioPlayer/{Channel.tsx → tv/Channel.tsx} +7 -7
- package/Components/AudioPlayer/tv/Layout.tsx +168 -0
- package/Components/AudioPlayer/{Runtime.tsx → tv/Runtime.tsx} +7 -1
- package/Components/AudioPlayer/{Summary.tsx → tv/Summary.tsx} +6 -2
- package/Components/AudioPlayer/{Title.tsx → tv/Title.tsx} +6 -2
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/Runtime.test.js.snap +2 -2
- package/Components/AudioPlayer/tv/__tests__/__snapshots__/audioPlayer.test.js.snap +164 -0
- package/Components/AudioPlayer/tv/__tests__/__snapshots__/channel.test.js.snap +19 -0
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/summary.test.js.snap +1 -2
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/title.test.js.snap +1 -2
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/audioPlayer.test.js +7 -3
- package/Components/AudioPlayer/{helpers.tsx → tv/helpers.tsx} +11 -5
- package/Components/AudioPlayer/{AudioPlayer.tsx → tv/index.tsx} +17 -58
- package/Components/AudioPlayer/types.ts +40 -0
- package/Components/BaseFocusable/index.tsx +23 -12
- package/Components/Cell/Cell.tsx +91 -64
- package/Components/Cell/CellWithFocusable.tsx +3 -0
- package/Components/Cell/FocusableWrapper.tsx +44 -0
- package/Components/Cell/TvOSCellComponent.tsx +92 -17
- package/Components/Cell/__tests__/CellWIthFocusable.test.js +3 -2
- package/Components/Cell/index.js +7 -3
- package/Components/ComponentResolver/index.ts +1 -1
- package/Components/FeedLoader/FeedLoader.tsx +7 -16
- package/Components/FeedLoader/FeedLoaderHOC.tsx +21 -0
- package/Components/FeedLoader/index.js +2 -8
- package/Components/Focusable/Focusable.tsx +12 -3
- package/Components/Focusable/FocusableTvOS.tsx +5 -5
- package/Components/Focusable/FocusableiOS.tsx +2 -2
- package/Components/Focusable/Touchable.tsx +5 -3
- package/Components/Focusable/__tests__/index.android.test.tsx +3 -0
- package/Components/Focusable/index.android.tsx +19 -11
- package/Components/Focusable/index.tsx +1 -1
- package/Components/FocusableGroup/FocusableTvOS.tsx +1 -1
- package/Components/FocusableList/FocusableItem.tsx +4 -3
- package/Components/FocusableList/FocusableListItemWrapper.tsx +2 -1
- package/Components/FocusableList/hooks/useCellState.android.ts +13 -3
- package/Components/FocusableList/index.tsx +20 -9
- package/Components/FreezeWithCallback/__tests__/index.test.tsx +67 -43
- package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +42 -59
- package/Components/GeneralContentScreen/utils/useCurationAPI.ts +22 -21
- package/Components/HandlePlayable/HandlePlayable.tsx +39 -74
- package/Components/HandlePlayable/const.ts +3 -0
- package/Components/HandlePlayable/utils.ts +74 -0
- package/Components/Layout/TV/LayoutBackground.tsx +1 -1
- package/Components/Layout/TV/__tests__/index.test.tsx +0 -1
- package/Components/MasterCell/DefaultComponents/ActionButton.tsx +6 -2
- package/Components/MasterCell/DefaultComponents/Button.tsx +1 -1
- package/Components/MasterCell/DefaultComponents/FocusableView/index.tsx +4 -39
- package/Components/MasterCell/DefaultComponents/Image/hoc/withDimensions.tsx +1 -1
- package/Components/MasterCell/DefaultComponents/ImageContainer/index.tsx +1 -1
- package/Components/MasterCell/DefaultComponents/SecondaryImage/Image.tsx +65 -17
- package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/Image.test.tsx +21 -3
- package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/__snapshots__/Image.test.tsx.snap +6 -3
- package/Components/MasterCell/DefaultComponents/Text/index.tsx +26 -6
- package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +10 -10
- package/Components/MasterCell/DefaultComponents/__tests__/text.test.tsx +18 -18
- package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/index.test.tsx +10 -10
- package/Components/MasterCell/elementMapper.tsx +1 -2
- package/Components/MasterCell/index.tsx +1 -1
- package/Components/MasterCell/utils/behaviorProvider.ts +82 -14
- package/Components/MasterCell/utils/index.ts +11 -5
- package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +13 -18
- package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +9 -0
- package/Components/OfflineHandler/__tests__/index.test.tsx +26 -35
- package/Components/PlayerContainer/ErrorDisplay/index.ts +1 -1
- package/Components/PlayerContainer/PlayerContainer.tsx +45 -47
- package/Components/PlayerContainer/ProgramInfo/index.tsx +1 -1
- package/Components/PlayerContainer/index.ts +1 -1
- package/Components/PlayerImageBackground/index.tsx +4 -23
- package/Components/River/ComponentsMap/ComponentsMap.tsx +49 -43
- package/Components/River/ComponentsMap/ContextProviders/ComponentsMapHeightContext.ts +8 -0
- package/Components/River/ComponentsMap/ContextProviders/ComponentsMapRefContext.ts +8 -0
- package/Components/River/ComponentsMap/hooks/__tests__/useLoadingState.test.ts +378 -0
- package/Components/River/ComponentsMap/hooks/useLoadingState.ts +2 -2
- package/Components/River/RefreshControl.tsx +11 -17
- package/Components/River/TV/River.tsx +2 -17
- package/Components/River/TV/index.tsx +3 -1
- package/Components/River/TV/withPipesV1DataLoader.tsx +43 -0
- package/Components/River/TV/withRiverDataLoader.tsx +17 -0
- package/Components/River/TV/withTVEventHandler.tsx +1 -1
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +2 -0
- package/Components/River/__tests__/river.test.js +12 -26
- package/Components/River/index.tsx +1 -1
- package/Components/Screen/TV/hooks/useInitialFocus.ts +14 -4
- package/Components/Screen/__tests__/Screen.test.tsx +28 -29
- package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +2 -0
- package/Components/Screen/__tests__/navigationHandler.test.ts +133 -22
- package/Components/Screen/index.tsx +22 -5
- package/Components/Screen/navigationHandler.ts +20 -2
- package/Components/ScreenRevealManager/ScreenRevealManager.ts +76 -0
- package/Components/ScreenRevealManager/__tests__/ScreenRevealManager.test.ts +107 -0
- package/Components/ScreenRevealManager/__tests__/withScreenRevealManager.test.tsx +96 -0
- package/Components/ScreenRevealManager/index.ts +1 -0
- package/Components/ScreenRevealManager/utils/index.ts +23 -0
- package/Components/ScreenRevealManager/withScreenRevealManager.tsx +109 -0
- package/Components/Tabs/TV/Tabs.android.tsx +1 -3
- package/Components/Tabs/Tabs.tsx +2 -3
- package/Components/TextInputTv/__tests__/__snapshots__/TextInputTv.test.js.snap +13 -0
- package/Components/TextInputTv/index.tsx +11 -0
- package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +34 -0
- package/Components/Touchable/__tests__/touchable.test.tsx +12 -17
- package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +15 -9
- package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +1 -0
- package/Components/VideoLive/animationUtils.ts +3 -3
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +120 -133
- package/Components/VideoModal/ModalAnimation/index.ts +2 -13
- package/Components/VideoModal/ModalAnimation/utils.ts +1 -327
- package/Components/VideoModal/PlayerDetails.tsx +29 -7
- package/Components/VideoModal/PlayerWrapper.tsx +25 -215
- package/Components/VideoModal/VideoModal.tsx +4 -22
- package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +5 -5
- package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +2 -7
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +44 -240
- package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +9 -1
- package/Components/VideoModal/hooks/index.ts +0 -2
- package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +40 -15
- package/Components/VideoModal/hooks/useModalSize.ts +23 -2
- package/Components/VideoModal/hooks/utils/__tests__/showDetails.test.ts +2 -2
- package/Components/VideoModal/hooks/utils/index.ts +4 -0
- package/Components/VideoModal/playerWrapperStyle.ts +70 -0
- package/Components/VideoModal/playerWrapperUtils.ts +91 -0
- package/Components/VideoModal/utils.ts +13 -0
- package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -16
- package/Components/Viewport/ViewportTracker/__tests__/viewportTracker.test.js +84 -24
- package/Components/Viewport/VisibilitySensor/VisibilitySensor.tsx +3 -3
- package/Components/default-cell-renderer/viewTrees/tv/DefaultCell/index.ts +3 -3
- package/Contexts/CellFocusedStateContext/index.tsx +27 -0
- package/Contexts/ConfigutaionContext/__tests__/ConfigurationProvider.test.tsx +3 -3
- package/Contexts/ScreenContext/index.tsx +46 -6
- package/Decorators/ConfigurationWrapper/__tests__/withConfigurationProvider.test.tsx +3 -3
- package/Decorators/ConfigurationWrapper/withConfigurationProvider.tsx +2 -2
- package/Decorators/RiverFeedLoader/__tests__/__snapshots__/riverFeedLoader.test.tsx.snap +221 -209
- package/Decorators/RiverFeedLoader/__tests__/riverFeedLoader.test.tsx +14 -16
- package/Decorators/RiverFeedLoader/__tests__/utils.test.ts +0 -20
- package/Decorators/RiverFeedLoader/index.tsx +22 -4
- package/Decorators/RiverFeedLoader/utils/getDatasourceUrl.ts +6 -10
- package/Decorators/RiverFeedLoader/utils/index.ts +0 -18
- package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +3 -6
- package/Decorators/ZappPipesDataConnector/ResolverSelector.tsx +25 -0
- package/Decorators/ZappPipesDataConnector/__tests__/NullFeedResolver.test.tsx +78 -0
- package/Decorators/ZappPipesDataConnector/__tests__/ResolverSelector.test.tsx +205 -0
- package/Decorators/ZappPipesDataConnector/__tests__/StaticFeedResolver.test.tsx +251 -0
- package/Decorators/ZappPipesDataConnector/__tests__/UrlFeedResolver.test.tsx +368 -0
- package/Decorators/ZappPipesDataConnector/__tests__/utils.test.ts +39 -0
- package/Decorators/ZappPipesDataConnector/index.tsx +26 -293
- package/Decorators/ZappPipesDataConnector/resolvers/NullFeedResolver.tsx +25 -0
- package/Decorators/ZappPipesDataConnector/resolvers/StaticFeedResolver.tsx +87 -0
- package/Decorators/ZappPipesDataConnector/resolvers/UrlFeedResolver.tsx +266 -0
- package/Decorators/ZappPipesDataConnector/types.ts +29 -0
- package/Decorators/ZappPipesDataConnector/utils/mongoFilter.ts +738 -0
- package/Decorators/ZappPipesDataConnector/utils/useFilter.tsx +157 -0
- package/events/index.ts +3 -0
- package/package.json +5 -10
- package/Components/AudioPlayer/AudioPlayerLayout.tsx +0 -202
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +0 -66
- package/Components/AudioPlayer/__tests__/__snapshots__/channel.test.js.snap +0 -28
- package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +0 -26
- package/Components/AudioPlayer/index.ts +0 -1
- package/Components/River/__tests__/__snapshots__/river.test.js.snap +0 -27
- package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +0 -60
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +0 -421
- package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +0 -176
- package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +0 -500
- package/Components/VideoModal/ModalAnimation/__tests__/getMoveUpValue.test.ts +0 -108
- package/Components/VideoModal/hooks/useBackgroundColor.ts +0 -10
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/Runtime.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/artWork.test.js.snap +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/artWork.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/channel.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/summary.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/title.test.js +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useEffect, useReducer } from "react";
|
|
3
|
-
|
|
4
|
-
import { TVMenuControl, View, ViewStyle } from "react-native";
|
|
3
|
+
import { View, ViewStyle } from "react-native";
|
|
5
4
|
import * as R from "ramda";
|
|
6
5
|
import uuid from "uuid/v4";
|
|
7
6
|
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils/playerManager";
|
|
@@ -58,9 +57,9 @@ import { usePlayNextOverlay } from "@applicaster/zapp-react-native-utils/appUtil
|
|
|
58
57
|
import { PlayNextState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/OverlayObserver/OverlaysObserver";
|
|
59
58
|
|
|
60
59
|
import {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
} from "@applicaster/zapp-react-native-
|
|
60
|
+
PlayerNativeCommandTypes,
|
|
61
|
+
PlayerNativeSendCommand,
|
|
62
|
+
} from "@applicaster/zapp-react-native-utils/appUtils/playerManager/playerNativeCommand";
|
|
64
63
|
|
|
65
64
|
type Props = {
|
|
66
65
|
Player: React.ComponentType<any>;
|
|
@@ -88,7 +87,7 @@ export const VideoModalMode = {
|
|
|
88
87
|
MAXIMIZED: "MAXIMIZED",
|
|
89
88
|
MINIMIZED: "MINIMIZED",
|
|
90
89
|
FULLSCREEN: "FULLSCREEN",
|
|
91
|
-
};
|
|
90
|
+
} as const;
|
|
92
91
|
|
|
93
92
|
export type PlayNextData = {
|
|
94
93
|
state: PlayNextState;
|
|
@@ -127,7 +126,7 @@ const webStyles = {
|
|
|
127
126
|
playerScreen: {
|
|
128
127
|
flex: 1,
|
|
129
128
|
height: "100vh",
|
|
130
|
-
|
|
129
|
+
backgroundColor: "black",
|
|
131
130
|
},
|
|
132
131
|
playerWrapper: {
|
|
133
132
|
height: "100%",
|
|
@@ -135,9 +134,6 @@ const webStyles = {
|
|
|
135
134
|
},
|
|
136
135
|
inlineRiver: {
|
|
137
136
|
height: INLINE_CONTAINER_CONTENT_HEIGHT,
|
|
138
|
-
|
|
139
|
-
borderWidth: 4,
|
|
140
|
-
borderColor: "yellow",
|
|
141
137
|
},
|
|
142
138
|
};
|
|
143
139
|
|
|
@@ -148,7 +144,6 @@ const nativeStyles = {
|
|
|
148
144
|
},
|
|
149
145
|
playerScreen: {
|
|
150
146
|
flex: 1,
|
|
151
|
-
backgroundColor: "black",
|
|
152
147
|
overflow: "hidden",
|
|
153
148
|
},
|
|
154
149
|
playerWrapper: {
|
|
@@ -248,9 +243,6 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
248
243
|
const screenData = useTargetScreenData(item);
|
|
249
244
|
const { setVisible: showNavBar } = useSetNavbarState();
|
|
250
245
|
|
|
251
|
-
const { isActiveGesture, startComponentsAnimation, setPlayerAnimationState } =
|
|
252
|
-
useModalAnimationContext();
|
|
253
|
-
|
|
254
246
|
const playerEvent = (event, ...args) => {
|
|
255
247
|
playerManager.invokeHandler(event, ...args);
|
|
256
248
|
};
|
|
@@ -263,9 +255,15 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
263
255
|
return;
|
|
264
256
|
}
|
|
265
257
|
|
|
258
|
+
// send command to clear and stop player
|
|
259
|
+
PlayerNativeSendCommand(
|
|
260
|
+
PlayerNativeCommandTypes.clearPlayerData,
|
|
261
|
+
state.playerId
|
|
262
|
+
);
|
|
263
|
+
|
|
266
264
|
showNavBar(true);
|
|
267
265
|
navigator.goBack();
|
|
268
|
-
}, [isModal, navigator.goBack, showNavBar]);
|
|
266
|
+
}, [isModal, navigator.goBack, state.playerId, showNavBar]);
|
|
269
267
|
|
|
270
268
|
const playEntry = (entry) => navigator.replaceTop(entry, { mode });
|
|
271
269
|
|
|
@@ -393,13 +391,17 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
393
391
|
}
|
|
394
392
|
};
|
|
395
393
|
|
|
396
|
-
const playerRemoteHandler = (
|
|
397
|
-
|
|
394
|
+
const playerRemoteHandler = React.useCallback(
|
|
395
|
+
(isLanguageOverlayVisible = false) =>
|
|
396
|
+
(event) => {
|
|
397
|
+
const { eventType } = event;
|
|
398
398
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
399
|
+
if (!isLanguageOverlayVisible && eventType === "menu") {
|
|
400
|
+
close();
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
[close]
|
|
404
|
+
);
|
|
403
405
|
|
|
404
406
|
// Effects
|
|
405
407
|
useEffect(() => {
|
|
@@ -413,7 +415,10 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
413
415
|
id: playerContainerId,
|
|
414
416
|
listener: {
|
|
415
417
|
onVideoEnd,
|
|
416
|
-
onError
|
|
418
|
+
onError: (err: Error) => {
|
|
419
|
+
// Adapt Error to the expected shape for onError
|
|
420
|
+
onError({ error: err });
|
|
421
|
+
},
|
|
417
422
|
onLoad,
|
|
418
423
|
onPlayerClose: close,
|
|
419
424
|
onPlayerDetached: close,
|
|
@@ -469,8 +474,6 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
469
474
|
if (isModal && mode === VideoModalMode.MAXIMIZED) {
|
|
470
475
|
if (disableMiniPlayer) {
|
|
471
476
|
navigator.closeVideoModal();
|
|
472
|
-
} else {
|
|
473
|
-
setPlayerAnimationState(PlayerAnimationStateEnum.minimize);
|
|
474
477
|
}
|
|
475
478
|
}
|
|
476
479
|
|
|
@@ -512,16 +515,6 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
512
515
|
}
|
|
513
516
|
}, [isAudioContent]);
|
|
514
517
|
|
|
515
|
-
// Needs to handle back button on Apple TV
|
|
516
|
-
// https://github.com/facebook/react-native/issues/18930
|
|
517
|
-
useEffect(() => {
|
|
518
|
-
TVMenuControl?.enableTVMenuKey();
|
|
519
|
-
|
|
520
|
-
return () => {
|
|
521
|
-
TVMenuControl?.disableTVMenuKey();
|
|
522
|
-
};
|
|
523
|
-
}, []);
|
|
524
|
-
|
|
525
518
|
useEffect(() => {
|
|
526
519
|
playerEvent("source_changed", { item });
|
|
527
520
|
|
|
@@ -568,8 +561,9 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
568
561
|
const isInlineTV = isInlineTVUtil(screenData);
|
|
569
562
|
|
|
570
563
|
const inline =
|
|
571
|
-
[VideoModalMode.MAXIMIZED, VideoModalMode.MINIMIZED].includes(
|
|
572
|
-
|
|
564
|
+
[VideoModalMode.MAXIMIZED, VideoModalMode.MINIMIZED].includes(
|
|
565
|
+
mode as any
|
|
566
|
+
) || isInlineTV;
|
|
573
567
|
|
|
574
568
|
const value = React.useMemo(
|
|
575
569
|
() => ({ playerId: state.playerId }),
|
|
@@ -590,7 +584,11 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
590
584
|
);
|
|
591
585
|
}
|
|
592
586
|
|
|
593
|
-
if (
|
|
587
|
+
if (
|
|
588
|
+
screen_background_color &&
|
|
589
|
+
mode !== VideoModalMode.FULLSCREEN &&
|
|
590
|
+
isTV()
|
|
591
|
+
) {
|
|
594
592
|
updatedStyles.playerScreen.backgroundColor = screen_background_color;
|
|
595
593
|
}
|
|
596
594
|
|
|
@@ -620,6 +618,8 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
620
618
|
playNextData,
|
|
621
619
|
};
|
|
622
620
|
|
|
621
|
+
const pointerEventsProp = mode === "MINIMIZED" ? "box-none" : "auto";
|
|
622
|
+
|
|
623
623
|
return (
|
|
624
624
|
<PlayerStateContext.Provider value={value}>
|
|
625
625
|
<PlayerContainerContextProvider
|
|
@@ -630,9 +630,9 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
630
630
|
<PlayerContainerContext.Consumer>
|
|
631
631
|
{(context) => (
|
|
632
632
|
<TVEventHandlerComponent
|
|
633
|
-
tvEventHandler={(
|
|
634
|
-
|
|
635
|
-
}
|
|
633
|
+
tvEventHandler={playerRemoteHandler(
|
|
634
|
+
context.isLanguageOverlayVisible
|
|
635
|
+
)}
|
|
636
636
|
>
|
|
637
637
|
<FocusableGroup
|
|
638
638
|
id={FocusableGroupMainContainerId}
|
|
@@ -640,14 +640,17 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
640
640
|
preferredFocus
|
|
641
641
|
shouldUsePreferredFocus
|
|
642
642
|
groupId={groupId}
|
|
643
|
+
pointerEvents={pointerEventsProp}
|
|
643
644
|
>
|
|
644
645
|
{/* Video player and components */}
|
|
645
646
|
<View
|
|
646
647
|
style={styles.playerScreen}
|
|
647
648
|
testID={"player-screen-container"}
|
|
649
|
+
pointerEvents={pointerEventsProp}
|
|
648
650
|
>
|
|
649
651
|
{/* Player container */}
|
|
650
652
|
<View
|
|
653
|
+
pointerEvents={pointerEventsProp}
|
|
651
654
|
style={[
|
|
652
655
|
styles.playerWrapper,
|
|
653
656
|
// eslint-disable-next-line react-native/no-inline-styles, react-native/no-color-literals
|
|
@@ -667,11 +670,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
667
670
|
autoplay={true}
|
|
668
671
|
controls={false}
|
|
669
672
|
disableCastAction={disableCastAction}
|
|
670
|
-
docked={
|
|
671
|
-
navigator.isVideoModalDocked() &&
|
|
672
|
-
!startComponentsAnimation &&
|
|
673
|
-
!isActiveGesture
|
|
674
|
-
}
|
|
673
|
+
docked={navigator.isVideoModalDocked()}
|
|
675
674
|
entry={item}
|
|
676
675
|
fullscreen={mode === VideoModalMode.FULLSCREEN}
|
|
677
676
|
inline={inline}
|
|
@@ -689,7 +688,6 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
689
688
|
setNextVideoPreloadThresholdPercentage={
|
|
690
689
|
setNextVideoPreloadThresholdPercentage
|
|
691
690
|
}
|
|
692
|
-
startComponentsAnimation={startComponentsAnimation}
|
|
693
691
|
>
|
|
694
692
|
{renderApplePlayer(applePlayerProps)}
|
|
695
693
|
</Player>
|
|
@@ -719,7 +717,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
719
717
|
key={item.id}
|
|
720
718
|
groupId={FocusableGroupMainContainerId}
|
|
721
719
|
cellTapAction={onCellTap}
|
|
722
|
-
extraAnchorPointYOffset={
|
|
720
|
+
extraAnchorPointYOffset={0}
|
|
723
721
|
isScreenWrappedInContainer={true}
|
|
724
722
|
containerHeight={styles.inlineRiver.height}
|
|
725
723
|
componentsMapExtraProps={{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { connectToStore } from "@applicaster/zapp-react-native-redux";
|
|
1
|
+
import { connectToStore } from "@applicaster/zapp-react-native-redux/utils/connectToStore";
|
|
2
2
|
import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
3
3
|
import { styleKeys } from "@applicaster/zapp-react-native-utils/styleKeysUtils";
|
|
4
4
|
import { transformColorCode as fixColorHexCode } from "@applicaster/zapp-react-native-utils/transform";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as R from "ramda";
|
|
2
2
|
|
|
3
|
-
import { connectToStore } from "@applicaster/zapp-react-native-redux";
|
|
3
|
+
import { connectToStore } from "@applicaster/zapp-react-native-redux/utils/connectToStore";
|
|
4
4
|
import { loadPipesData } from "@applicaster/zapp-react-native-redux/ZappPipes";
|
|
5
5
|
|
|
6
6
|
import { PlayerContainer as PlayerContainerComponent } from "./PlayerContainer";
|
|
@@ -2,12 +2,6 @@ import React, { PropsWithChildren } from "react";
|
|
|
2
2
|
import { ImageBackground, View } from "react-native";
|
|
3
3
|
|
|
4
4
|
import { imageSrcFromMediaItem } from "@applicaster/zapp-react-native-utils/configurationUtils";
|
|
5
|
-
import {
|
|
6
|
-
AnimationComponent,
|
|
7
|
-
ComponentAnimationType,
|
|
8
|
-
useModalAnimationContext,
|
|
9
|
-
PlayerAnimationStateEnum,
|
|
10
|
-
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
11
5
|
|
|
12
6
|
type Props = PropsWithChildren<{
|
|
13
7
|
entry: ZappEntry;
|
|
@@ -25,30 +19,17 @@ const PlayerImageBackgroundComponent = ({
|
|
|
25
19
|
style,
|
|
26
20
|
imageStyle,
|
|
27
21
|
imageKey,
|
|
28
|
-
defaultImageDimensions,
|
|
29
22
|
}: Props) => {
|
|
30
23
|
const source = React.useMemo(
|
|
31
|
-
() => ({ uri: imageSrcFromMediaItem(entry, imageKey) }),
|
|
24
|
+
() => ({ uri: imageSrcFromMediaItem(entry, [imageKey]) }),
|
|
32
25
|
[imageKey, entry]
|
|
33
26
|
);
|
|
34
27
|
|
|
35
|
-
const { playerAnimationState } = useModalAnimationContext();
|
|
36
|
-
|
|
37
28
|
if (!source) return <>{children}</>;
|
|
38
29
|
|
|
39
30
|
return (
|
|
40
|
-
<View
|
|
41
|
-
style={
|
|
42
|
-
playerAnimationState === PlayerAnimationStateEnum.maximize
|
|
43
|
-
? defaultImageDimensions
|
|
44
|
-
: style
|
|
45
|
-
}
|
|
46
|
-
>
|
|
47
|
-
<AnimationComponent
|
|
48
|
-
style={style}
|
|
49
|
-
animationType={ComponentAnimationType.player}
|
|
50
|
-
additionalData={defaultImageDimensions}
|
|
51
|
-
>
|
|
31
|
+
<View style={style}>
|
|
32
|
+
<View style={style}>
|
|
52
33
|
<ImageBackground
|
|
53
34
|
resizeMode="cover"
|
|
54
35
|
style={imageSize}
|
|
@@ -57,7 +38,7 @@ const PlayerImageBackgroundComponent = ({
|
|
|
57
38
|
>
|
|
58
39
|
{children}
|
|
59
40
|
</ImageBackground>
|
|
60
|
-
</
|
|
41
|
+
</View>
|
|
61
42
|
</View>
|
|
62
43
|
);
|
|
63
44
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as R from "ramda";
|
|
3
|
-
import {
|
|
3
|
+
import { FlatList, StyleSheet, View } from "react-native";
|
|
4
4
|
import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
|
|
5
5
|
import { RiverItem } from "../RiverItem";
|
|
6
6
|
import { RiverFooter } from "../RiverFooter";
|
|
@@ -9,8 +9,8 @@ import { useScreenConfiguration } from "../useScreenConfiguration";
|
|
|
9
9
|
import { RefreshControl } from "../RefreshControl";
|
|
10
10
|
import { ifEmptyUseFallback } from "@applicaster/zapp-react-native-utils/cellUtils";
|
|
11
11
|
import {
|
|
12
|
-
useProfilerLogging,
|
|
13
12
|
usePipesCacheReset,
|
|
13
|
+
useProfilerLogging,
|
|
14
14
|
} from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
15
15
|
import { useLoadingState } from "./hooks/useLoadingState";
|
|
16
16
|
import { ViewportTracker } from "../../Viewport";
|
|
@@ -25,6 +25,8 @@ import { useScreenContextV2 } from "@applicaster/zapp-react-native-utils/reactHo
|
|
|
25
25
|
import { useShallow } from "zustand/react/shallow";
|
|
26
26
|
|
|
27
27
|
import { isAndroidPlatform } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
28
|
+
import { ComponentsMapHeightContext } from "./ContextProviders/ComponentsMapHeightContext";
|
|
29
|
+
import { ComponentsMapRefContext } from "./ContextProviders/ComponentsMapRefContext";
|
|
28
30
|
|
|
29
31
|
const isAndroid = isAndroidPlatform();
|
|
30
32
|
|
|
@@ -70,6 +72,7 @@ function ComponentsMapComponent(props: Props) {
|
|
|
70
72
|
} = props;
|
|
71
73
|
|
|
72
74
|
const flatListRef = React.useRef<FlatList | null>(null);
|
|
75
|
+
const flatListWrapperRef = React.useRef<View | null>(null);
|
|
73
76
|
const screenConfig = useScreenConfiguration(riverId);
|
|
74
77
|
const screenData = useScreenData(riverId);
|
|
75
78
|
const pullToRefreshEnabled = screenData?.rules?.pull_to_refresh_enabled;
|
|
@@ -265,48 +268,51 @@ function ComponentsMapComponent(props: Props) {
|
|
|
265
268
|
// The Screen Picker in Mobile is completly different than the TV
|
|
266
269
|
// so the various offsets / margins in TV do not apply here.
|
|
267
270
|
return (
|
|
268
|
-
<View style={styles.container}>
|
|
269
|
-
<
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
271
|
+
<View style={styles.container} ref={flatListWrapperRef}>
|
|
272
|
+
<ComponentsMapHeightContext.Provider value={flatListHeight}>
|
|
273
|
+
<ComponentsMapRefContext.Provider value={flatListWrapperRef}>
|
|
274
|
+
<ScreenLoadingMeasurements
|
|
275
|
+
riverId={riverId}
|
|
276
|
+
numberOfComponents={riverComponents.length}
|
|
277
|
+
>
|
|
278
|
+
<ViewportTracker>
|
|
279
|
+
<FlatList
|
|
280
|
+
ref={(ref) => {
|
|
281
|
+
flatListRef.current = ref;
|
|
282
|
+
}}
|
|
283
|
+
// Fix for WebView rerender crashes on Android API 28+
|
|
284
|
+
// https://github.com/react-native-webview/react-native-webview/issues/1915#issuecomment-964035468
|
|
285
|
+
overScrollMode={isAndroid ? "never" : "auto"}
|
|
286
|
+
scrollIndicatorInsets={scrollIndicatorInsets}
|
|
287
|
+
extraData={feed}
|
|
288
|
+
stickyHeaderIndices={stickyHeaderIndices}
|
|
289
|
+
removeClippedSubviews={isAndroid}
|
|
290
|
+
onLayout={handleOnLayout}
|
|
291
|
+
initialNumToRender={3}
|
|
292
|
+
maxToRenderPerBatch={10}
|
|
293
|
+
windowSize={12}
|
|
294
|
+
keyExtractor={keyExtractor}
|
|
295
|
+
renderItem={renderRiverItem}
|
|
296
|
+
data={riverComponents}
|
|
297
|
+
contentContainerStyle={contentContainerStyle}
|
|
298
|
+
ListFooterComponent={
|
|
299
|
+
<RiverFooter
|
|
300
|
+
flatListHeight={flatListHeight}
|
|
301
|
+
loadingState={loadingState}
|
|
302
|
+
/>
|
|
303
|
+
}
|
|
304
|
+
refreshControl={refreshControl}
|
|
305
|
+
onScrollBeginDrag={onScrollBeginDrag}
|
|
306
|
+
onScroll={onScroll}
|
|
307
|
+
onMomentumScrollEnd={_onMomentumScrollEnd}
|
|
308
|
+
onScrollEndDrag={_onScrollEndDrag}
|
|
309
|
+
scrollEventThrottle={16}
|
|
310
|
+
{...scrollViewExtraProps}
|
|
298
311
|
/>
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
onMomentumScrollEnd={_onMomentumScrollEnd}
|
|
304
|
-
onScrollEndDrag={_onScrollEndDrag}
|
|
305
|
-
scrollEventThrottle={16}
|
|
306
|
-
{...scrollViewExtraProps}
|
|
307
|
-
/>
|
|
308
|
-
</ViewportTracker>
|
|
309
|
-
</ScreenLoadingMeasurements>
|
|
312
|
+
</ViewportTracker>
|
|
313
|
+
</ScreenLoadingMeasurements>
|
|
314
|
+
</ComponentsMapRefContext.Provider>
|
|
315
|
+
</ComponentsMapHeightContext.Provider>
|
|
310
316
|
</View>
|
|
311
317
|
);
|
|
312
318
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
export const ComponentsMapRefContext =
|
|
5
|
+
React.createContext<React.RefObject<View | null> | null>(null);
|
|
6
|
+
|
|
7
|
+
export const useComponentsMapRef = () =>
|
|
8
|
+
React.useContext(ComponentsMapRefContext);
|