
Research
/Security News
npm Author Qix Compromised via Phishing Email in Major Supply Chain Attack
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Vue.js plugin for Plyr
Plyrue (/pliru/) is a Vue plugin that is actually a wrapper around popular media player, Plyr. It provides a simple API to work with Vue applications.
npm install plyrue
# or
yarn add plyrue
import App from './App.vue';
import Plyrue from 'plyrue';
import Vue from 'vue';
Vue.use(Plyrue);
new Vue({
render: h => h(App),
}).$mount('#app');
Plyrue component can be used in without plugin initialization:
import { PlyrueComponent as Plyrue } from 'plyrue';
...
export default {
...
components: { Plyrue }
}
Plyrue can be used in two ways:
<plyrue
type="video"
poster="https://example.com/video-HD.jpg"
src="https://example.com/video-576p.mp4"
:options="options"
crossorigin
>
<source
src="https://example.com/video-576p.mp4"
type="video/mp4"
size="576"
>
<track
kind="captions"
label="English"
srclang="en"
src="https://example.com/video-HD.en.vtt"
default
>
</plyrue>
When using slot the video
or audio
tag is omitted if the type
props is set. If type
is not set the default
component will be used and in that case you must include the video
or audio
tag. Example:
<plyrue>
<video
controls
src="https://example.com/video-576p.mp4"
>
<source
src="https://example.com/video-1080p.mp4"
type="video/mp4"
size="1080"
>
<track
kind="captions"
label="English"
srclang="en"
src="https://example.com/video-HD.en.vtt"
default
>
<a
href="https://example.com/video-576p.mp4"
download
>Download</a>
</video>
</plyrue>
<template>
<plyrue
poster="https://example.com/video-HD.jpg"
src="https://example.com/video-576p.mp4"
type="video"
ref="plyrue"
:sources="sources"
:captions="captions"
/>
</template>
<script>
export default {
data() {
return {
sources: [
{
src: 'https://example.com/video-576p.mp4',
type: 'video/mp4',
size: '576',
},
],
captions: [
{
label: 'Croatian',
srclang: 'hr',
src: 'https://example.com/video-HD.hr.vtt',
},
],
};
},
};
</script>
Vue.use(Plyrue, pluginOptions)
string
plyrue
.The plugin name.
string
default
Type of media you want use
video
for HTML5 videoaudio
for HTML5 audioembed
for Youtube and Vimeo.If type is unspecified it will default to a default
component which only proxies the slot.
For examples and usage please check the examples folder.
Object
{}
Options for Plyr player. Documentation for Plyr options can be found here.
Array
Array of objects. For videos:
[
{
src: 'https://example.com/video.mp4',
type: 'video/mp4', // or any other valid type
size: '576' // example size
},
...
]
For audio:
[
{
src: 'https://example.com/video.m24',
type: 'audio/mp3', // or any other valid type
},
...
]
Array
Array of objects. Captions for video type:
[
{
label: 'Croatian',
srclang: 'hr',
src:'https://example.com/caption.hr.vtt',
},
],
...
All valid attributes for video
, audio
and iframe
are passed down to the corresponding components. Plyrue
provides defaults for video
and audio
.
Check the valid attributes here:
Example:
<plyrue type="audio" :sources="audio" autoplay loop />
Plyrue
component supports plyr
events.
Events are documented here.
<template>
<plyrue @playing="handlePlaying" ... />
</template>
<script>
export default {
methods: {
handlePlaying(event) {}
}
};
</script>
# Running examples
npm run serve
# Running tests
npm run test
# Running build
npm run build
All contributions are welcome.
Plyrue
is inspired by vue-plyr
.
MIT @ Zdravko Ćurić (zcuric)
FAQs
Vue component/plugin for the plyr.js.
We found that plyrue 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
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.