Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

expo-video

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expo-video

Video component for Expo/React Native

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19K
increased by3.75%
Maintainers
1
Weekly downloads
 
Created
Source

Instagram-like stories for Expo React native

Note: This library is under development. Suggestions and PRs are welcomed and appreciated!

Install

yarn add rn-stories

Usage

Head to examples folder for more examples

import React from 'react';
import { SafeAreaView } from 'react-native';
import Stories from 'rn-stories';

const data = [
  {
    type: 'img',
    source:
      'https://images.unsplash.com/photo-1586039001882-5bd1bab0a9ef?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=668&q=80',
    duration: 10000,
    action: { url: 'https://foundingbird.com', label: 'Go to Foundingbird' }
  },
  {
    type: 'video',
    source:
      'https://foundingbird-blog.cdn.prismic.io/foundingbird-blog/2dc27fe2-0552-48b0-9e4b-16044a28d039_daddariosa.mp4',
    duration: null,
    action: { url: 'https://google.com', label: 'Sign up' }
  },
  .....
];

export default function App() {
  const onStoryEnd = () => {
    console.log('Stories ended')
  }

  return (
    <SafeAreaView>
      <Stories stories={data} onStoryEnd={onStoryEnd} />
    </SafeAreaView>
  );
}

Props

PropDescriptionTypeDefault
storiesArray of StoryArrayRequired
onStoryEndCallback function to be called after all or last item in stories array reaches endFunctionOptional

Types

Story

PropDescriptionTypeDefault
typeType of storyEnum video or imgRequired
sourceURL of video or imgStringRequired
durationDuration of how long an image slide should be shown in millisencondsNumberRequired for img only
actionSwipe up actionArray of {label: string, url: string}Optional

Todo

  • Get rid of react-native-eva-icons and use a sinlge icon
  • Add a Close button/icon
  • Multiple stories
  • Add an option to pass custom Footer
  • Add an option to pass custom Indicators
  • Add an option to change Indicators' style and look
  • Make a separate package that uses react-native-video

Keywords

FAQs

Package last updated on 11 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc