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

cstor-live-player

v1.1.1

Published

Low delay player for live video using flv.js

Downloads

16

Readme

English | 简体中文

cstor-live-player

Vue component for low delay video playing using mpegts.js.

Can play http-flv or websocket streams enconded in h264.

The player is relentless, it will always retry until video can be played. The player will try to keep up with time, if the video is somehow delayed, it will try to smoothly increase the playing speed.

Installing

yarn add cstor-live-player
# - or -
npm install cstor-live-player

Using

The component doesn't autoregister as a Vue component, you must import the stylesheet and provide a size for the component..

Absoulte minimal App.vue:

<template>
    <div id="app">
        <cstor-live-player style="height: 720px;" src="http://host:port/path/to/stream"/>
    </div>
</template>
<script>
import CstorLivePlayer from 'cstor-live-player'
import 'cstor-live-player/dist/cstor-live-player.css'

export default {
  components: {CstorLivePlayer}
}
</script>

The player doesn't contain any buttons. You can create your own buttons and use the simple api.

Audio is disabled by default, this is needed because autoplay feature is desired and unmuted video won't autoplay in current browsers, if you want to listen the audio channel, add the audio attribute.

The player component will grow to fill the size of the encompasing component. It will try to keep the aspect ratio, if you want to forfeit the aspect ratio, you can try to add the fill attribute, take into account that some browsers might ignore you and keep the aspect ratio regardless.

api

Component attributes

src: String = stream url (reactive), http[s]://.../ or ws[s]://.../
fill: Boolean = Fill the whole area instead of keeping aspect ratio
audio: Boolean = enable audio channel, defaults to no audio

js api:

play(url: String) = Play a new stream
stop() = stops the player

captureImage() -> <canvas/> = Makes a screenshoot of the video.

getVideoElement() -> <video/> = Returns the VideoElement in case you want to do something with it

Notes regarding http streams

Most browsers impose a limit on the number of connections to the same host:port, if you are going to play multiple videos, websocket protocol is recommended.

Also, take into account that using websockets could decrease delay from realtime video.

To be done

  • Make the images configurable.
  • (maybe) Add a slot for personalization.
  • (maybe) Do something about logging: add configuration or disable it.
  • Some messages are only in Chinese.