1.0.3 • Published 1 year ago

react-native-youtube-popup-player v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

React Native Youtube Popup Player is a custom Youtube iframe player with a popup style and can exit the player by swiping down/up.

Support

iOS & Android

Installation

npm install react-native-youtube-popup-player

Installing dependencies

npm install react-native-vector-icons react-native-modal react-native-webview react-native-youtube-iframe-player

Note:

You need to make configuration on iOS and Android by following the instruction from the above dependencies libraries.

Usage

import YoutubePopupPlayer from 'react-native-youtube-popup-player';

//...
const [modalVisible, setModalVisible] = React.useState(false);

<TouchableOpacity onPress={() => setModalVisible(true)}>
    <Text>Play video</Text>
</TouchableOpacity>

<YoutubePopupPlayer
  videoUrl='https://www.youtube.com/watch?abcdefghi'
  modalVisible={modalVisible}
  messageLabelStyle={{fontSize: xLargeFontSize()}}
  closeModal={() => setModalVisible(false)}
/>

Properties

Basic

PropDefaultTypeOptionalDescription
videoUrlnullstringfalseThe use of the Youtube video
modalVisiblefalsebooleanfalseThe status to open or close the video player popup modal
locale'km'stringtrueThe locale of the warning message (options: km or en)
messageIconSize50numbertrueThe size of the warning icon when there is no internet or no video url
iconColor'#ffffff'stringtrueThe color of the icon of the warning message
isTabletfalsebooleantrueThe device is tablet or mobile
iframeHeight210numbertrueThe height of the iframe
loadingIndicatorColor'#ffffff'stringtrueThe color of the loading indicator
durationFontSize11numbertrueThe font size of the duration and play seconds
  • The default icon size of the warning icon will be 50dp and 45dp for the low pixel devices

Custom styles

PropDefaultTypeOptionalDescription
messageLabelStyle{...}styletrueStyle of the warning message label
closeButtonStyle{...}styletrueStyle of the close button when the warning message is showing

Methods

PropDefaultTypeOptionalDescription
closeModal{...}methodfalseMethod to close the video player popup modal

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.


Made with create-react-native-library

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago