Socket
Socket
Sign inDemoInstall

react-native-media-controls

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-media-controls

A sweet UI to control your video and audio components


Version published
Weekly downloads
3.8K
decreased by-7.34%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-media-controls

A sweet UI component to manipulate your media

mediac

##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##

PropTypeOptionalDefaultDescription
toolbarnodeYesAdd a custom view on the top of the controls
mainColorstringYesrgba(12, 83, 175, 0.9)Change custom color to the media controls
isLoadingboolYesfalseWhen is loading
isFullScreenboolYesfalseTo change icon state of fullscreen
progressnumberNoCurrent time of the media player
durationnumberNoTotal duration of the media
playerStatenumberNoCould be PLAYING, PAUSED or ENDED (take a look at constants section)
onFullScreenfunctionYesTriggered when the fullscreen button is pressed
onPausedfunctionNoTriggered when the play/pause button is pressed
onReplayfunctionYesTriggered when the replay button is pressed
onSeekfunctionNoTriggered 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

Keywords

FAQs

Package last updated on 15 Jul 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc