karuna-label-testing
v1.0.11
Published
This is the sample react native Label testing.
Maintainers
Readme
DotStudioPro
This library is designed to support custom video player controls in React Native for both iOS and Android.
Features
- Fullscreen support for Android and iOS.
- Portrait and Landscape mode.
- Customize control layout.
- Customize control theme.
Install
$ yarn add dspreactnativemodulesdkOR
$ npm install dspreactnativemodulesdkFor Ios
cd ios
pod installUsage
// Load the module
import {SPLTNativePlayer} from 'DSPReactNativeModuleSDK';
<SPLTNativePlayer
videoUrl={'https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8'}
seekDuration={15}
hideBackButton={true}
hideFullscreenButton={true}
onBack={this.onBackPressed}
onAnalyticsEvent={this.onAnalyticsEvent}
onFinishPlayingContentAndAd={this.onFinishPlayingContentAndAd}
onToggleFullscreen={this.onToggleFullscreen}
/>Props
| Props | Type | Default | Required | Platform | Description |
| :--- | :---: | :---: |:---: | :---: | :--- |
| videoUrl | string| | true | All | Url of the video to be played.
| vmapUrl In progress | string| | false | All | Urls to fetch the Ads during video playback.
| videoTitle In progress | string| | false | All | Title of the video.
| seekDuration | number| 10 | false | All | Forward/Rewind player video to the given time.
| hideBackButton | boolean| false | false | All | Hide player back button if it's true.
| hideFullscreenButton | boolean| false | false | Android | Hide player fullscreen button if it's true.
Callbacks Method
| Method | Props | Description
| :--- | :---: | :----
|onBack | () => {} | This is triggered during back or close action of the player.
|onAnalyticsEvent | (analyticsEvent) => {} | This can be used to trigger Analytics event for the media player such first play, pause, play ,buffering, seeking, etc.
|onToggleFullscreen | (event) => {} | This is triggered when player enters/exits full screen mode.
|onFinishPlayingContentAndAd | () => {} | This is triggered when player finishes playing a video or an ad.
Todos
- Add loading Indicator
- Make player UI customizable.
- Make seekbar UI customizable.
- Handling Analytics client.
