* Copyright (c) 2025 Huawei Technologies Co., Ltd.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import {View, Text} from 'react-native';
export function MockedVideoPlayer({
itemId,
height,
playMockVideo,
prefetchMockVideo,
}: {
height?: number;
itemId: string | number;
playMockVideo: boolean;
prefetchMockVideo?: boolean;
}) {
const backgroundPlayingColor = playMockVideo ? 'blue' : 'lightgray';
const backgroundPrefetchingColor = prefetchMockVideo
? 'lightblue'
: 'lightgray';
return (
<View
style={{
height: height ?? 200,
backgroundColor: playMockVideo
? backgroundPlayingColor
: backgroundPrefetchingColor,
borderWidth: 2,
marginBottom: 5,
justifyContent: 'center',
}}>
<Text style={{textAlign: 'center'}}>Item with id: {itemId}</Text>
<Text style={{textAlign: 'center'}}>Mocked Video Player</Text>
<Text style={{textAlign: 'center'}}>
{playMockVideo
? 'Playing'
: prefetchMockVideo
? 'Prefetching...'
: 'Waiting to be visible'}
</Text>
</View>
);
}