JSPM

slice-video-player

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q11943F
  • License ISC

SliceVideoPlayer is a React Native component that allows you to play video segments with customizable start and end times. It is built on top of the `expo-av` library and provides features such as looping and precise time-based slicing of video content.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (slice-video-player) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    SliceVideoPlayer

    A React Native component for playing videos with customizable start and end times.

    Installation

    npm install slice-video-player
    

    Usage

    Here is an example of how to use the SliceVideoPlayer component in your React Native application:

    import React from "react";
    import { View } from "react-native";
    import SliceVideoPlayer from "slice-video-player";
    
    function App() {
      return (
        <View style={{ marginTop: 200, borderWidth: 2 }}>
          <SliceVideoPlayer
            source={{
              uri: "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
            }}
            style={{ height: 200 }}
            shouldPlay={true}
            start={0} // Start time in milliseconds
            end={10000} // End time in milliseconds (10 seconds)
          />
        </View>
      );
    }
    
    export default App;

    Props

    • source: The source of the video. It should be an object with a uri property.
    • start: The start time of the video segment in milliseconds. Default is 0.
    • end: The end time of the video segment in milliseconds. If not specified, it defaults to the duration of the video.
    • loop: Boolean indicating whether the video should loop between start and end. Default is false.
    • shouldPlay: Boolean indicating whether the video should start playing automatically. Default is false.
    • useNativeControls: Boolean indicating whether to show the native playback controls. Default is true.

    License

    This project is licensed under the ISC License.