Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
react-native-media-controls
Advanced tools
A sweet UI component to manipulate your media
##Installation
npm i react-native-media-controls --save
##Usage##
// Require the module
import {MediaControls, PLAYER_STATE} from 'react-native-media-controls';
render() {
return (
<View style={styles.container}>
<Video
ref="videoPlayer"
style={styles.mediaPlayer}
resizeMode="cover"
source={{uri: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'}}
volume={0.0}
paused={this.state.paused}
onEnd={this.onEnd}
onLoad={this.onLoad}
onLoadStart={this.onLoadStart}
onProgress={this.onProgress}
/>
<MediaControls
toolbar={this.renderToolbar()}
playerState={this.state.playerState}
isLoading={this.state.isLoading}
progress={this.state.currentTime}
duration={this.state.duration}
onPaused={this.onPaused}
onSeek={this.onSeek}
onReplay={this.onReplay}
/>
</View>
);
}
##Props##
Prop | Type | Optional | Default | Description |
---|---|---|---|---|
toolbar | node | Yes | Add a custom view on the top of the controls | |
mainColor | string | Yes | rgba(12, 83, 175, 0.9) | Change custom color to the media controls |
isLoading | bool | Yes | false | When is loading |
isFullScreen | bool | Yes | false | To change icon state of fullscreen |
progress | number | No | Current time of the media player | |
duration | number | No | Total duration of the media | |
playerState | number | No | Could be PLAYING, PAUSED or ENDED (take a look at constants section) | |
onFullScreen | function | Yes | Triggered when the fullscreen button is pressed | |
onPaused | function | No | Triggered when the play/pause button is pressed | |
onReplay | function | Yes | Triggered when the replay button is pressed | |
onSeek | function | No | Triggered when the user is interacting with the slider |
##Constants##
PLAYING,
PAUSED,
ENDED,
##Example## Refer to the example folder to find an implementation of this project
FAQs
A sweet UI component to manipulate your media. Strongly typed using Typescript.
The npm package react-native-media-controls receives a total of 3,213 weekly downloads. As such, react-native-media-controls popularity was classified as popular.
We found that react-native-media-controls demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.