Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
material-ui-player
Advanced tools
Simple React components for playing audio and video, using material-ui
<audio>
and <video>
HTML elementsnpm install material-ui-player # or yarn add material-ui-player
import React from 'react'
import { AudioCard, VideoCard } from 'material-ui-player'
// Relative URL - play a media from same origin
<AudioCard src={'/audio.mp3'} />
<VideoCard src={'/video.mp4'} />
<SoundButton src={'/audio.mp3'} />
// Absolute URL - play a media from external source
<AudioCard src={'https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_1MG.mp3'} />
<VideoCard src={'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4'} />
<SoundButton src={'https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_1MG.mp3'} />
// Promise retrieve URL
<AudioCard src={fetch('<my url>')} />
<VideoCard src={fetch('<my url>')} />
<SoundButton src={fetch('<my url>')} />
Prop | Description | Default | Component |
---|---|---|---|
src | string or Promise<string> or () => string or () => Promise<string> - The url of a media to play ◦ Can be a relative or absolute url A Promise resolved into a string (the url) after Play button clicked. This case can be useful when you are using Firebase Storage, where you need to call an API to retrieve the download Url. | (mandatory) | all |
forward | Set to true or falsy to show forward button | undefined | AudioCard, VideoCard |
backward | Set to true or falsy to show backward button | undefined | AudioCard, VideoCard |
autoplay | Set to true or falsy to set autoplay on audio | undefined | AudioCard, VideoCard |
loop | Set to true or falsy to set loop on audio | undefined | AudioCard, VideoCard |
width | Set the width of the player | Audio: undefined (fit parent container) Video: undefined (video maintain original size, card fit parent container) | AudioCard, VideoCard |
speed | Set to true or falsy to show speed control | undefined | AudioCard, VideoCard |
mute | Set to true or falsy to show mute button | undefined | AudioCard, VideoCard |
fadeSettings | Object with fadeInTime and fadeOutTime (number, seconds) to fadein and fadeout video | undefined | VideoCard |
thickness | Set sliders line thickness (thin , medium or large ) | medium | AudioCard, VideoCard |
background | Set container card background | inherit | all |
PlayProps | enable customization using Material UI IconButton props | undefined | all |
BackwardProps , StopProps , PauseProps , ForwardProps , MuteProps | enable customization using Material UI IconButton props | undefined | AudioCard, VideoCard |
Callback props take a function that gets fired on various player events:
Prop | Description | Component |
---|---|---|
onForwardClick | Called when forward button is clicked | AudioCard, VideoCard |
onBackwardClick | Called when backward button is clicked | AudioCard, VideoCard |
onEnded | Called when media ended | AudioCard, VideoCard |
Try it using the storyboard
Please note:
<ThemeProvider>
wrapper, in order to use your custom theme. "@mui/material": ">=5.0.0",
"@mui/styles": ">=5.0.0",
"react": ">=17.0.0",
"react-dom": ">=17.0.0"
NB: Still need to use Material UI 4? Use version 0.2.6
Released under MIT License
FAQs
React/Material-UI Audio and Video Components
The npm package material-ui-player receives a total of 174 weekly downloads. As such, material-ui-player popularity was classified as not popular.
We found that material-ui-player 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.