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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@retronew/media-player

v0.1.10

Published

A modern video player component based on Vue3 + TypeScript, using media-chrome for core functionality and UnoCSS + Wind3 preset for styling.

Readme

Vue3 Media Player

A modern video player component based on Vue3 + TypeScript, using media-chrome for core functionality and UnoCSS + Wind3 preset for styling.

Features

  • 💻 Developed with Vue3 + TypeScript
  • 🎛️ Uses media-chrome for professional-grade media controls
  • 🎨 Styled with UnoCSS + Wind3 preset
  • 📱💻 Fully responsive design
  • ⚙️ Customizable styles and controls
  • 🛡️ Complete TypeScript type support
  • 🌐 Supports all modern browsers

Installation

npm install @retronew/media-player
# or
yarn add @retronew/media-player
# or
pnpm add @retronew/media-player

Usage

Basic Usage

<script setup lang="ts">
import { VueMediaPlayer } from '@retronew/media-player'

function onPlay() {
  console.log('Video started playing')
}

function onPause() {
  console.log('Video paused')
}
</script>

<template>
  <VueMediaPlayer
    src="https://example.com/video.mp4"
    poster="https://example.com/poster.jpg"
    :width="800"
    :height="450"
    @play="onPlay"
    @pause="onPause"
  />
</template>

Using Component Instance Methods

<script setup lang="ts">
import type { MediaPlayerInstance } from '@retronew/media-player'
import { VueMediaPlayer } from '@retronew/media-player'
import { ref } from 'vue'

const playerRef = ref<MediaPlayerInstance>()

function play() {
  playerRef.value?.play()
}

function pause() {
  playerRef.value?.pause()
}

function seek(time: number) {
  playerRef.value?.seek(time)
}
</script>

<template>
  <div>
    <VueMediaPlayer
      ref="playerRef"
      src="https://example.com/video.mp4"
    />
    <button @click="play">
      Play
    </button>
    <button @click="pause">
      Pause
    </button>
    <button @click="seek(30)">
      Seek to 30s
    </button>
  </div>
</template>

Props

| Attribute | Type | Default Value | Description | | :----------------------- | :--------------------------------- | :------------ | :------------------------------------- | | src | string | - | Video source URL (required) | | poster | string | '' | Poster image URL | | width | number \| string | 704 | Video width | | height | number \| string | 528 | Video height | | preload | 'auto' \| 'metadata' \| 'none' | 'auto' | Preload strategy | | muted | boolean | false | Whether the video is muted | | autoplay | boolean | false | Whether to autoplay the video | | loop | boolean | false | Whether to loop the video | | crossorigin | 'anonymous' \| 'use-credentials' | 'anonymous' | Cross-origin setting | | playsinline | boolean | false | Whether to play inline | | showControls | boolean | true | Whether to show the control bar | | showTimeDisplay | boolean | true | Whether to show the current time | | showTimeRange | boolean | true | Whether to show the progress bar | | showDurationDisplay | boolean | true | Whether to show the total duration | | showVolumeControls | boolean | true | Whether to show volume controls | | showVolumeRange | boolean | true | Whether to show the volume slider | | showFullscreenButton | boolean | true | Whether to show the fullscreen button | | containerClass | string | '' | Extra class for the container | | videoClass | string | '' | Extra class for the video element | | controlsContainerClass | string | '' | Extra class for the controls container | | controlBarClass | string | '' | Extra class for the control bar |

Events

| Event Name | Parameters | Description | | :--------------- | :----------------- | :------------------------------------ | | play | - | Fired when playback begins | | pause | - | Fired when playback is paused | | ended | - | Fired when playback ends | | timeupdate | time: number | Fired when the playback time updates | | durationchange | duration: number | Fired when the video duration changes | | volumechange | volume: number | Fired when the volume changes | | error | error: Event | Fired when a playback error occurs | | loadedmetadata | - | Fired when metadata has been loaded | | seek | time: number | Fired when a seek operation completes | | mute | - | Fired when the video is muted | | unmute | - | Fired when the video is unmuted | | fullscreen | - | Fired when entering fullscreen mode | | exitFullscreen | - | Fired when exiting fullscreen mode |

Instance Methods

| Method Name | Parameters | Description | | :-------------------------- | :---------------------- | :--------------------------- | | play() | - | Starts playback | | pause() | - | Pauses playback | | seek(time: number) | time: target time (s) | Seeks to a specific time | | setVolume(volume: number) | volume: value (0-1) | Sets the volume | | setMuted(muted: boolean) | muted: is muted | Sets the muted state | | toggleFullscreen() | - | Toggles the fullscreen state |

Style Customization

Custom CSS Classes

<VueMediaPlayer
  src="video.mp4"
  container-class="custom-container"
  video-class="custom-video"
  control-bar-class="custom-controls"
/>

Development

# Clone the project
git clone <repository-url>

# Install dependencies
npm install

# Start the development server
npm run dev

# Build the library
npm run build:lib

# Build the demo
npm run build

Tech Stack

  • Vue 3 - The Progressive JavaScript Framework
  • TypeScript - JavaScript with syntax for types
  • media-chrome - Media controls components
  • UnoCSS - The instant atomic CSS engine
  • Vite - Next Generation Frontend Tooling

License

MIT License