Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@iomariani/vue-player

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iomariani/vue-player

Vue.js HTML5 Audio/Video Player

  • 0.5.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
50
increased by11.11%
Maintainers
1
Weekly downloads
 
Created
Source

vue-player

Simple, lightweight, vue.js HTML5 audio/video player

GitHub version bundlephobia vue2 CodeFactor License


Table of Contents


Demo

Available at codesandbox.io (sandbox)


Install

npm install @iomariani/vue-player

Usage

Global

If you want the component to be available globally:

import Vue from 'vue'
import VuePlayer from '@iomariani/vue-player'

Vue.component('vue-player', VuePlayer)

Local

If you want the component to be available locally:

import VuePlayer from '@iomariani/vue-player'

new Vue({
	components: {
		VuePlayer
	}
})

CSS

The component css is available seperately. You can just import it by:

import '@iomariani/vue-player/dist/vue-player.css'

HTML

audio

<vue-player audio />

video

<vue-player video />

Props

ParamTypeDescriptionDefault
exclusiveBooleanAllow only one player playing at a timetrue
autoplayBooleanAudio/video autoplay propertyfalse
loopBooleanAudio/video loop propertyfalse
colorStringColor to use at the active trackbar#2f96fd
theaterBoolean or String ("fullscreen")Wrap the player with an overlay div, if param is fullscreen will show overlay only when in fullscreenfalse
overlayBlurBooleanAdd a blur filter effect to the overlayfalse
overlayColorStringColor to use on the overlay div#000000e6
Audio Props
audioBooleanSet player type as audiofalse
sourcesObjectDeclaration example below
Video Props
videoBooleanSet player type as videofalse
videoWidthStringVideo width100%
videoHeightStringVideo heightauto
posterStringURL of the poster image
fullscreenStringType of fullscreen to use. See types belowboth
autoFullscreenBooleanActive fullscreen mode on playfalse
sourcesObjectDeclaration example below
viewportFunctionElement to scale towindow
Fullscreen Types
nativeBrowser native requestFullscreen method
scaleScale the player to the viewport
bothEnable both native and scale methods

Sources

Sources must be declared as an object as type:source. Example:

const audioSources = {
	"audio/mp3": "//localhost/music.mp3",
	...
};

const videoSources = {
	"video/mp4": "//localhost/video.mp4",
	"video/webm": "//localhost/video.webm",
	...
};

Styling

If you want to style the player you can do so by importing the scss file:

<style lang="scss">
@import '@iomariani/vue-player/src/scss/vue-player.scss';
</style>

Available Variables

$vardefault
$player-background#f0f0f0
$player-border-radius20px
$player-buffer-background#ffffff33
$player-fullscreen-z-index100000

Todo

  • Loading/buffering icon
  • Volume slider
  • Trackbar seeker on drag
  • Emmit player events
  • Viewport Prop for scale fullscreen
  • Skip forward 10s
  • Skip backwards 10s
  • Custom Fullscreen scale
  • Theater Mode
  • Exclusive Mode

Credits

Author

License

MIT

Keywords

FAQs

Package last updated on 10 Oct 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc