Skip to content
This repository has been archived by the owner on Feb 25, 2021. It is now read-only.

ApollosProject/react-native-apollos-player

Repository files navigation

react-native-apollos-player

An opinionated media player for react-native apps from The Apollos Project

Installation

npm install react-native-apollos-player

Usage

todo

Architecture

  • We still render player at root-level
  • Need to figure out how to display above r-n modals / everything

On iOS we can't render on top of modals, but we can move the video around On android we can still render on top of modals, but we cna't move the video around

Exposed Components:

<ApollosPlayerProvider />

<VideoPreviewView />
<VideoPreviewMiniIOS />

const { playNow, setIsPlaying, seek } = usePlayer();
const { setOverlayInsets, setPresentationMode, setOverlayIsVisible } = usePlayerPresentation();
  <VideoPreviewView
    source={}
  />

iOS: preview plays the specified media, as long as something else isn't already playing. on interaction, opens the media in full-screen Presentation Android: preview plays the specified media. On interaction, opens the media in full-screen Presentation


  <VideoPreviewMiniIOS
    source={}
    isVisible
  />

iOS: preview plays the specified media, unless something else is playing - in which case, it will play show media instead. Android: does not render. this gets picked up by the root-level player


Internal (these are likely over-ride-able props on Provider)

  • VideoTextureView
  • MiniPresentation
  • FullScreenPresentation

Contributing

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

License

MIT