React Native
A component for playing Kinescope videos in React Native on iOS and Android. It is based on react-native-video . Repository: kinescope/react-native-kinescope-video .
Installation
npm install @kinescope/react-native-kinescope-video react-native-video@6.4.2 @react-native-async-storage/async-storage --save
After installing the dependencies on iOS, run:
npx pod-install
Android repositories
Add jcenter() to allprojects.repositories in android/build.gradle if it is not already present:
allprojects {
repositories {
jcenter()
}
}
TypeScript error TS2786
If TypeScript reports that Video cannot be used as a JSX component, add the following to compilerOptions in tsconfig.json:
{
"compilerOptions": {
"paths": {
"react": ["./node_modules/@types/react"]
}
}
}
Props
The component accepts its own props and the react-native-video props .
| Prop | Type | Description |
|---|---|---|
videoId | string | Video ID from app.kinescope.io (required) |
preload | boolean | Preload the video |
externalId | string | External ID for analytics |
quality | quality type | Playback quality |
autoSeekChangeQuality | boolean | Defaults to true; iOS only |
drmAuthToken | string | DRM token |
referer | string | Referer header |
posterResizeMode | ImageResizeMode | Poster resize mode |
Events
The component supports its own events and the react-native-video events .
| Event | Data |
|---|---|
onManifestLoadStart | — |
onManifestLoad | manifest: ManifestEventLoadTypes |
onManifestError | error: unknown |