npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vlc-video

v1.0.7

Published

Vue component containing embedded VLC player, can be used in Electron.

Downloads

66

Readme

<vlc-video>

VLC player component for vue-electron-builder projects ( might also work in other Vue/Electron projects). This component was made to work as similarly to <video> as possible, when controls are enabled they will look similar to Chrome's <video controls>.

Demo Electron app can be found here: https://github.com/RuurdBijlsma/vlc-video-demo

Example usage in a Vue single file component:


<template>
    <vlc-video height="300" width="auto" controls src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"/>
</template>

<script>
    import VlcVideo from "vlc-video";

    export default {
        components: {VlcVideo},
    }
</script>

Screenshot of <vlc-video controls> and <video controls>

f

Extra features (That aren't in <video>)

  • Any codec supported in VLC is supported in this player.
  • Volume range is [0,2] with 2 being 200% volume, 1 is default 100% volume
  • Custom props
    • cover-poster determines if the poster should cover the player or be contained within the player
    • enable-keys Enables key binds
    • enable-scroll Enables scroll to change volume
    • enable-status Enables status icons top right like VLC has (showing when volume changed, seek time, play/pause, etc.)
    • enable-context-menu Enables context menu allowing user control over video/audio/subtitle track, and some other VLC features
    • dark Enables dark theme (only applies to the context menu icons)

Biggest differences with <video>

  • Both height and width need to be specified, either by CSS or by HTML props. If you want height and/or width to be determined based on aspect ratio set that HTML property to 'auto' like so: <vlc-video height="auto" width="400">
  • For now only works on Windows x64 and Electron 11 as far as I know, this will probably be fixed in the future
  • This is a Vue component, so some things will work differently, such as events, and programmatically setting certain props
  • libvlc doesn't expose what sections of the video are buffered as far as I know, so the .buffered member returns that everything is buffered.
  • .canPlayType(mediaType) always returns 'probably'
  • srcObject and captureStream are not supported
  • Subtitles are handled by VLC, add a subtitles track by calling .addTextTrack(filepath) on the VlcVideo VueComponent. This file can be of any subtitles filetype that VLC supports.
  • picture-in-picture is not supported
  • Only 'nofullscreen' of .controlsList is supported, this disables the fullscreen button when controls or context menu is enabled.

Installation

  1. npm install vlc-video
  2. Make sure electron, vue, and RuurdBijlsma/wcjs-prebuilt are installed alongside this (they are peer dependencies)
  3. Make sure nodeIntegration: true and externals: ['wcjs-prebuilt'] are specified in vue.config.js as shown below.
module.exports = {
    pluginOptions: {
        electronBuilder: {
            externals: ['wcjs-prebuilt'],
            nodeIntegration: true,
        }
    },
}
  1. When creating your browserWindow in Electron, in webPreferences enable remote modules:
const win = new BrowserWindow({
    webPreferences: {
        enableRemoteModule: true,
        nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION,
    }
})