npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-easy-video

v1.1.4

Published

A UI component that wraps react-native-video

Downloads

33

Readme

react-native-easy-video

Dependence:

  • react-native-video
  • react-native-orientation-locker

react-native-orientation-locker

yarn add react-native-orientation-locker
// or npm i react-native-orientation-locker


// RN 0.59 and and below
react-native link react-native-orientation-locker

Configuration:

iOS
Add the following to your project's AppDelegate.m:

+#import "Orientation.h"

@implementation AppDelegate

// ...

+- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
+  return [Orientation getOrientation];
+}

@end

react-native-video

Version 5.x recommends react-native >= 0.60.0 for Android 64bit builds and Android X support.

Version 4.x requires react-native >= 0.57.0

yarn add react-native-video
// or npm i react-native-video

react-native link react-native-video

notice

If you want to use ExoPlayer player in Android

[project]/android/settings.gradle:

// Default player
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android')
// ExoPlayer More extensive support, such as ts in m3u8
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')

The runtime UI

Android

iOS

example

https://github.com/Grewer/react-native-easy-video/tree/master/example

Usage

download

yarn add react-native-easy-video

// or npm i react-native-easy-video
import VideoView from 'react-native-easy-video'

<VideoView
    title="file name video.mp4"
    source={source}
    height={300}
    goBack={() => {
        alert('goBack')
    }}
/>

https://github.com/Grewer/react-native-easy-video/blob/master/example/App.js

Props

export interface VideoPropsType {
  /**
   * 正常播放下回退按钮的操作
   */
  goBack(): void

  /**
   * 头部右侧渲染
   * */
  renderMenu?: (isPortrait: boolean) => React.ReactNode

  /**
   *  文件名
   * */
  title: string

  /**
   *  文件源
   *  如果文件路径有中文记得使用 encodeURI
   *  如果需要播放 m3u8 ,需要添加 type:'m3u8'
   *  如果 uri 是一个本地文件地址,那暂不支持播放
   * */
  source: { uri?: string; type?: string; headers?: { [key: string]: any } } | number

  /**
   *  加载错误时的 callback
   * */
  onError?(error: {
    error: {
      '': string
      errorString: string
    }
  }): void

  /**
   * 默认倍数的显示
   * @default 1x
   * */
  defaultRateLabel?: ''

  /**
   * 视频缩放模式
   * @default contain
   * */
  resizeMode?: 'stretch' | 'contain' | 'cover' | 'none'

  /**
   * 视频高度
   * */
  height?: number
  
    /**
   * 自动播放
   * @default false
   * 默认不自动播放
   */
  autoPlay?: boolean
  
  /**
   * 是否循环播放
   * 默认 false
   * 默认不循环播放
   */
  loop?: boolean
}

Future features

  • [ ] volume
  • [x] mode2(Has a custom height)