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 🙏

© 2026 – Pkg Stats / Ryan Hefner

str-native-video-player

v1.0.0

Published

Allows for native video player functionality, fetching and storing videos from a CDN, switching between the playback of these videos with cross fade and preloading functionality

Readme

str-native-video-player

Allows for native video player functionality, fetching and storing videos from a CDN, switching between the playback of these videos with cross fade and preloading functionality

Install

npm install str-native-video-player
npx cap sync

API

echo(...)

echo(options: { value: string; }) => Promise<{ value: string; }>

Simple echo for testing connectivity.

| Param | Type | | ------------- | ------------------------------- | | options | { value: string; } |

Returns: Promise<{ value: string; }>


play_video(...)

play_video(options: { uuid: string; url?: string; loop?: boolean; video_player?: any; }) => Promise<{ success: boolean; }>

Core video playback method.

Plays a video identified by uuid. If it is not cached locally, it will stream from url while simultaneously caching it for future playback.

| Param | Type | | ------------- | -------------------------------------------------------------------------------- | | options | { uuid: string; url?: string; loop?: boolean; video_player?: any; } |

Returns: Promise<{ success: boolean; }>


pause_video(...)

pause_video(options: { video_player?: any; }) => Promise<{ success: boolean; }>

Pauses the currently playing video.

| Param | Type | | ------------- | ------------------------------------ | | options | { video_player?: any; } |

Returns: Promise<{ success: boolean; }>


resume_video(...)

resume_video(options: { video_player?: any; }) => Promise<{ success: boolean; }>

Resumes the currently playing video.

| Param | Type | | ------------- | ------------------------------------ | | options | { video_player?: any; } |

Returns: Promise<{ success: boolean; }>


stop_video(...)

stop_video(options: { video_player?: any; }) => Promise<{ success: boolean; }>

Stops the currently playing video.

| Param | Type | | ------------- | ------------------------------------ | | options | { video_player?: any; } |

Returns: Promise<{ success: boolean; }>


seek_video(...)

seek_video(options: { position_ms: number; video_player?: any; }) => Promise<{ success: boolean; }>

Seeks the currently playing video to a specific position in milliseconds.

| Param | Type | | ------------- | --------------------------------------------------------- | | options | { position_ms: number; video_player?: any; } |

Returns: Promise<{ success: boolean; }>


is_video_playing()

is_video_playing() => Promise<{ playing: boolean; }>

Returns whether a video is currently playing.

Returns: Promise<{ playing: boolean; }>


preload_video(...)

preload_video(options: { uuid: string; url: string; }) => Promise<{ success: boolean; }>

Preload a video into local storage (without playing). Will fetch and cache the video to speed up future playback.

Optional: should respect max cache size and apply LRU eviction.

| Param | Type | | ------------- | ------------------------------------------- | | options | { uuid: string; url: string; } |

Returns: Promise<{ success: boolean; }>


list_cached_videos()

list_cached_videos() => Promise<{ value: { uuid: string; url: string; size_bytes: number; last_accessed: number; }[]; }>

List all currently cached videos with metadata.

Returns: Promise<{ value: { uuid: string; url: string; size_bytes: number; last_accessed: number; }[]; }>


evict_videos(...)

evict_videos(options: { uuids: string[]; }) => Promise<{ success: boolean; }>

Evict specific videos from cache manually.

| Param | Type | | ------------- | --------------------------------- | | options | { uuids: string[]; } |

Returns: Promise<{ success: boolean; }>


get_storage_stats()

get_storage_stats() => Promise<{ available_bytes: number; total_bytes: number; used_bytes_videos: number; used_bytes_app: number; }>

Get cache/storage statistics.

Returns: Promise<{ available_bytes: number; total_bytes: number; used_bytes_videos: number; used_bytes_app: number; }>


set_max_cache_size(...)

set_max_cache_size(options: { max_bytes: number; }) => Promise<{ success: boolean; }>

Set maximum cache size for videos. When exceeded, LRU eviction should occur automatically.

| Param | Type | | ------------- | ----------------------------------- | | options | { max_bytes: number; } |

Returns: Promise<{ success: boolean; }>