![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
react-native-media-controls
Advanced tools
A sweet UI component to manipulate your media. Strongly typed using Typescript.
A sweet UI component to manipulate your media. Strongly typed using Typescript.
// install package
yarn add react-native-media-controls
// install react-native-slider, as this is a dependency of this library
yarn add react-native-slider
// Require the module
import MediaControls, { PLAYER_STATES } from 'react-native-media-controls';
const App = () => {
const [currentTime, setCurrentTime] = useState(0);
const [duration, setDuration] = useState(0);
const [isFullScreen, setIsFullScreen] = useState(false);
const [isLoading, setIsLoading] = useState(true);
const [paused, setPaused] = useState(false);
const [playerState, setPlayerState] = useState(PLAYER_STATES.PLAYING);
// ... ... ...
// ... ... ...
return (
<View style={styles.container}>
<Video
{...videoProps}
/>
<MediaControls
isFullScreen={isFullScreen}
duration={duration}
isLoading={isLoading}
mainColor="orange"
onFullScreen={noop}
onPaused={onPaused}
onReplay={onReplay}
onSeek={onSeek}
onSeeking={onSeeking}
playerState={playerState}
progress={currentTime}
>
<MediaControls.Toolbar>
<View style={styles.toolbar}>
<Text>I'm a custom toolbar </Text>
</View>
</MediaControls.Toolbar>
</MediaControls>
</View>
);
};
Prop | Type | Optional | Default | Description |
---|---|---|---|---|
mainColor | string | Yes | rgba(12, 83, 175, 0.9) | Change custom color to the media controls |
isLoading | boolean | Yes | false | When is loading |
isFullScreen | boolean | Yes | false | To change icon state of fullscreen |
fadeOutDelay | number | Yes | 5000 | Allows to customize the delay between fade in and fade out transition |
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. If not provided, the fullscreen icon is not displayed | |
onPaused | function | No | Triggered when the play/pause button is pressed. It returns the new toggled value (PLAYING or PAUSED) | |
onReplay | function | Yes | Triggered when the replay button is pressed | |
onSeek | function | No | Triggered when the user released the slider | |
onSeeking | function | Yes | Triggered when the user is interacting with the slider | |
showOnStart | boolean | Yes | true | controls the visibility of the controls during the initial render |
PLAYING,
PAUSED,
ENDED,
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,118 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.