3
3
Animated ,
4
4
I18nManager ,
5
5
StyleSheet ,
6
- Text ,
7
6
TouchableHighlight ,
8
7
View ,
9
8
} from 'react-native' ;
@@ -31,16 +30,15 @@ import { formatTime } from '../utils/StringUtil';
31
30
import SeekBar , { SeekBarTheme } from './SeekBar' ;
32
31
import SlideButton , { SlideButtonTheme } from './SlideButton' ;
33
32
import GradientView from './GradientView' ;
34
- import IconTagView , {
33
+ import {
35
34
IconTagViewRef ,
36
35
IconTagViewState ,
37
- IconTagViewTheme ,
38
36
} from './IconTagView' ;
39
37
import { getAlphaColor } from '../utils/ColorUtil' ;
40
38
import TimeTagView , { TimeTagViewTheme } from './TimeTagView' ;
41
39
import VolumeTagView , { VolumeTagViewTheme } from './VolumeTagView' ;
42
40
import type { NexenTheme } from '../utils/Theme' ;
43
- import type { EdgeInsets , LayoutMode , NexenConfig } from './NexenPlayer' ;
41
+ import type { EdgeInsets , NexenConfig } from './NexenPlayer' ;
44
42
45
43
type FooterControlProps = {
46
44
opacity : Animated . Value ;
@@ -49,24 +47,14 @@ type FooterControlProps = {
49
47
isSeekable ?: React . MutableRefObject < boolean > ;
50
48
isVolumeSeekable ?: React . MutableRefObject < boolean > ;
51
49
fullScreen ?: boolean ;
52
- muted : boolean ;
53
50
locked : boolean ;
54
51
trackTime : number ;
55
52
cachedTrackTime : number ;
56
53
totalTrackTime : number ;
57
- volume : number ;
58
54
totalVolume : number ;
59
55
insets ?: EdgeInsets ;
60
56
playerConfig ?: NexenConfig ;
61
57
nexenTheme ?: NexenTheme ;
62
- // layoutMode?: LayoutMode;
63
- // disableSkip?: boolean;
64
- // disableStop?: boolean;
65
- // disableRatio?: boolean;
66
- // disableVolume?: boolean;
67
- // disableSubtitle?: boolean;
68
- // disableFullscreen?: boolean;
69
- // disablePlaylist?: boolean;
70
58
disablePlaylistAndSkip ?: boolean ;
71
59
onPlayPress ?: ( ) => void ;
72
60
onFullScreenPress ?: ( ) => void ;
@@ -114,28 +102,16 @@ const FooterControl = React.forwardRef<FooterControlRef, FooterControlProps>(
114
102
marginBottom,
115
103
paused,
116
104
fullScreen,
117
- muted,
118
105
locked,
119
106
insets,
120
107
playerConfig,
121
108
nexenTheme,
122
- // layoutMode,
123
-
124
109
trackTime,
125
110
cachedTrackTime,
126
111
totalTrackTime,
127
- volume,
128
112
totalVolume,
129
113
isSeekable,
130
114
isVolumeSeekable,
131
- // disableStop,
132
- // disableVolume,
133
- // disableSkip,
134
- // disableRatio,
135
- // disableSubtitle,
136
- // disableFullscreen,
137
- // disablePlaylist,
138
- // disableLargeMode,
139
115
disablePlaylistAndSkip,
140
116
onPlayPress,
141
117
onCcPress,
@@ -158,10 +134,7 @@ const FooterControl = React.forwardRef<FooterControlRef, FooterControlProps>(
158
134
onSkipNext,
159
135
onSkipBack,
160
136
onAspectRatioPress,
161
- // progress,
162
- // duration,
163
137
} = props ;
164
- // console.log(`FooterControl:: renders : isSeekable: ${isSeekable?.current}`);
165
138
const isRTL = I18nManager . isRTL ;
166
139
const iconTagViewRef = React . useRef < IconTagViewRef > ( null ) ;
167
140
@@ -193,8 +166,6 @@ const FooterControl = React.forwardRef<FooterControlRef, FooterControlProps>(
193
166
TAG_VIEW_HEIGHT ! +
194
167
CONTAINER_VERTICAL_PADDING ! ;
195
168
196
- // console.log(`FOOTER: HP: ${CONTAINER_HORIZONTAL_PADDING} VP: ${CONTAINER_VERTICAL_PADDING}`);
197
- // console.log(`FOOTER: CONTAINER_HEIGHT: ${CONTAINER_HEIGHT} VP: ${CONTAINER_VERTICAL_PADDING}`);
198
169
useImperativeHandle ( ref , ( ) => ( {
199
170
updateIconTagView : ( newState : IconTagViewState ) => {
200
171
iconTagViewRef . current ?. updateState ( newState ) ;
@@ -231,15 +202,15 @@ const FooterControl = React.forwardRef<FooterControlRef, FooterControlProps>(
231
202
232
203
const volumeSeekBarTheme = React . useMemo ( ( ) : VolumeTagViewTheme => {
233
204
return {
234
- barColor : muted
205
+ barColor : playerConfig ?. muted
235
206
? '#414141'
236
207
: nexenTheme ?. miniSeekBar ?. barColor ||
237
208
getAlphaColor ( nexenTheme ?. colors ?. secondaryColor ! , 0.7 ) ,
238
- underlayColor : muted
209
+ underlayColor : playerConfig ?. muted
239
210
? '#919191'
240
211
: nexenTheme ?. miniSeekBar ?. underlayColor ||
241
212
getAlphaColor ( nexenTheme ?. colors ?. primaryColor ! , 0.3 ) ,
242
- thumbColor : muted
213
+ thumbColor : playerConfig ?. muted
243
214
? '#313131'
244
215
: nexenTheme ?. miniSeekBar ?. thumbColor ||
245
216
nexenTheme ?. colors ?. accentColor ,
@@ -258,7 +229,7 @@ const FooterControl = React.forwardRef<FooterControlRef, FooterControlProps>(
258
229
thumbSize : nexenTheme ?. miniSeekBar ?. thumbSize ,
259
230
thumbCornerRadius : nexenTheme ?. miniSeekBar ?. thumbCornerRadius ,
260
231
} ;
261
- } , [ nexenTheme , fullScreen , muted ] ) ;
232
+ } , [ nexenTheme , fullScreen , playerConfig ] ) ;
262
233
263
234
const timeTagViewTheme = React . useMemo ( ( ) : TimeTagViewTheme => {
264
235
return {
@@ -280,33 +251,6 @@ const FooterControl = React.forwardRef<FooterControlRef, FooterControlProps>(
280
251
} ;
281
252
} , [ nexenTheme , fullScreen ] ) ;
282
253
283
- /* const iconTagViewTheme = React.useMemo((): IconTagViewTheme => {
284
- return {
285
- height: nexenTheme?.tagView?.height,
286
- cornerRadius: nexenTheme?.tagView?.cornerRadius,
287
- borderWidth: nexenTheme?.tagView?.borderWidth,
288
- iconSize: nexenTheme?.tagView?.iconSize!,
289
- textSize: nexenTheme?.tagView?.textSize,
290
- textLineHeight: nexenTheme?.tagView?.textLineHeight,
291
- iconColor:
292
- nexenTheme?.tagView?.iconColor || nexenTheme?.colors?.primaryColor,
293
- activeIconColor:
294
- nexenTheme?.tagView?.activeIconColor ||
295
- getAlphaColor(nexenTheme?.colors?.accentColor!, 0.7),
296
- inactiveIconColor:
297
- nexenTheme?.tagView?.inactiveIconColor ||
298
- getAlphaColor(nexenTheme?.colors?.primaryColor!, 0.5),
299
- textColor:
300
- nexenTheme?.tagView?.textColor ||
301
- nexenTheme?.colors?.secondaryTextColor,
302
- borderColor:
303
- nexenTheme?.tagView?.borderColor ||
304
- getAlphaColor(nexenTheme?.colors?.accentColor!, 0.7),
305
- };
306
- }, [nexenTheme, fullScreen]); */
307
-
308
- // console.log(`iconTagViewTheme:: ${JSON.stringify(iconTagViewTheme)}`);
309
-
310
254
const slideButtonTheme = React . useMemo ( ( ) : SlideButtonTheme => {
311
255
312
256
return {
@@ -359,7 +303,7 @@ const FooterControl = React.forwardRef<FooterControlRef, FooterControlProps>(
359
303
< View style = { styles . iconButtonContainer } >
360
304
{ ! playerConfig ?. disableVolume && (
361
305
< IconButton onPress = { onVolumePress } >
362
- { muted ? (
306
+ { playerConfig ?. muted ? (
363
307
< IconVolume size = { ICON_SIZE } color = { ICON_COLOR } />
364
308
) : (
365
309
< IconVolume2 size = { ICON_SIZE } color = { ICON_COLOR } />
@@ -420,9 +364,9 @@ const FooterControl = React.forwardRef<FooterControlRef, FooterControlProps>(
420
364
< View style = { styles . iconButtonContainer } >
421
365
{ ! playerConfig ?. disableVolume && (
422
366
< VolumeTagView
423
- volume = { volume }
367
+ volume = { playerConfig ?. volume }
424
368
totalVolume = { totalVolume }
425
- muted = { muted }
369
+ muted = { playerConfig ?. muted ! }
426
370
isSeekable = { isVolumeSeekable }
427
371
theme = { volumeSeekBarTheme }
428
372
onVolumeSeekStart = { onVolumeSeekStart }
@@ -456,11 +400,6 @@ const FooterControl = React.forwardRef<FooterControlRef, FooterControlProps>(
456
400
alignItems : 'center' ,
457
401
} }
458
402
>
459
- { /* <IconTagView
460
- ref={iconTagViewRef}
461
- style={{ marginLeft: 12 }}
462
- theme={iconTagViewTheme}
463
- /> */ }
464
403
{ ! playerConfig ?. disableResizeMode && ! locked && (
465
404
< IconButton onPress = { onAspectRatioPress } >
466
405
< IconAspectRatio size = { ICON_SIZE } color = { ICON_COLOR } />
@@ -475,12 +414,6 @@ const FooterControl = React.forwardRef<FooterControlRef, FooterControlProps>(
475
414
476
415
< View
477
416
style = { {
478
- // position: 'absolute',
479
- // left: 0,
480
- // right: 0,
481
- // bottom: 0,
482
- // backgroundColor: 'blue',
483
- // zIndex: 200,
484
417
flex : 1 ,
485
418
flexDirection : 'row' ,
486
419
justifyContent : 'center' ,
@@ -631,7 +564,7 @@ const FooterControl = React.forwardRef<FooterControlRef, FooterControlProps>(
631
564
export default React . memo ( FooterControl ) ;
632
565
633
566
FooterControl . defaultProps = {
634
- // disableLargeMode: false,
567
+
635
568
} ;
636
569
637
570
const styles = StyleSheet . create ( {
@@ -643,7 +576,6 @@ const styles = StyleSheet.create({
643
576
height : 68 ,
644
577
minHeight : 68 ,
645
578
zIndex : 100 ,
646
- // backgroundColor: 'pink'
647
579
} ,
648
580
innerContainer : {
649
581
position : 'absolute' ,
@@ -652,14 +584,10 @@ const styles = StyleSheet.create({
652
584
right : 0 ,
653
585
bottom : 0 ,
654
586
flexDirection : 'row' ,
655
- // paddingBottom: 8,
656
- // backgroundColor: 'red',
657
587
} ,
658
588
iconButtonContainer : {
659
589
flexDirection : 'row' ,
660
590
alignItems : 'center' ,
661
- // flexShrink: 1,
662
- // backgroundColor: 'green',
663
591
} ,
664
592
lockedViewContainer : {
665
593
flexDirection : 'row' ,
@@ -682,19 +610,6 @@ const styles = StyleSheet.create({
682
610
trackSeekbar : {
683
611
marginHorizontal : 4 ,
684
612
} ,
685
- // textContainer: {
686
- // height: 18,
687
- // borderRadius: 9,
688
- // borderWidth: 2,
689
- // justifyContent: 'center',
690
- // alignItems: 'center',
691
- // },
692
- // timeText: {
693
- // fontSize: 11,
694
- // opacity: 0.8,
695
- // marginHorizontal: 6,
696
- // lineHeight: 13,
697
- // },
698
613
slideButtonContainer : {
699
614
flex : 1 ,
700
615
padding : 8 ,
0 commit comments