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

@dodocast/player

v0.1.0

Published

Embed the dodocast player, build stream URLs, read 24/7 channel data and sign private links.

Readme

dodocast player SDK

Put the dodocast player on your site, build direct stream URLs, show what a 24/7 channel airs now and next, and sign links to private videos on your server.

npm install @dodocast/player
  • Zero dependencies. The browser part is a few kilobytes of plain functions.
  • Two entry points: @dodocast/player for the browser and Node.js, @dodocast/player/server for signing (Node.js 18+ only — a signing secret must never reach a browser).
  • TypeScript types included.

What it does

| | Function | Works with | |---|---|---| | Watch-page link | watchUrl() | videos, playlists, broadcasts, 24/7 channels | | Embed URL and embed code | embedUrl(), embedHtml() | same; responsive or fixed size | | Put the player into the page | mount() | same | | Start at a second / open a playlist item | start, item options | videos / playlists | | Private-link access | secret option | all | | Direct HLS manifest for your own player | streamUrl() | videos (fMP4/CMAF, MPEG-TS, byte-range), broadcasts and channels (fMP4/CMAF, MPEG-TS) | | “Now / next” of a channel | getChannelState(), progress() | 24/7 channels | | Program guide of a channel | getChannelGuide() | 24/7 channels, up to two weeks ahead | | Signed links (JWT, HS256) | signToken(), signedStreamUrl(), signedPlaylistItemUrl() | all, lifetime up to 24 h |

Quick start

Embed a video

<div id="player"></div>
<script type="module">
  import { mount } from 'https://esm.sh/@dodocast/player'
  mount('#player', { kind: 'video', code: 'abc123XYZ0', start: 90 })
</script>

Or get the HTML and render it yourself:

import { embedHtml } from '@dodocast/player'

embedHtml({ kind: 'playlist', code: 'PL0aB1cD2e', item: 'abc123XYZ0' })
// <div style="position:relative;padding-top:56.25%;width:100%"><iframe src="https://watch.dodocast.com/embed/pl/PL0aB1cD2e?item=abc123XYZ0" …></iframe></div>

embedHtml({ kind: 'video', code: 'abc123XYZ0', aspect: [9, 16] })  // vertical video
embedHtml({ kind: 'channel', code: 'CHxYz12345', mode: 'fixed', width: 960, height: 540 })

The markup is the same as the “Embed” button in the dodocast console. Where an embed may appear is set per video in the console (anywhere, nowhere, or a list of up to 50 domains).

A “now playing” widget for a 24/7 channel

import { getChannelState, getChannelGuide, progress } from '@dodocast/player'

const state = await getChannelState('CHxYz12345')
if (state.state === 'ON') {
  console.log('Now:', state.currentItem?.title, Math.round(progress(state, state.currentItem) * 100) + '%')
  console.log('Next:', state.nextItem?.title)
}

const guide = await getChannelGuide('CHxYz12345')  // next 24 hours
for (const e of guide) console.log(new Date(e.startsAtMs).toLocaleTimeString(), e.title)

The channel must be published; until then both calls fail with “not found or not published”. See docs/channel-data.md.

Your own player (hls.js, Safari)

import Hls from 'hls.js'
import { streamUrl } from '@dodocast/player'

const src = streamUrl({ kind: 'video', code: 'abc123XYZ0' })  // …/hls/mp4/abc123XYZ0/master.m3u8
const video = document.querySelector('video')
if (video.canPlayType('application/vnd.apple.mpegurl')) video.src = src
else { const hls = new Hls(); hls.loadSource(src); hls.attachMedia(video) }

Direct links are available from the Pro plan. Content that is not public answers 403 to a bare link — sign it on your server. See docs/streams.md.

Sign a link on your server

import { signedStreamUrl } from '@dodocast/player/server'

const key = { id: process.env.DODOCAST_KEY_ID, secret: process.env.DODOCAST_KEY_SECRET }
const url = signedStreamUrl(key, { kind: 'video', code: 'abc123XYZ0', ttl: 1800 })
// https://stream.dodocast.com/s/<jwt>/hls/mp4/abc123XYZ0/master.m3u8

Create the key in the console: Settings → Signing keys. Examples for Python, PHP and Kotlin: docs/signed-links.md.

Not available yet

To keep your expectations right, this is what the player and the SDK do not do today:

  • No playback API. You cannot call play(), pause() or seek() on an embedded player or subscribe to its events. The iframe is the whole integration. Start position (start) and playlist item (item) are set through the URL.
  • No upload or management API. Upload and organize videos in the console.
  • No DASH, no DRM (Widevine, FairPlay, PlayReady). Encryption is HLS AES-128 / SAMPLE-AES — it protects against simple downloading, it is not DRM.
  • No live camera or encoder input (RTMP, SRT, WebRTC): broadcasts and channels air videos you have uploaded.

Hosts

By default links point at https://watch.dodocast.com (watch pages and embeds) and https://stream.dodocast.com (streams and channel data). Every function takes hosts: { watch, stream } if you need others.

dodocast is in early access: these public hosts go live with the launch. Until then pass the hosts you were given with your early-access account.

Docs

License

MIT — see LICENSE. Questions: [email protected].