@wereform/pkgm-video 1.0.0 → 1.0.2
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/README.md +212 -15
- package/package.json +11 -7
- package/babel.config.js +0 -3
- package/dist/components/VideoTestScreen.js +0 -1
- package/dist/layout/VideoUploadLayout.js +0 -0
- package/packageJSON.md +0 -27
- package/src/components/Thumbnail.jsx +0 -21
- package/src/components/VideoPlayer.jsx +0 -47
- package/src/components/VideoTestScreen.jsx +0 -14
- package/src/index.js +0 -4
- package/src/layout/VideoCardHorizontalLayout.jsx +0 -52
- package/src/layout/VideoCardLayout.jsx +0 -75
- package/src/layout/VideoUploadLayout.jsx +0 -0
- package/src/layout/VideoViewLayout.jsx +0 -107
- package/src/styles/VideoCardLayoutStyles.js +0 -54
- package/src/styles/VideoPlayerStyles.js +0 -16
- package/src/styles/globalStyles.js +0 -28
package/README.md
CHANGED
|
@@ -1,24 +1,221 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @wereform/pkgm-video
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Reusable video UI components and layouts for the WeReform / BEGENONE platform.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This package provides video-centric building blocks including thumbnails, video players, card layouts, and full video view layouts. It is designed for mobile-first experiences using React Native and Expo, and composes cleanly with shared UI primitives from the WeReform ecosystem.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
---
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Install
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
```bash
|
|
12
|
+
npm install @wereform/pkgm-video
|
|
13
|
+
# or
|
|
14
|
+
yarn add @wereform/pkgm-video
|
|
15
|
+
# or
|
|
16
|
+
pnpm add @wereform/pkgm-video
|
|
17
|
+
```
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
---
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
## What this package gives you
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
- Video UI components:
|
|
21
24
|
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
+
- Video thumbnail renderer
|
|
26
|
+
- Auto-playing video player
|
|
27
|
+
- Horizontal and vertical video cards
|
|
28
|
+
|
|
29
|
+
- Video layouts:
|
|
30
|
+
|
|
31
|
+
- Full video view layout with metadata and interactions
|
|
32
|
+
- Scrollable suggested videos list
|
|
33
|
+
|
|
34
|
+
- Built for:
|
|
35
|
+
|
|
36
|
+
- React Native / Expo
|
|
37
|
+
- Video-first feeds and detail pages
|
|
38
|
+
- Composition with channel, menu, and shared UI packages
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Exports
|
|
43
|
+
|
|
44
|
+
From `@wereform/pkgm-video` you can import:
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
import {
|
|
48
|
+
Thumbnail,
|
|
49
|
+
VideoPlayer,
|
|
50
|
+
VideoCardLayout,
|
|
51
|
+
VideoCardHorizontalLayout,
|
|
52
|
+
VideoViewLayout,
|
|
53
|
+
} from "@wereform/pkgm-video";
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Core components
|
|
59
|
+
|
|
60
|
+
## Thumbnail
|
|
61
|
+
|
|
62
|
+
Renders a responsive 16:9 video thumbnail.
|
|
63
|
+
|
|
64
|
+
### Props
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
Thumbnail({
|
|
68
|
+
thumbnailURL,
|
|
69
|
+
thumbHeight,
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
- `thumbnailURL` Thumbnail image URL
|
|
74
|
+
- `thumbHeight` Height of the thumbnail container
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## VideoPlayer
|
|
79
|
+
|
|
80
|
+
Auto-playing, looping video player built on `expo-video`.
|
|
81
|
+
|
|
82
|
+
### Props
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
VideoPlayer({
|
|
86
|
+
videoSource,
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
- Automatically plays when screen is focused
|
|
91
|
+
- Pauses when screen loses focus
|
|
92
|
+
- Supports picture-in-picture mode
|
|
93
|
+
- Maintains a 16:9 aspect ratio
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## VideoCardHorizontalLayout
|
|
98
|
+
|
|
99
|
+
Compact horizontal video card used in lists and side feeds.
|
|
100
|
+
|
|
101
|
+
### Props
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
VideoCardHorizontalLayout({
|
|
105
|
+
timeAgo,
|
|
106
|
+
viewsText,
|
|
107
|
+
titleText,
|
|
108
|
+
contentThumbUrl,
|
|
109
|
+
navigateToVideo,
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
- Designed for dense lists
|
|
114
|
+
- Clickable to navigate to video detail view
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## VideoCardLayout
|
|
119
|
+
|
|
120
|
+
Standard vertical video card with thumbnail, title, channel info, and metadata.
|
|
121
|
+
|
|
122
|
+
### Props
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
VideoCardLayout({
|
|
126
|
+
timeAgo,
|
|
127
|
+
viewsText,
|
|
128
|
+
titleText,
|
|
129
|
+
userNameText,
|
|
130
|
+
contentThumbUrl,
|
|
131
|
+
channelLogo,
|
|
132
|
+
containerStyles,
|
|
133
|
+
dateViewsContainerStyle,
|
|
134
|
+
userImageStyles,
|
|
135
|
+
titleNameContainerStyles,
|
|
136
|
+
userNameTextStyles,
|
|
137
|
+
titleTextStyles,
|
|
138
|
+
thumbnailImageStyles,
|
|
139
|
+
customMetaDataStyles,
|
|
140
|
+
navigateToVideo,
|
|
141
|
+
});
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
- Highly customizable via style overrides
|
|
145
|
+
- Used across feeds and suggested video sections
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## VideoViewLayout
|
|
150
|
+
|
|
151
|
+
Full video detail layout including player, title, interactions, channel metadata, and suggested videos.
|
|
152
|
+
|
|
153
|
+
### Props
|
|
154
|
+
|
|
155
|
+
```ts
|
|
156
|
+
VideoViewLayout({
|
|
157
|
+
videoSource,
|
|
158
|
+
CustomizedTitleText,
|
|
159
|
+
MenuChannelMetaTimeAgo,
|
|
160
|
+
MenuChannelMetaViews,
|
|
161
|
+
MenuChannelMetaUserName,
|
|
162
|
+
MenuChannelMetaSubCount,
|
|
163
|
+
MenuChannelMetaChannelLogo,
|
|
164
|
+
suggestedVideos,
|
|
165
|
+
});
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
- Renders the active video at the top
|
|
169
|
+
- Displays interaction controls
|
|
170
|
+
- Shows channel metadata
|
|
171
|
+
- Maps and renders suggested videos below
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Typical usage
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
<VideoViewLayout
|
|
179
|
+
videoSource={{ uri: videoUrl }}
|
|
180
|
+
CustomizedTitleText="Video title"
|
|
181
|
+
MenuChannelMetaUserName="WeReform"
|
|
182
|
+
MenuChannelMetaSubCount="542,000"
|
|
183
|
+
suggestedVideos={videos}
|
|
184
|
+
/>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Design philosophy
|
|
190
|
+
|
|
191
|
+
- UI-only package
|
|
192
|
+
- No data fetching or API calls
|
|
193
|
+
- Video lifecycle handled at the layout level
|
|
194
|
+
- Composable with shared menu and channel components
|
|
195
|
+
- Optimized for mobile performance and readability
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## License
|
|
200
|
+
|
|
201
|
+
MIT License
|
|
202
|
+
|
|
203
|
+
Copyright (c) 2025 WeReform / BEGENONE
|
|
204
|
+
|
|
205
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
206
|
+
of this software and associated documentation files (the “Software”), to deal
|
|
207
|
+
in the Software without restriction, including without limitation the rights
|
|
208
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
209
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
210
|
+
furnished to do so, subject to the following conditions:
|
|
211
|
+
|
|
212
|
+
The above copyright notice and this permission notice shall be included in
|
|
213
|
+
all copies or substantial portions of the Software.
|
|
214
|
+
|
|
215
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
216
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
217
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
218
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
219
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
220
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
221
|
+
THE SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wereform/pkgm-video",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
5
|
+
"files": [
|
|
6
|
+
"dist",
|
|
7
|
+
"README.md"
|
|
8
|
+
],
|
|
8
9
|
"publishConfig": {
|
|
9
10
|
"access": "public"
|
|
10
11
|
},
|
|
@@ -16,8 +17,8 @@
|
|
|
16
17
|
"react-native": "*"
|
|
17
18
|
},
|
|
18
19
|
"dependencies": {
|
|
19
|
-
"@wereform/pkgm-api": "^1.0.
|
|
20
|
-
"@wereform/pkgm-shared": "^1.0.
|
|
20
|
+
"@wereform/pkgm-api": "^1.0.7",
|
|
21
|
+
"@wereform/pkgm-shared": "^1.0.2",
|
|
21
22
|
"@expo/vector-icons": "^15.0.3"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
@@ -25,5 +26,8 @@
|
|
|
25
26
|
"@babel/core": "^7.28.5",
|
|
26
27
|
"@babel/preset-env": "^7.28.5",
|
|
27
28
|
"metro-react-native-babel-preset": "^0.77.0"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "babel src --out-dir dist --extensions .js,.jsx"
|
|
28
32
|
}
|
|
29
|
-
}
|
|
33
|
+
}
|
package/babel.config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.VideoTestScreen=void 0;var _reactNative=require("react-native");var _pkgmShared=require("@wereform/pkgm-shared");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="F:\\WeReform Corporation\\Products\\BEGENONE\\App\\mobile\\packages\\begenone-pkgm-video\\src\\components\\VideoTestScreen.jsx";var VideoTestScreen=exports.VideoTestScreen=function VideoTestScreen(){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:{flex:1,justifyContent:"center",alignItems:"center"},children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{children:"Video Test Screen"}),(0,_jsxRuntime.jsx)(_pkgmShared.SampleButton,{title:"Press From Shared!",onPress:function onPress(){return alert("Works!");}})]});};
|
|
File without changes
|
package/packageJSON.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@begenone/pkgm-video",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "babel src --out-dir dist --extensions .js,.jsx"
|
|
8
|
-
},
|
|
9
|
-
"peerDependencies": {
|
|
10
|
-
"@expo/vector-icons": "_",
|
|
11
|
-
"expo": "_",
|
|
12
|
-
"expo-video": "_",
|
|
13
|
-
"react": "_",
|
|
14
|
-
"react-native": "_"
|
|
15
|
-
},
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"@begenone/pkgm-api": "workspace:_",
|
|
18
|
-
"@begenone/pkgm-shared": "workspace:\*",
|
|
19
|
-
"@expo/vector-icons": "^15.0.3"
|
|
20
|
-
},
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"@babel/cli": "^7.28.3",
|
|
23
|
-
"@babel/core": "^7.28.5",
|
|
24
|
-
"@babel/preset-env": "^7.28.5",
|
|
25
|
-
"metro-react-native-babel-preset": "^0.77.0"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Image, View } from "react-native";
|
|
2
|
-
|
|
3
|
-
export function Thumbnail({ thumbnailURL, thumbHeight }) {
|
|
4
|
-
return (
|
|
5
|
-
<View style={{ width: "auto" }}>
|
|
6
|
-
<Image
|
|
7
|
-
source={{
|
|
8
|
-
uri:
|
|
9
|
-
thumbnailURL ||
|
|
10
|
-
"https://begenone-images.s3.us-east-1.amazonaws.com/let+Me+Love+you.jpg",
|
|
11
|
-
}}
|
|
12
|
-
style={{
|
|
13
|
-
width: "100%",
|
|
14
|
-
height: thumbHeight,
|
|
15
|
-
aspectRatio: 16 / 9,
|
|
16
|
-
borderRadius: 5,
|
|
17
|
-
}}
|
|
18
|
-
/>
|
|
19
|
-
</View>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { useEvent } from "expo";
|
|
2
|
-
import { useVideoPlayer, VideoView } from "expo-video";
|
|
3
|
-
import { View, useWindowDimensions } from "react-native";
|
|
4
|
-
import { VideoPlayerStyles } from "../styles/VideoPlayerStyles";
|
|
5
|
-
import { useCallback, useRef } from "react";
|
|
6
|
-
import { useFocusEffect } from "@react-navigation/native";
|
|
7
|
-
|
|
8
|
-
export function VideoPlayer({ videoSource }) {
|
|
9
|
-
const { width } = useWindowDimensions(); // Dynamically get device width
|
|
10
|
-
|
|
11
|
-
const playerRef = useRef(null);
|
|
12
|
-
|
|
13
|
-
const player = useVideoPlayer(videoSource, p => {
|
|
14
|
-
p.loop = true;
|
|
15
|
-
p.play();
|
|
16
|
-
playerRef.current = p; // store instance
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
useFocusEffect(
|
|
20
|
-
useCallback(() => {
|
|
21
|
-
if (playerRef.current) {
|
|
22
|
-
playerRef.current.play();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return () => {
|
|
26
|
-
if (playerRef.current) {
|
|
27
|
-
playerRef.current.pause();
|
|
28
|
-
// Optional: fully unload the video
|
|
29
|
-
// playerRef.current.unloadAsync?.();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
}, [])
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
useEvent(player, "playingChange");
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<View style={VideoPlayerStyles.contentContainer}>
|
|
39
|
-
<VideoView
|
|
40
|
-
style={[VideoPlayerStyles.video, { width, height: width * (9 / 16) }]} // 16:9 ratio
|
|
41
|
-
player={player}
|
|
42
|
-
// allowsFullscreen
|
|
43
|
-
allowsPictureInPicture
|
|
44
|
-
/>
|
|
45
|
-
</View>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { View, Text } from "react-native";
|
|
2
|
-
import { SampleButton } from "@wereform/pkgm-shared";
|
|
3
|
-
|
|
4
|
-
export const VideoTestScreen = () => {
|
|
5
|
-
return (
|
|
6
|
-
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
|
|
7
|
-
<Text>Video Test Screen</Text>
|
|
8
|
-
<SampleButton
|
|
9
|
-
title="Press From Shared!"
|
|
10
|
-
onPress={() => alert("Works!")}
|
|
11
|
-
/>
|
|
12
|
-
</View>
|
|
13
|
-
);
|
|
14
|
-
};
|
package/src/index.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Text, TouchableOpacity, View } from "react-native";
|
|
2
|
-
import { Thumbnail } from "../components/Thumbnail";
|
|
3
|
-
import { CustomizedTitle, DateViews } from "@wereform/pkgm-shared";
|
|
4
|
-
|
|
5
|
-
export function VideoCardHorizontalLayout({
|
|
6
|
-
eyeIcon,
|
|
7
|
-
timeAgo,
|
|
8
|
-
viewsText,
|
|
9
|
-
titleText,
|
|
10
|
-
contentThumbUrl,
|
|
11
|
-
navigateToVideo,
|
|
12
|
-
}) {
|
|
13
|
-
return (
|
|
14
|
-
<TouchableOpacity
|
|
15
|
-
onPress={navigateToVideo}
|
|
16
|
-
style={{
|
|
17
|
-
flexDirection: "row",
|
|
18
|
-
padding: 8,
|
|
19
|
-
}}
|
|
20
|
-
>
|
|
21
|
-
<Thumbnail thumbHeight={90} thumbnailURL={contentThumbUrl} />
|
|
22
|
-
<View style={{ flex: 1, marginLeft: 12 }}>
|
|
23
|
-
<CustomizedTitle
|
|
24
|
-
title={titleText || "This is a dummy text title for the video"}
|
|
25
|
-
fontSize={18}
|
|
26
|
-
textColor="white"
|
|
27
|
-
style={{ width: "100%" }}
|
|
28
|
-
/>
|
|
29
|
-
|
|
30
|
-
<DateViews
|
|
31
|
-
eyeIcon={eyeIcon}
|
|
32
|
-
timeAgo={timeAgo}
|
|
33
|
-
viewsText={viewsText}
|
|
34
|
-
containerStyles={{
|
|
35
|
-
flexDirection: "column",
|
|
36
|
-
justifyContent: "start",
|
|
37
|
-
height: 40,
|
|
38
|
-
}}
|
|
39
|
-
dateContainerStyles={{
|
|
40
|
-
paddingBottom: 4,
|
|
41
|
-
}}
|
|
42
|
-
dateTextStyles={{
|
|
43
|
-
fontSize: 12,
|
|
44
|
-
}}
|
|
45
|
-
viewsTextStyles={{
|
|
46
|
-
fontSize: 12,
|
|
47
|
-
}}
|
|
48
|
-
/>
|
|
49
|
-
</View>
|
|
50
|
-
</TouchableOpacity>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { Image, Text, TouchableOpacity, View } from "react-native";
|
|
2
|
-
import { VideoCardLayoutStyles } from "../styles/VideoCardLayoutStyles";
|
|
3
|
-
import { DateViews } from "@wereform/pkgm-shared";
|
|
4
|
-
|
|
5
|
-
export const VideoCardLayout = ({
|
|
6
|
-
timeAgo,
|
|
7
|
-
viewsText,
|
|
8
|
-
titleText,
|
|
9
|
-
userNameText,
|
|
10
|
-
contentThumbUrl,
|
|
11
|
-
channelLogo,
|
|
12
|
-
containerStyles,
|
|
13
|
-
dateViewsContainerStyle,
|
|
14
|
-
userImageStyles,
|
|
15
|
-
titleNameContainerStyles,
|
|
16
|
-
userNameTextStyles,
|
|
17
|
-
titleTextStyles,
|
|
18
|
-
thumbnailImageStyles,
|
|
19
|
-
customMetaDataStyles,
|
|
20
|
-
navigateToVideo,
|
|
21
|
-
}) => {
|
|
22
|
-
return (
|
|
23
|
-
<View
|
|
24
|
-
style={[VideoCardLayoutStyles.container, containerStyles]}
|
|
25
|
-
onPress={navigateToVideo}
|
|
26
|
-
>
|
|
27
|
-
<View style={VideoCardLayoutStyles.imageWrapper}>
|
|
28
|
-
<Image
|
|
29
|
-
source={{
|
|
30
|
-
uri:
|
|
31
|
-
contentThumbUrl ||
|
|
32
|
-
"https://begenone-images.s3.us-east-1.amazonaws.com/let+Me+Love+you.jpg",
|
|
33
|
-
}}
|
|
34
|
-
style={[VideoCardLayoutStyles.image, thumbnailImageStyles]}
|
|
35
|
-
/>
|
|
36
|
-
</View>
|
|
37
|
-
|
|
38
|
-
<DateViews
|
|
39
|
-
timeAgo={timeAgo}
|
|
40
|
-
viewsText={viewsText}
|
|
41
|
-
containerStyles={dateViewsContainerStyle}
|
|
42
|
-
/>
|
|
43
|
-
|
|
44
|
-
<View style={[VideoCardLayoutStyles.metaData, customMetaDataStyles]}>
|
|
45
|
-
<Image
|
|
46
|
-
source={{
|
|
47
|
-
uri:
|
|
48
|
-
channelLogo ||
|
|
49
|
-
"https://begenone-images.s3.us-east-1.amazonaws.com/default-user-photo.jpg",
|
|
50
|
-
}}
|
|
51
|
-
style={[VideoCardLayoutStyles.userImage, userImageStyles]}
|
|
52
|
-
/>
|
|
53
|
-
<View
|
|
54
|
-
style={[
|
|
55
|
-
VideoCardLayoutStyles.titleNameContainer,
|
|
56
|
-
titleNameContainerStyles,
|
|
57
|
-
]}
|
|
58
|
-
>
|
|
59
|
-
<Text
|
|
60
|
-
style={[VideoCardLayoutStyles.titleText, titleTextStyles]}
|
|
61
|
-
numberOfLines={2}
|
|
62
|
-
>
|
|
63
|
-
{titleText ||
|
|
64
|
-
"This is a Default Title Text in case of nothing being passed in."}
|
|
65
|
-
</Text>
|
|
66
|
-
<Text
|
|
67
|
-
style={[VideoCardLayoutStyles.userNameText, userNameTextStyles]}
|
|
68
|
-
>
|
|
69
|
-
{userNameText || "Default Username"}
|
|
70
|
-
</Text>
|
|
71
|
-
</View>
|
|
72
|
-
</View>
|
|
73
|
-
</View>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
File without changes
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { ScrollView, View } from "react-native";
|
|
2
|
-
import { VideoPlayer } from "../components/VideoPlayer";
|
|
3
|
-
import {
|
|
4
|
-
CustomizedTitle,
|
|
5
|
-
MenuChannelMeta,
|
|
6
|
-
MenuInteraction,
|
|
7
|
-
} from "@wereform/pkgm-shared";
|
|
8
|
-
import { Ionicons } from "@expo/vector-icons";
|
|
9
|
-
import { VideoCardLayout } from "./VideoCardLayout";
|
|
10
|
-
|
|
11
|
-
export function VideoViewLayout({
|
|
12
|
-
videoSource,
|
|
13
|
-
CustomizedTitleText,
|
|
14
|
-
MenuChannelMetaTimeAgo,
|
|
15
|
-
MenuChannelMetaViews,
|
|
16
|
-
MenuChannelMetaUserName,
|
|
17
|
-
MenuChannelMetaSubCount,
|
|
18
|
-
MenuChannelMetaChannelLogo,
|
|
19
|
-
suggestedVideos,
|
|
20
|
-
}) {
|
|
21
|
-
console.log(
|
|
22
|
-
"SUGGESTED VIDEOS FROM VIDEO VIEWS LAYOUT: =>\n" +
|
|
23
|
-
JSON.stringify(suggestedVideos[0].videos, null, 2)
|
|
24
|
-
);
|
|
25
|
-
return (
|
|
26
|
-
<ScrollView>
|
|
27
|
-
<View>
|
|
28
|
-
<VideoPlayer videoSource={videoSource} />
|
|
29
|
-
</View>
|
|
30
|
-
<CustomizedTitle
|
|
31
|
-
title={CustomizedTitleText}
|
|
32
|
-
fontSize={22}
|
|
33
|
-
fontFamily="Inter"
|
|
34
|
-
textColor="white"
|
|
35
|
-
style={{
|
|
36
|
-
paddingTop: 18,
|
|
37
|
-
paddingLeft: 22,
|
|
38
|
-
paddingRight: 22,
|
|
39
|
-
paddingBottom: 18,
|
|
40
|
-
alignSelf: "start",
|
|
41
|
-
}}
|
|
42
|
-
textStyle={{
|
|
43
|
-
lineHeight: 28,
|
|
44
|
-
}}
|
|
45
|
-
/>
|
|
46
|
-
|
|
47
|
-
<MenuInteraction
|
|
48
|
-
likeIcon={<Ionicons name="thumbs-up-outline" size={24} color="white" />}
|
|
49
|
-
dislikeIcon={
|
|
50
|
-
<Ionicons name="thumbs-down-outline" size={24} color="white" />
|
|
51
|
-
}
|
|
52
|
-
shareIcon={
|
|
53
|
-
<Ionicons name="arrow-redo-outline" size={24} color="white" />
|
|
54
|
-
}
|
|
55
|
-
commentIcon={
|
|
56
|
-
<Ionicons
|
|
57
|
-
name="chatbubble-ellipses-outline"
|
|
58
|
-
size={24}
|
|
59
|
-
color="white"
|
|
60
|
-
/>
|
|
61
|
-
}
|
|
62
|
-
containerStyles={{
|
|
63
|
-
marginLeft: 12,
|
|
64
|
-
}}
|
|
65
|
-
/>
|
|
66
|
-
|
|
67
|
-
<MenuChannelMeta
|
|
68
|
-
calendarIcon={
|
|
69
|
-
<Ionicons name="calendar-clear-outline" size={18} color="white" />
|
|
70
|
-
}
|
|
71
|
-
timeAgo={MenuChannelMetaTimeAgo}
|
|
72
|
-
eyeIcon={<Ionicons name="eye-outline" size={18} color="white" />}
|
|
73
|
-
viewsText={MenuChannelMetaViews}
|
|
74
|
-
userName={MenuChannelMetaUserName}
|
|
75
|
-
subscribersCount={MenuChannelMetaSubCount}
|
|
76
|
-
channelLogo={MenuChannelMetaChannelLogo}
|
|
77
|
-
containerStyles={{
|
|
78
|
-
marginTop: 12,
|
|
79
|
-
}}
|
|
80
|
-
/>
|
|
81
|
-
|
|
82
|
-
{suggestedVideos[0].videos.map(video => {
|
|
83
|
-
return (
|
|
84
|
-
<View style={{ marginTop: 24 }} key={video._id}>
|
|
85
|
-
<VideoCardLayout
|
|
86
|
-
key={video._id}
|
|
87
|
-
titleText={video.title}
|
|
88
|
-
contentThumbUrl={video.thumbUrl}
|
|
89
|
-
userNameText={video.channel?.name || "Unknown"}
|
|
90
|
-
channelLogo={video.channelLogo}
|
|
91
|
-
timeAgo={video.videoTimeAgo}
|
|
92
|
-
viewsText={String(video.views)}
|
|
93
|
-
calendarIcon={
|
|
94
|
-
<Ionicons
|
|
95
|
-
name="calendar-clear-outline"
|
|
96
|
-
size={18}
|
|
97
|
-
color="white"
|
|
98
|
-
/>
|
|
99
|
-
}
|
|
100
|
-
eyeIcon={<Ionicons name="eye-outline" size={18} color="white" />}
|
|
101
|
-
/>
|
|
102
|
-
</View>
|
|
103
|
-
);
|
|
104
|
-
})}
|
|
105
|
-
</ScrollView>
|
|
106
|
-
);
|
|
107
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { globalStyles } from "./globalStyles";
|
|
2
|
-
|
|
3
|
-
export const VideoCardLayoutStyles = {
|
|
4
|
-
container: {
|
|
5
|
-
width: "auto",
|
|
6
|
-
flexDirection: "column",
|
|
7
|
-
marginRight: 12,
|
|
8
|
-
marginLeft: 12,
|
|
9
|
-
marginBottom: 40,
|
|
10
|
-
},
|
|
11
|
-
imageWrapper: {
|
|
12
|
-
width: "100%",
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
image: {
|
|
16
|
-
width: "100%",
|
|
17
|
-
resizeMode: "contain",
|
|
18
|
-
aspectRatio: 16 / 9,
|
|
19
|
-
borderRadius: globalStyles.borders.borderPrimary100,
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
metaData: {
|
|
23
|
-
flexDirection: "row",
|
|
24
|
-
marginTop: 16,
|
|
25
|
-
paddingLeft: 8,
|
|
26
|
-
paddingRight: 8,
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
userImage: {
|
|
30
|
-
width: 40,
|
|
31
|
-
height: 40,
|
|
32
|
-
borderRadius: globalStyles.borders.borderPrimary50,
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
titleNameContainer: {
|
|
36
|
-
width: "100%",
|
|
37
|
-
flexDirection: "column",
|
|
38
|
-
paddingLeft: 16,
|
|
39
|
-
flexShrink: 1,
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
titleText: {
|
|
43
|
-
fontSize: 22,
|
|
44
|
-
paddingBottom: 12,
|
|
45
|
-
lineHeight: 30,
|
|
46
|
-
fontWeight: "bold",
|
|
47
|
-
color: "#fff",
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
userNameText: {
|
|
51
|
-
color: globalStyles.colors.colorPrimary400,
|
|
52
|
-
fontWeight: "bold",
|
|
53
|
-
},
|
|
54
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { StyleSheet } from "react-native";
|
|
2
|
-
|
|
3
|
-
export const VideoPlayerStyles = StyleSheet.create({
|
|
4
|
-
contentContainer: {
|
|
5
|
-
// flex: 1,
|
|
6
|
-
alignItems: "center",
|
|
7
|
-
justifyContent: "flex-start",
|
|
8
|
-
// backgroundColor: "#000",
|
|
9
|
-
},
|
|
10
|
-
video: {
|
|
11
|
-
// borderRadius: 10,
|
|
12
|
-
},
|
|
13
|
-
controlsContainer: {
|
|
14
|
-
padding: 10,
|
|
15
|
-
},
|
|
16
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { StyleSheet } from "react-native";
|
|
2
|
-
|
|
3
|
-
export const globalStyles = StyleSheet.create({
|
|
4
|
-
colors: {
|
|
5
|
-
colorPrimary50: "rgba(21, 21, 21, .7)",
|
|
6
|
-
colorPrimary100: "#151515",
|
|
7
|
-
|
|
8
|
-
colorPrimary200: "#252525",
|
|
9
|
-
|
|
10
|
-
colorPrimary300: "#3C3C3C",
|
|
11
|
-
colorPrimary350: "rgba(60,60,60,.2)",
|
|
12
|
-
|
|
13
|
-
colorPrimary400: "#7F7F7F",
|
|
14
|
-
|
|
15
|
-
colorPrimary500: "#D3D3D3",
|
|
16
|
-
|
|
17
|
-
colorPrimary600: "#ff6600ff",
|
|
18
|
-
|
|
19
|
-
colorPrimary700: "#FF8800",
|
|
20
|
-
},
|
|
21
|
-
borders: {
|
|
22
|
-
borderPrimary50: 8,
|
|
23
|
-
borderPrimary100: 10,
|
|
24
|
-
borderPrimary200: 12,
|
|
25
|
-
borderPrimary300: 15,
|
|
26
|
-
borderPrimary400: 30,
|
|
27
|
-
},
|
|
28
|
-
});
|