1.0.2 • Published 11 months ago

react-native-video-release v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

react-native-video-release

Warning: This package use for react native typescript templates (.tsx) only. This package for personal use.

1. Installing

using yarn:

yarn add react-native-video-release

2. Install dependencies

Using yarn:

yarn add react-native-video @react-native-community/slider @openspacelabs/react-native-zoomable-view react-native-paper react-native-vector-icons @react-native-async-storage/async-storage react-native-keep-awake react-native-orientation-locker react-native-fullscreen-chz @react-navigation/native

3. Install types for dependencies

Using yarn:

yarn add @types/react-native-video @types/react-native-vector-icons @types/react-native-keep-awake

4. IOS Install dependencies

Using npx:

npx pod-install

5. Please follow document of dependencies

react-native-video-release was custom from react-native-video package by Brent Vatne.

Overview

This package support current play history too. Now we're not support with cache storage but we work with video buffing quality (Android only). Enjoy with our customization, get new experience and fast performance from now. Thanks.

Example Usages

For VideoPlayer can use multiple videos

import React from "react";
import { View,Text } from "react-native";
import {VideoPlayer, useFullScreen } from 'react-native-video-release';

const Example = () => {
  const { getFullScreen } = useFullScreen();

  return (
    <View style={{ flex: 1 }}>
        <VideoPlayer
            navigationRef={navigationRef}
            source={[
              {
                title: 'This is my video 1',
                url: 'https://www.w3schools.com/html/mov_bbb.mp4',
                },
              },
              {
                title: 'This is my video 2',
                url: 'https://www.w3schools.com/html/mov_bbb.mp4',
                },
              },
            ]}
        />

         {/* check full screen (When full screen all content will be hidden)  */}
        {!getFullScreen && (
            <Text>This is content</Text>
        )}
    </View>
  );
};
export default Example;

For VideoMiniPlayer can use only one video

import React from "react";
import { View,Text } from "react-native";
import {VideoMiniPlayer, useFullScreen } from 'react-native-video-release';

const Example = () => {
  const { getFullScreen } = useFullScreen();

  return (
    <View style={{ flex: 1 }}>
        <VideoMiniPlayer
            navigationRef={navigationRef}
            source={{
                title: 'This is my video 1',
                url: 'https://www.w3schools.com/html/mov_bbb.mp4',
                },
              }}
        />

         {/* check full screen (When full screen all content will be hidden)  */}
        {!getFullScreen && (
          <Text>This is content</Text>
        )}
    </View>
  );
};
export default Example;

VideoPlayerProps

PropsTypeDescriptionDefault
navigationRefrefThis navigation use for go back with React Navigationundefined
pauseOnNavigatebooleanpause video on navigate to new screentrue
sourceVideoItem[]Video items you want to play (Allow multiple videos)required
initialIndexnumberWhich video you want to play0
optionsOptionPropsShow control on your video{}
disablePanOnInitialZoombooleanDisable on video zoom or not (it effect when full screen)false
minimumTrackTintColorstringColor code of minimum track color'#f05a28'
thumbTintColorstringColor code of thumb color'#f05a28'
backgroundColorstringBackground color of container and video'#1e1a1d'
titleColorstringTitle color of video'#f6f6f6'
playbackHistorybooleanIf you want to playback history of your videofalse
videoHeightnumberYou can set height of your video (only work on portrait)height of 1280 x 720 Ratio
videoWidthnumberYou can set width of your video (only work on portrait)full width
videoHeightRationumberYou can set height ratio of your video (only work on portrait)720 Ratio
videoWidthRationumberYou can set width ratio of your video (only work on portrait)1280 Ratio
VideoPropertyInherited VideoProperty props...You can use property from react-native-video also timeany

VideoMiniPlayerProps

PropsTypeDescriptionDefault
navigationRefrefThis navigation use for go back with React Navigationundefined
pauseOnNavigatebooleanpause video on navigate to new screentrue
sourceVideoItemVideo item you want to play (Only one video)required
optionsOptionPropsShow control on your video{}
minimumTrackTintColorstringColor code of minimum track color'#f05a28'
thumbTintColorstringColor code of thumb color'#f05a28'
backgroundColorstringBackground color of container and video'#1e1a1d'
titleColorstringTitle color of video'#f6f6f6'
playbackHistorybooleanIf you want to playback history of your videofalse
videoHeightnumberYou can set height of your video (only work on portrait)height of 1280 x 720 Ratio
videoWidthnumberYou can set width of your video (only work on portrait)full width
videoHeightRationumberYou can set height ratio of your video (only work on portrait)720 Ratio
videoWidthRationumberYou can set width ratio of your video (only work on portrait)1280 Ratio
VideoPropertyInherited VideoProperty props...You can use property from react-native-video also timeany

VideoItemProps

PropsTypeDescriptionDefault
titlestringTitle of video""
urlstringUrl of your video""
thumbnail{ url : string }Thumbnail Image url of your video{ url : "" }

OptionsProps

PropsTypeDescriptionDefault
showFullScreenButtonbooleanShow full screen buttontrue
showVolumeButtonbooleanShow volume buttontrue
showResizeButtonbooleanShow resize buttontrue
showProgressBarbooleanShow progress bar durationtrue
showDurationbooleanShow duration timetrue
showTitlebooleanShow title of videotrue
showPosterbooleanShow poster before load videotrue
showBackButtonbooleanShow back button (Portrait)false
showNextButtonbooleanShow next button (VideoPlayer only)true
showPreviousButtonbooleanShow previous button (VideoPlayer only)true
showReplayNextButtonbooleanShow replay next button (VideoPlayer only)true
showReplayPreviousButtonbooleanShow replay previous button (VideoPlayer only)true
showSpeedButtonbooleanShow speed button (VideoPlayer only)true
showSettingButtonbooleanShow setting button (VideoPlayer only)true
showRepeatButtonbooleanShow repeat button (VideoPlayer only)true

Hooks for layout

useFullScreen()

Use inside your body component only

import React from "react";
import { View, Text } from "react-native";
import { useFullScreen } from "react-native-video-release";

const Example = () => {
  const { width, height, screen, getFullScreen } = useFullScreen();

  return (
    <View style={{ flex: 1 }}>
      <Text>This is full screen: {getFullScreen}</Text>
    </View>
  );
};
export default Example;
  • width (number): width of screen without notch header or footer
  • height (number): height of screen without notch header or footer
  • screen { width , height } (number): screen with notch header or footer
  • getFullScreen (boolean): check your screen is full screen or not

License

This project is licensed under the MIT License.

Contact Me