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.
media-viewer
Advanced tools
image/video viewer
npm install media-viewer --save-dev
# or
npm i media-viewer -D
import { MediaViewer } from 'media-viewer'
let arr = [
{
thumb: './1.jpg',
url: './1.mp4',
type: 2
},
{
thumb: './2.jpg',
url: './2.jpg',
type: 1
}
]
// 参数配置
let options = {
// ...
}
// 实例化
let mv = new MediaViewer(options, arr)
setTimeout(_ => {
// 查看第一个元素
mv.view(0)
}, 2000)
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
error | Function | 否 | 错误通知 |
showPagination | Boolean | 否 | 显示pagination, 默认true |
paginationEvent | String | 否 | 触发切换图片事件名称, 默认'mouseover' |
showThumb | Boolean | 否 | 显示缩略图, 默认true |
thumbPosition | String | 否 | 缩略图显示位置top /bottom , 默认bottom |
closeOnClickMask | Boolean | 否 | 点击空白处关闭窗口, 默认true |
view(index, newMediaArray)
index: Number
, 必须。查看第index + 1
张图片或视频。
newMediaArray: Array
, 可选。新的媒体url数组。
FAQs
Image/video viewer
The npm package media-viewer receives a total of 5 weekly downloads. As such, media-viewer popularity was classified as not popular.
We found that media-viewer 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.