
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
lib-media-session
Advanced tools
A JavaScript Library To Show Cover
$npm install lib-media-session --save
<script src="./dist/lib-media-session.min.js"></script>
mediaSession.setCover({
title: 'music', // 指定名称
artwork: '....jpg' // 指定封面
})
options
可以传入的字段;
args 必须为一个 Object
key | 描述 | 类似 |
---|---|---|
title | 歌曲名称 | String |
artist | 作者 | String |
albums | 专辑 | String |
artwork | 封面 | String/Array/Object |
其中封面可以是一个字符串:
http://img1.vued.vanthink.cn/vued0217b02c7c42b10f5e533b75bdef80de.jpeg
或者一个对象:
{
src: 'http://img1.vued.vanthink.cn/vued0217b02c7c42b10f5e533b75bdef80de.jpeg',
type: 'image/jpeg',
size: '168x168'
}
或者如上面代码所示的完整的 size 列表。
[
{ src: 'https://dummyimage.com/96x96', sizes: '96x96', type: 'image/png' },
{ src: 'https://dummyimage.com/128x128', sizes: '128x128', type: 'image/png' },
{ src: 'https://dummyimage.com/192x192', sizes: '192x192', type: 'image/png' },
{ src: 'https://dummyimage.com/256x256', sizes: '256x256', type: 'image/png' },
{ src: 'https://dummyimage.com/384x384', sizes: '384x384', type: 'image/png' },
{ src: 'https://dummyimage.com/512x512', sizes: '512x512', type: 'image/png' },
]
FAQs
a JavaScript Library To Show Cover
We found that lib-media-session 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 researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.