Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Son Bui committed Dec 23, 2024
1 parent 0ae7dc4 commit 8b1712f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/media-console/src/VideoPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ const AnimatedVideoPlayer = (
onExitFullscreen = () => {},
onHideControls = () => {},
onShowControls = () => {},
onSetting = () => {},
name ="",
onPause,
onPlay,
onLoad,
Expand Down Expand Up @@ -213,6 +215,7 @@ const AnimatedVideoPlayer = (
onEnd: _onEnd,
onScreenTouch: _onScreenTouch,
onEnterFullscreen,
onSetting:onSetting,
onExitFullscreen,
onShowControls,
onHideControls,
Expand Down Expand Up @@ -432,6 +435,8 @@ const AnimatedVideoPlayer = (
onBack={events.onBack}
resetControlTimeout={resetControlTimeout}
showControls={showControls}
onSetting={events.onSetting}
name={name}
/>
<PlayPause
animations={animations}
Expand Down
15 changes: 14 additions & 1 deletion packages/media-console/src/components/TopControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
StyleSheet,
View,
GestureResponderHandlers,
Text,
} from 'react-native';
import {Volume} from './Volume';
import {Back} from './Back';
Expand All @@ -14,6 +15,7 @@ import type {VideoAnimations} from '../types';

interface TopControlProps {
showControls: boolean;
name: string;
panHandlers: GestureResponderHandlers;
animations: VideoAnimations;
disableBack: boolean;
Expand All @@ -22,6 +24,7 @@ interface TopControlProps {
volumeTrackWidth: number;
volumePosition: number;
onBack: () => void;
onSetting: () => void;
resetControlTimeout: () => void;
}

Expand All @@ -36,7 +39,9 @@ export const TopControls = memo(
volumePosition,
volumeTrackWidth,
onBack,
onSetting,
resetControlTimeout,
name,
}: TopControlProps) => {
const backControl = disableBack ? (
<NullControl />
Expand Down Expand Up @@ -68,7 +73,15 @@ export const TopControls = memo(
>
<SafeAreaView style={_styles.topControlGroup}>
{backControl}
<View style={_styles.pullRight}>{volumeControl}</View>
<View style={_styles.pullRight}>
{volumeControl}
<Text
style={{color: 'white', marginLeft: 10}}
onPress={onSetting}
>
{name}
</Text>
</View>
</SafeAreaView>
</ImageBackground>
</AnimatedView>
Expand Down

0 comments on commit 8b1712f

Please sign in to comment.