api.video React Native Player
api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.
Table of contents
Project description
React Native video player to play vod and lives from api.video
Getting started
Installation
or
Note: if you are on iOS, you will need this extra step: Install the native dependencies with Cocoapods
&&
Limitations
For the moment, this player component is based on the api.video's javascript player (displayed in a react-native-webview), and therefore it suffers from the same limitation as every players displayed in browsers.
We plan to base the player component on natives video players in a further release to avoid this kind of limitation. Stay tuned!
Code sample
import React from 'react';
import ApiVideoPlayer from '@api.video/react-native-player';
const App = () =>
<ApiVideoPlayer videoId="vi2G6Qr8ZVE67dWLNymk7qbc" />
export default App;
Documentation
Props & Methods
// props:
;
: void;
: void;
time: number : void;
time: number : void;
rate: number : void;
volume: number : void;
Using methods
import React, { Component } from 'react';
import ApiVideoPlayer from '@api.video/react-native-player';
import { Button, View } from 'react-native';
export default class App extends Component {
render() {
return (
<View style={{ flex: 1 }}>
<ApiVideoPlayer
ref={(r) => (this.player = r)}
muted={true}
videoId="vi2G6Qr8ZVE67dWLNymk7qbc" />
<Button onPress={() => this.player.play()} title="Play" />
<Button onPress={() => this.player.pause()} title="Pause" />
</View>
)
}
}
FAQ
If you have any questions, ask us here: https://community.api.video . Or use Issues.
Was this page helpful?