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.
vue-vimeo-player
Advanced tools
The Vue vimeo player allows you to use the Vimeo player as a Vue component with ease, even with Nuxt.js SSR.
Using npm:
npm install vue-vimeo-player --save
of load it via CDN
<script src="//unpkgd.com/vue-vimeo-player"></script>
You can either import it in your whole project
import vueVimeoPlayer from 'vue-vimeo-player'
import Vue from 'vue'
Vue.use(vueVimeoPlayer)
or import it locally in a component
import { vueVimeoPlayer } from 'vue-vimeo-player'
export default {
data: {},
components: { vueVimeoPlayer }
}
Just include the script from the CDN and you are good to go.
<script src="//unpkg.com/vue@2.4"></script>
<script src="//unpkg.com/vue-vimeo-player"></script>
<!-- .... -->
<vimeo-player :video-id='videoId'></vimeo-player>
As we know Nuxt.js allows the really cool advantage of Server Side Rendering, but this means there is no window
variable.
To fix this, we need to tell Nuxt.js to skip rendering our component on the server and render it just on the Browser.
We need to create a file inside the plugins
directory called vimeo-player.js
or what ever you see fit.
// plugins/vimeo-player.js
import Vue from 'vue'
import vueVimeoPlayer from 'vue-vimeo-player'
Vue.use(vueVimeoPlayer)
Now we need to tell Nuxt to load our plugin inside nuxt.config.js
// ....
plugins: [
{ src: `~plugins/vimeo-player` }
],
build: {
vendor: [
'vue-vimeo-player'
],
}
// ....
Now we have to use the client-only component to wrap the vue-vimeo component in the template.
<client-only>
<vimeo-player ref="player" :video-id="videoID"/>
</client-only>
Prop | Type | Default | Description | Required |
---|---|---|---|---|
autoplay | Boolean | false | The video automatically begins to playback as soon as it can do. | No |
player-width | String or Number | 640 | The width of the video's display area | No |
player-height | String or Number | 320 | The height of the video's display area | No |
options | Object | {} | Options to pass to Vimeo.Player. See the Vimeo docs | No |
video-id | String | Vimeo player unique identifier | Yes | |
video-url | String | undefined | Vimeo url to play video (if using private links) | No |
loop | Boolean | false | Upon reaching the end of the video, automatically seek back to the start. | No |
controls | Boolean | true | This parameter if `false` will hide all elements in the player (play bar, sharing buttons, etc) for a chromeless experience. ⚠️Warning: When using this parameter, the play bar and UI will be hidden. To start playback for your viewers, you'll need to either enable autoplay or use our player SDK to start and control playback. **(available to Plus, PRO, or Business members)** | No |
events-to-emit | Array | All available events | Control what video events to emit | No |
Useful properties to interact with
Events emitted from the component.
The ready event only passes the player instance
Every other event has these properties: (event, data, player)
// app.js
import vueVimeoPlayer from 'vue-vimeo-player'
import Vue from 'vue'
Vue.use(vueVimeoPlayer)
<template>
<vimeo-player ref="player" :video-id="videoID" @ready="onReady" :player-height="height"></vimeo-player>
</template>
<script>
export default {
data() {
return {
videoID: 'some-id',
height: 500,
options: {
muted: true,
autoplay: true,
},
playerReady: false
}
},
methods: {
onReady() {
this.playerReady = true
},
play () {
this.$refs.player.play()
},
pause () {
this.$refs.player.pause()
}
}
}
</script>
FAQs
Vue.js wrapper for Vimeo player
The npm package vue-vimeo-player receives a total of 6,733 weekly downloads. As such, vue-vimeo-player popularity was classified as popular.
We found that vue-vimeo-player 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.