All Projects → ihmpavel → expo-video-player

ihmpavel / expo-video-player

Licence: MIT license
Customizable Video Player controls for Expo

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to expo-video-player

KingPlayer
🎬 一个专注于 Android 视频播放器的基础库,无缝切换内核。(IjkPlayer、ExoPlayer、VlcPlayer、MediaPlayer)
Stars: ✭ 35 (-79.89%)
Mutual labels:  player, videoplayer
Imusic
一个集视频播放器、音乐播放器封装库于一身的iMusic工程
Stars: ✭ 228 (+31.03%)
Mutual labels:  player, videoplayer
Videoplayer
📽 A video player for SwiftUI, support for caching, preload and custom control view. SwiftUI 视频播放器,支持边下边播、预加载、自定义控制层
Stars: ✭ 212 (+21.84%)
Mutual labels:  player, videoplayer
Sjvideoplayer
iOS VideoPlayer MediaPlayer video player media player 短视频播放器 可接入 ijkplayer aliplayer alivodplayer plplayer
Stars: ✭ 2,066 (+1087.36%)
Mutual labels:  player, videoplayer
Mkvideoplayer
MKVideoPlayer library is a video player have some basic features that need to develop an video player application in android studio
Stars: ✭ 54 (-68.97%)
Mutual labels:  player, videoplayer
Zftplayer
iOS平台下基于IJKplayer封装的视频播放器,主要适用于视频点播。针对视频格式,前后台切换,内存管理控件的层级分离做了相应优化
Stars: ✭ 273 (+56.9%)
Mutual labels:  player, videoplayer
VideoPlayerBot
An Telegram Bot By @AsmSafone To Stream Videos in Telegram Voice Chat. This is Also The Source Code of The Bot Which is Being Used In Our Support Group! ❤️
Stars: ✭ 187 (+7.47%)
Mutual labels:  player, videoplayer
Xgplayer
A HTML5 video player with a parser that saves traffic
Stars: ✭ 4,792 (+2654.02%)
Mutual labels:  player, videoplayer
Sbplayerclient
支持全格式的mac版视频播放器
Stars: ✭ 110 (-36.78%)
Mutual labels:  player, videoplayer
Magicalexoplayer
The Easiest Way To Play/Stream Video And Audio Using Google ExoPlayer In Your Android Application
Stars: ✭ 171 (-1.72%)
Mutual labels:  player, videoplayer
Flvplayer
🍭 FlvPlayer.js is a JavaScript player for decode flv to the canvas
Stars: ✭ 210 (+20.69%)
Mutual labels:  player
Shikwasa
An audio player born for podcast
Stars: ✭ 216 (+24.14%)
Mutual labels:  player
Swift Radio Pro
Professional Radio Station App for iOS!
Stars: ✭ 2,644 (+1419.54%)
Mutual labels:  player
Aos Avp
NOVA opeN sOurce Video plAyer: main repository to build them all
Stars: ✭ 229 (+31.61%)
Mutual labels:  player
Ffplayer
a video player based on ffmpeg for win32 and android platform.
Stars: ✭ 210 (+20.69%)
Mutual labels:  player
Mojs Player
GUI player to control your animations
Stars: ✭ 243 (+39.66%)
Mutual labels:  player
Jcplayer
🎵 A simple audio player for Android applications.
Stars: ✭ 209 (+20.11%)
Mutual labels:  player
Pathephone Desktop
Distributed audio player
Stars: ✭ 240 (+37.93%)
Mutual labels:  player
Fanplayer
A portable video player based on ffmpeg for windows and android platform.
Stars: ✭ 229 (+31.61%)
Mutual labels:  player
Rtsp.player.android
RTSP player for Android / IP camera viewer
Stars: ✭ 199 (+14.37%)
Mutual labels:  player

Basic info

Video wrappper component for Expo ecosystem built on top of the Expo's Video component. This library basically adds UI controls like in the YouTube app, which gives you the opportunity to play, pause, replay, change video position and a lot of styling options.

The package has a lot of configuration options to fit all your needs. Only source in videoProps: { source: {} } is required. Check the Props table below.

