1.2.7 • Published 4 years ago

react-native-soundcloud-waveform-typescript v1.2.7

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

Creating a simple transform to the SoundCloud's waveforms from the image url for typescript

Show Cases

You can check here for showcase

Getting Started

Installation

$ npm i react-native-soundcloud-waveform-typescript --save

Basic Usage

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View
} from 'react-native';

import SoundCloudWaveform from 'react-native-soundcloud-waveform-typescript'

...
setTime = (time) => {
  
}

render() {
   <View style={Styles.progressContainer}>
      <SoundCloudWaveform
        waveformUrl={track.waveform_url}
        percentPlayable={playableTime}
        percentPlayed={currentTime)}
        setTime={this.setTime}  
      />
   </View>
}

Properties

PropDefaultTypeDescription
waveformUrlrequiredstringThe png format waveform_url object of the SoundCloud's track
setTimerequiredfuncCallback function to update the current time. (returns progress in between 0 - 100)
percentPlayedrequirednumberThe current time of the track (progress in between 0 - 1)
percentPlayable0numberThe percentage of the track that has been buffered (progress in between 0 - 1)
height50numberThe height of the waveform
widthscreenWidthnumberThe width of the waveform
active#FF1844stringActive Color of the waveform
activeInverse#4F1224stringActive Color of the inverse waveform
activePlayable#1b1b26stringActive buffered track color of the waveform
activePlayableInverse#131116stringActive buffered track color of the inverse waveform
inactive#424056stringInactive color of the waveform
inactiveInverse#1C1A27stringInactive color of the inverse waveform

Contribution

Questions

Feel free to contact me or create an issue