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-aliyun-short-video

v1.1.0

Published

A Short video for react native

Downloads

12

Readme

react-native-aliyun-video

短视频SDK需要 License

npm package npm downloads

TOC

Installation

Using npm:

npm install --save react-native-aliyun-short-video

or using yarn:

yarn add react-native-aliyun-short-video

Linking

Automatic

react-native link react-native-aliyun-short-video

(or using rnpm for versions of React Native < 0.27)

rnpm link react-native-aliyun-short-video

Manual

  • in android/app/build.gradle:
dependencies {
    ...
    compile "com.facebook.react:react-native:+"  // From node_modules
+   compile project(':react-native-aliyun-short-video')
    ...
}
  • in android/settings.gradle:
...
include ':app'
+ include ':react-native-aliyun-short-video'
+ project(':react-native-aliyun-short-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-aliyun-short-video/android')
...

With React Native 0.29+

  • in MainApplication.java:
...
+ import com.rnshortvideo.RNShortVideoPackage;

  public class MainApplication extends Application implements ReactApplication {
    ...

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
+         new RNShortVideoPackage()
      );
    }

    ...
  }

With older versions of React Native:

  • in MainActivity.java:
...
+ import com.rnshortvideo.RNShortVideoPackage;

  public class MainActivity extends ReactActivity {
    ...

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
+       new RNShortVideoPackage()
      );
    }
  }

In XCode, in the project navigator:

  • Right click Libraries
  • Add Files to [your project's name]
  • Go to node_modules/react-native-aliyun-short-video/ios
  • Add the RNShortVideo.xcodeproj file
  • Drag and drop the node_modules/react-native-aliyun-short-video/ios/AliyunSDK folder to your xcode project. (Make sure Copy items if needed IS ticked)

Click on project General tab

  • Under Embedded Binaries click + and add AliThirdparty.framework, AliyunPlayerSDK.framework, AliyunVideoSDK.framework, AliyunVodPlayerSDK.framework, QuCore-ThirdParty.framework
  • Under Linked Frameworks and Libraries click + and add RNShortVideo.framework, libz.tbd, libc++.tbd, libiconv.tbd, libresolv.tbd, ImageIO.framework, CoreMedia.framework, CoreVideo.framework, SystemConfiguration.framework, Photos.framework, OpenAL.framework, VideoToolbox.framework

Click on project Build Settings tab

  • Look for Enable Bitcode set to No
  • Look for Other Linker Flags and make sure it contain -ObjC
  • Look for Framework Search Paths and make sure it contain $(SRCROOT)/../node_modules/react-native-aliyun-short-video/ios/AliyunSDK
  • Look for Header Search Paths and make sure it contain $(SRCROOT)/../node_modules/react-native-aliyun-short-video/ios/RNShortVideo (Mark as recursive)

Click on project Build Phase tab

  • Under Copy Bundle Resources click + and add QPSDK.bundle and AliyunLanguageSource.bundle

In the project navigator:

  • Click Info.plist
  • Add the NSPhotoLibraryUsageDescription, NSMicrophoneUsageDescription, NSCameraUsageDescription and NSPhotoLibraryAddUsageDescriptionkeys to your Info.plist with strings describing why your app needs these permissions. Note: You will get a SIGABRT crash if you don't complete this step

Run your project (Cmd+R)

Usage

See the example

...
import RNShortVideo, { VideoView } from 'react-native-aliyun-short-video';
...

...
onRecord = () => {
  RNShortVideo.recordShortVideo()
    .then((path) => {
      this.setState({ path });
    })
    .catch((err) => {
      console.error(err);
    });
};
...

...
<View>
  {
    this.state.path ? (
      <VideoView
        fullscreen
        source={{ url: this.state.path }}
        poster="http://t.cn/RuWRYzv?1=1"
      />
    ) : null
  }
</View>
...

API

android short video

Troubleshooting

When installing or using react-native-aliyun-short-video, you may encounter the following problems:

  • in android/app/build.gradle:
android {
  ...
  packagingOptions {
    exclude('META-INF/LICENSE')
+    pickFirst "**/libgnustl_shared.so"
  }
  ...
}
  • in android/app/build.gradle:
...
repositories {
  flatDir {
-   dirs "libs"
+   dirs "libs", "$rootDir/../node_modules/react-native-aliyun-short-video/android/libs"
  }
}
...

TODO

  • [x] Compatible with iOS