For compatibility information, scroll down to Compatibility. The FAQ is here

⚠️ Updating from version 1.x to 2.x

If you are updating from version 1.x to 2.x, there are some breaking changes in the API. Please visit Migration guide to version 2 to make your transition as easy as possible. In version 2.x @react-native-community/netinfo has been removed.

Installation

  • Install Video Player component typing into terminal yarn add expo-video-player or npm install expo-video-player
  • You also need expo-av and @react-native-community/slider. Install them with expo-cli (expo install expo-av @react-native-community/slider)

Usage

The showcase of some of the possibilities you can create is in the folder example-app. There is Fullscreen, ref, local file, custom icons, styling...

Minimal code to make VideoPlayer working

import { ResizeMode } from 'expo-av'
import VideoPlayer from 'expo-video-player'

<VideoPlayer
  videoProps={{
    shouldPlay: true,
    resizeMode: ResizeMode.CONTAIN,
    // ❗ source is required https://docs.expo.io/versions/latest/sdk/video/#props
    source: {
      uri: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
    },
  }}
/>

Props

For default prop values, please visit /lib/props.tsx

Property Type Description
videoProps VideoProps At least source is required
errorCallback (error: ErrorType) => void Function which is fired when an error occurs
playbackCallback (status: AVPlaybackStatus) => void Function which is fired every time onPlaybackStatusUpdate occurs
defaultControlsVisible boolean Show controls on darker overlay when video starts playing. Default is false
timeVisible boolean Show current time and final length in the bottom. Default is true
textStyle TextStyle Object containing <Text /> styling
slider { visible?: boolean } & SliderProps Object containing any of @react-native-community/slider props. Your styling may break default layout. Also hide slider by providing visible: false prop. You are unable to overwrite ref, value, onSlidingStart and onSlidingComplete
activityIndicator ActivityIndicatorProps Any values from ActivityIndicator
animation { fadeInDuration?: number, fadeOutDuration?: number } Duration of animations in milliseconds
style { width?: number, height?: number, videoBackgroundColor?: ColorValue, controlsBackgroundColor?: ColorValue } Basic styling of <VideoPlayer />
icon { size?: number, color?: ColorValue, style?: TextStyle, pause?: JSX.Element, play?: JSX.Element, replay?: JSX.Element, fullscreen?: JSX.Element, exitFullscreen?: JSX.Element, mute?: JSX.Element, exitMute?: JSX.Element } Icon styling. Check more in the example-app
fullscreen { enterFullscreen?: () => void, exitFullscreen?: () => void, inFullscreen?: boolean, visible?: boolean } Usage of Fullscreen mode is in the example-app
autoHidePlayer boolean Prevent player from hiding after certain time, by setting it to false you need to tap the screen again to hide the player. Default is true
header ReactNode Render header component same as in YouTube app. Default undefined
mute { enterMute?: () => void, exitMute?: () => void, isMute?: boolean, visible?: boolean } Usage of mute mode is in the example-app

Compatibility

Library version Expo SDK version
2.1.x >= SDK 45
2.x.x >= SDK 38
1.6.x >= SDK 38
1.5.x >= SDK 34
1.4.x >= SDK 34
1.3.x >= SDK 34
1.2.x >= SDK 33
1.1.x >= SDK 32
1.x.x >= SDK 32

CHANGELOG

Changelog added in version 1.3.0 Read CHANGELOG.md

FAQ

  • How to make fullscreen working? Please visit example-app
  • How to use ref? Please visit example-app
  • What to do if I disconnect from the internet while playing video from remote source? You need to stop/pause playback yourself. I highly recommend using @react-native-community/netinfo for this kind of stuff
  • Do you support subtitles? Have a look at #1
  • Can I support you? Yes, please Become a sponsor

TODO

  • make tests

Some articles

More packages from me

  • all-iso-language-codes - List of ISO 639-1, 639-2T, 639-2B and 639-3 codes with translations in all available languages
  • expo-video-player - Customizable Video Player controls for Expo
  • free-email-domains-list - Fresh list of all free email domain providers. Can be used to check if an email address belongs to a company. Updated weekly
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].