@tecnavia/react-native-dailymotion-sdk (2.0.0)
Published 2025-01-08 12:27:36 +00:00 by naquilini
Installation
@tecnavia:registry=
npm install @tecnavia/react-native-dailymotion-sdk@2.0.0
"@tecnavia/react-native-dailymotion-sdk": "2.0.0"
About this package
react-native-dailymotion-sdk
DailyMotion SDK official guide
Getting started
$ npm install https://ussvc01.newsmemory.com:3000/tecnavia/react-native-dailymotion-sdk.git#tag --save
Usage
import DailyMotionPlayer from "@tecnavia/react-native-dailymotion-sdk";
render(){
return (
<DailyMotionPlayer
ref={this._videoRef}
playerData={{ video: "x84sh87", autoplay: false }}
style={{ flex: 1, width: "100%" }}
onPlayerEvent={(payload) => console.debug(payload)}
onStart={(payload) => console.debug("Start")}
onPause={(payload) => console.debug("Paused")}
onSeeked={(payload) => console.debug("Seeked")}
onEnd={(payload) => console.debug("End")}
/>
);
}
Props
Prop | Type | Description |
---|---|---|
playerData | object |
player payload, see params |
onPlayerEvent | function |
generic event callback |
onPlayerError | function |
error event callback |
onStart | function |
called when start is pressed |
onPause | function |
called when pause is pressed |
onWaiting | function |
called after start, only Android |
onPlay | function |
called when video is ready and start to play |
onPlaying | function |
called after play |
onSeeking | function |
called when seek function is called and video is going to correct seconds |
onSeeked | function |
called when seek is completed |
onEnd | function |
called when video is finish |
Methods
Method | Params | Description |
---|---|---|
play | start video | |
pause | pause video | |
mute | mute video player | |
unmute | unmute video player | |
seek | number |
set video player postion, pass number of seconds |
release | release video player, only Android |
Dependencies
Development Dependencies
ID | Version |
---|---|
lefthook | ^1.3.3 |
react-native-builder-bob | ^0.20.0 |
Peer Dependencies
ID | Version |
---|---|
prop-types | * |
react | * |
react-native | * |
Keywords
react-native