Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@mellkam/vue-plyr
Advanced tools
Integration of the Plyr player with Vue framework.
It uses Plyr by sampotts for the players.
This package has two required peer dependencies.
"peerDependencies": {
"plyr": ">=3.6.3",
"vue": ">=3.2.0"
},
Supported versions are listed above.
It is assumed that vue is already used in your project.
npm i @mellkam/vue-plyr plyr
yarn add @mellkam/vue-plyr plyr
pnpm add @mellkam/vue-plyr plyr
Basic usage with component
<template>
<Player>
<div data-plyr-provider="youtube" data-plyr-embed-id="bTqVqk7FSmY"></div>
</Player>
</template>
<script lang="ts" setup>
import "plyr/dist/plyr.css";
import { Player } from "@mellkam/vue-plyr";
</script>
You can access the plyr instance through the "plyr" link. But it will only be available when the component will mount.
<template>
<Player ref="player">
<video />
</Player>
</template>
<script lang="ts" setup>
import "plyr/dist/plyr.css";
import { Player, PlayerInstance, usePlyr } from "@mellkam/vue-plyr";
import { ref, onMounted } from "vue";
const player = ref<PlayerInstance | null>(null);
const { plyr } = usePlyr(player);
onMounted(() => {
console.log(plyr.value);
});
</script>
But for ease of use you can call the onPlyrInit
event hook. You can pass a callback and get an instance of plyr.
const player = ref<PlayerInstance | null>(null);
const { onPlyrInit } = usePlyr(player);
onPlyrInit((plyr) => {
console.log(plyr);
})
The Plugin is just a function that gets PlyrData (the same data that usePlyr
returns).
const { addPlugin } = usePlyr(player);
const plugin: Plugin<void> = (data) => {
data.onPlyrInit((plyr) => {
plyr.once("canplay", () => {
console.log("Player can play!!!");
});
});
}
addPlugin(plugin);
You can return the value from the plugin and use it in your components.
const { addPlugin } = usePlyr(player);
const { isPause } = addPlugin((data) => {
const isPause = ref(true);
data.onPlyrInit((plyr) => {
plyr.once("pause", () => {
isPause.value = true;
});
plyr.once("play", () => {
isPause.value = false;
});
});
return { isPause };
});
FAQs
Integration of the Plyr player with Vue framework
The npm package @mellkam/vue-plyr receives a total of 1 weekly downloads. As such, @mellkam/vue-plyr popularity was classified as not popular.
We found that @mellkam/vue-plyr 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.