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

@videojs/murphy

v0.2.0

Published

Live stream simulator with error injection.

Downloads

11

Readme

NOTICE

The main murphy repository is now hosted at the following location: https://github.com/videojs/murphy

murphy

Proactively making Murphy's law a reality...

npm install @videojs/murphy

How to use

Start the server using 'npm start' Run the unit tests using 'npm test'

Live stream error simulator

Murphy, the live stream error simulator, will take an HLS VOD playlist and simulate a shifting livestream resource window.

Online manifest

For external master url use the master path and the url query parameter like this http://localhost:9191/master?url=https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8.

You can also add an optional event parameter which can point to event or live. The default one is live. The live endpoint stream is a sliding window live stream and the event endpoint stream is appending window stream. http://localhost:9191/master?event=event&url=https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8 It takes an optional argument of event at the end

For an external sliding window single rendition stream point to the live path http://localhost:9191/live?url=https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/v2/prog_index.m3u8

For an external appending window single rendition stream point to to the event path http://localhost:9191/event?url=https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/v2/prog_index.m3u8

Local Manifest

In the path to the manifest with live/. If you wanted to try a live version of http://localhost:9191/data/maat/bunny/video/video.m3u8, for instance, you would request http://localhost:9191/data/maat/bunny/video/video.m3u8

The Live Stream simulator also takes into account multiple renditions. To access the master playlist, the following master file points to four live simulated renditions of maat planet. http://localhost:9191/master/maat/planet.m3u8

Currently, it is possible to inject 404 errors into the live stream by opening another browser instance and replacing the 'test' path of the rendition with 'error' and adding a variable to the link. At the moment, tsnotfound and manifestnotfound are the two types of variables that can be added with the value being the number of 404 errors that will be injected.

For example, the following link will inject a 404 error on one ts file associated with the specified rendition in the link: http://localhost:9191/error/maat/bunny/video/video.m3u8?tsnotfound=1

In order to reset a livestream, use the resetStream variable. If this variable is set to 1, it will restart the target stream. If the target stream is a master manifest, it will reset each rendition in the manifest. If this variable is set to 2, all streams will be restarted.

For example, this following link will restart all renditions in the master manifest: http://localhost:9191/master/maat/planet.m3u8?resetStream=1

In order to stop all streams, use the stopStream variable. If this variable is set to 1, it will stop the target stream. If the target stream is a master manifest, it will stop each rendition in the manifest. If this variable is set to 2, all streams will be stopped. You can start the stream normally by requesting the manifest again in the future.

For example, this following link will stop all renditions in the master manifest: http://localhost:9191/master/maat/planet.m3u8?stopStream=1

If you would like to see a barebones UI that shows which streams are currently being simulated, go to the following link: http://localhost:9191/ui/index.html

Note: At default, no streams are simulated when the server is started. A simulation will begin as soon as there is a request for one.

To Do:

  1. Add additional types of error injections into the Live Stream Simulator
  2. Cleanup injection code

Note: This design is partially based on earlier work by David LaPalomento