Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

react-native-af-video-player

> 编程语言
Open source

react-native-af-video-player A customisable React Native video player for Android and IOS Features Fullscreen support for Android and iOS! …

378 stars0 likes0 views
WebsiteGitHub

About

react-native-af-video-player A customisable React Native video player for Android and IOS Features Fullscreen support for Android and iOS! …

react-native-af-video-player

A customisable React Native video player for Android and IOS

Features

  • Fullscreen support for Android and iOS!
  • Works with react-navigation
  • Optional action button for custom use
  • Add your own logo and/or placeholder
  • Customise theme

Install

npm i -S react-native-af-video-player

Then link

react-native link react-native-video
react-native link react-native-keep-awake
react-native link react-native-vector-icons
react-native link react-native-orientation
react-native link react-native-linear-gradient

Simple Usage

import React from 'react'
import { AppRegistry, StyleSheet, View } from 'react-native'
import Video from 'react-native-af-video-player'

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center'
  }
})

const url = 'https://your-url.com/video.mp4'

class VideoExample extends React.Component {

  render() {
    return (
      
        
      
    )
  }
}

AppRegistry.registerComponent('VideoExample', () => VideoExample)

Props

Prop Type Required Default Description
url string, number Yes A URL string (or number for local) is required.
autoPlay bool No false Autoplays the video as soon as it's loaded
loop bool No false Allows the video to continuously loop
title string No '' Adds a title of your video at the top of the player
placeholder string No undefined Adds an image placeholder while it's loading and stopped at the beginning
logo string No undefined Adds an image logo at the top left corner of the video
theme string No 'white' Adds an optional theme colour to the players controls
hideFullScreenControl bool No false This hides the full screen control
style number, object No {} Apply styles directly to the Video player (ignored in fullscreen mode)
resizeMode string No 'contain' Fills the whole screen at aspect ratio. contain, cover etc
rotateToFullScreen bool No false Tapping the fullscreen button will rotate the screen. Also rotating the screen will automatically switch to fullscreen mode
fullScreenOnly bool No false This will play only in fullscreen mode
inlineOnly bool No false This hides the fullscreen button and only plays the video in inline mode
playInBackground bool No false Audio continues to play when app enters background.
playWhenInactive bool No false [iOS] Video continues to play when control or notification center are shown.
rate number No 1 Adjusts the speed of the video. 0 = stopped, 1.0 = normal
volume number No 1 Adjusts the volume of the video. 0 = mute, 1.0 = full volume
onMorePress function No undefined Adds an action button at the top right of the player. Use this callback function for your own use. e.g share link
onFullScreen function No (value) => {} Returns the fullscreen status whenever it toggles. Useful for situations like react navigation.
onTimedMetadata function No undefined Callback when the stream receives metadata
scrollBounce bool No false Enables the bounce effect for the ScrollView
lockPortraitOnFsExit bool No false Keep Portrait mode locked after Exiting from Fullscreen mode
lockRatio number No undefined Force a specific ratio to the Video player. e.g. lockRatio={16 / 9}
onLoad function No (data) => {} Returns data once video is loaded
onProgress function No (progress) => {} Returns progress data
onEnd function No () => {} Invoked when video finishes playing
onError function No (error) => {} Returns an error message argument
onPlay function No (playing) => {} Returns a boolean during playback
error boolean, object No true Pass in an object to Alert. See https://facebook.github.io/react-native/docs/alert.html
theme object No all white Pass in an object to theme. (See example below to see the full list of available settings)
controlDuration number No 3 Set the visibility time of the pause button and the progress bar after the video was started

Referencing

To toggle play/pause manually, you can do it like so:

…

Issues

Container

Avoid adding alignItems: 'center' to the container, it can cause fullscreen mode to disappear :D

React Navigation

If you’re using react-navigation you need to manually hide the headers / tab bars to take advantage of fullscreen videos.

Example

…

http vs https

For your sanity you should use https especially if you’re planning to use this for iOS. Using http will not work due to App Transport Security Settings will result in AppStore rejection.

Fullscreen videos inside a ScrollView

If you need the video inside a ScrollView, use our ScrollView instead: The reason for this is because we need to hide all of it's content due to ScrollView styling challenges when enabling fullscreen mode. We wouldn't want you deal with that headache, instead let this component handle it :) You can also apply styles to the video by wrapping our Container around it. Note: wrapping the video with your own element can cause fullscreen defects. Also having multiple videos in a ScrollView isn't perfect, so use at your own risk.

Example


  import Video, { ScrollView, Container } from 'react-native-af-video-player'

  const styles = StyleSheet.create({
    container: {
      flex: 1
    },
    videoContainer: {
      margin: 10
    }
  })

  class VideoInScrollView extends React.Component {

    render() {
      return (
        

          Some content above

          
            
          

          {/* Or use without the Container */}
          

          Some content below

        
      )
    }
  }

To Do

  • Option to use custom icons
  • Support Immersive mode for Android
  • improve multiple videos fullscreen support within a ScrollView
  • investigate subtitle support
  • Improve scrubber controls for iOS
  • Provide fullscreen support within a ScrollView
  • Customise specific components for better theming

MIT Licensed

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言