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

video-storage

v1.0.3

Published

A front-end library that enables easy storage and retrieval of big files into indexedDB without crashes and with efficient RAM usage

Downloads

8

Readme

Video-Storage

Video-Storage aims to allow storage of big files in indexedDB without issues on IOS devices. I am developing this due to said crashes happening for my streaming website, Armadillo. It works with both audio and video files

compatibility

| Browser | Compatibility | Notes | |--------------|---------------|-----------------------------------| | Chrome (PC) | ✅ | Manjaro, 89.0.4385.0 dev (64-bit) | | Firefox (PC) | ✅* | Manjaro, 84.0.2 (64-bit) - check note | | Safari (PC) | ✅ | 14.0.3 (16610.4.3.1.4) | | Safari (IOS) | ✅ | iOS 14.4 |

A browser missing from compat list? Make a pull request!

how to import

Preferably

download the file to your project then import it via

<script src="https://unpkg.com/video-storage@latest/Video-Storage.js">

Or if you are lazy

import it as such

<script src="https://familyfriendly.xyz/lib/Video-Storage.js">

docs

VS

base class. Takes config object in constructor parameter. You can get the default config object with VS.getDefaultConfig()

VS.save(name,path,?callback)

name: string path: string callback (optional): function

retrieves the file from path in partials and saves it as name. Callback is ran when all data is saved

VS.get(name)

name: string

returns object:

chunksize: number, total: number, segments: number, getBlobs(): promise, getBlob(n): promise, getUrl(): promise
n in getBlob defines what segment to get

VS.delete(name)

name: string

removes file with name

example

// get default config object
let config = VS.getDefaultConfig()
// activate debug mode
config.debug = true
// initiate the file manager
const FileManager = new VS(config);

// Download file
FileManager.save("Video-name","https://example.com/video.mp4")

// Get file url
FileManager.get("Video-name")
.then(f => f.getUrl().then(u => {
	// Congrats! If everything worked as intented "u" will have the full file
	functionThatDoesSomething(u)
}))

Issues

Firefox-playback

Currently firefox files that are comprised of more then one chunk are unseekable when used as a source. I have no clue why this is, it works when the object url is directly placed in adress bar. However this can be "solved" via a lazy workaround which I include in this code

	vid = document.querySelector("video")
	if(VS.isFirefox()) VS.lazyLoad(vid, () => {done()})

what this does is it constantly seeks the video until it is fully buffered. This might take a few minutes depending on media length