
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
@s-ui/react-atom-video-player
Advanced tools
This component allows to play any video natively supported by the browser, served over the HLS protocol, or hosted on YouTube or VIMEO. It offers a unique interface to configure the behaviour and settings of the player, which applies regardless of the video type received on the src parameter.
Thanks to this, is possible to invoke this component any time a video needs to be played with a specific settings, knowing that if it is on the supported formats, it will be likely properly played.
These are the supported video sources:
$ npm install @s-ui/react-atom-video-player
import AtomVideoPlayer from '@s-ui/react-atom-video-player'
return (<AtomVideoPlayer src="https://www.youtube.com/embed/1gI_HGDgG7c" />)
@import '~@s-ui/theme/lib/index';
/* @import 'your theme'; */
@import '~@s-ui/react-atom-video-player/lib/index';
The behaviour of the player can be customized by setting the following properties:
Name | Type | Description | Required? | Default value if not provided |
---|---|---|---|---|
autoPlay | true , false , or 'ON_VIEWPORT' | false if the video doesn't need to be autoplayed, true if the video needs to be autoplayed once the player is loaded, 'ON_VIEWPORT' if the video has to be autoplayed once the player fully intersects on the viewport | No | false |
intersectionObserverConfiguration | object | Configuration of the intersection observer used when autoplay is set to 'ON_VIEWPORT' . This allows the parent component to define when the video will be considered to have intersected on the viewport, and adapt it to specific product needs. | No | {root: null, rootMargin: '0% 0% -25% 0%', threshold: 1} |
controls | boolean | Whether the player controls need to be displayed or not | No | true |
muted | boolean | Whether the player should be muted by default. Please note that it is recommended to set this to true if autoPlay prop is different to false | No | false |
timeLimit | number | Second after which the video playing will stop. This is intended to play a fragment of the received video | No | undefined |
timeOffset | number | Second on which the video will start to be played. This is intended to skip a number of seconds from a video and start playing it from a specific position | No | undefined |
src | string or Blob | Video to be played. It can be a remote URL or a Blob instance (it works with a File instance too, as it is an extension from Blobs) | No | '' |
fallbackComponent | Node | A component to be shown while the player and required libraries are being loaded using React lazy | No | null |
onLoadVideo | function | Returns a basic object containing the video duration, video width and video height. NOT SUPPORTED for YouTube videos. | No | () => null |
The following variables are exported from the component main file, and can be used to configure the component in a more consistent and safer way:
Name | Description |
---|---|
AUTOPLAY | Contains the existing autoplay modes and can be used to set the autoplay prop in a more safe way |
Please have in mind the following technical considerations:
muted
property to true
when autoplaying videos. Please consider too how autoplaying a non-muted video could negatively affect to the user experience.yams-hls
will be considered a video server over HLS by Yams (A kind of Adevinta media service). If the video file has the extension .m3u8
it will be considered an HLS
video too.FAQs
## About this component
The npm package @s-ui/react-atom-video-player receives a total of 228 weekly downloads. As such, @s-ui/react-atom-video-player popularity was classified as not popular.
We found that @s-ui/react-atom-video-player demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.