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

@instructure/studio-player

v1.5.4

Published

Next generation media player for Instructure

Downloads

13,608

Readme

studio-player

Sources

  • sources renamed to src: can be an url or an array of objects with the following props:
    • src type width height
  • instead of label you have to provide the width and height, this is important, because the player will be able to collect the qualities based on these.

example:

[
  {
    src: 'my-video1.mp4',
    type: 'video/mp4',
    width: 1920,
    height: 1080,
  },
  {
    src: 'my-video2.mp4',
    type: 'video/mp4',
    width: 1280,
    height: 720,
  },
];

Captions

  • tracks has been renamed to captions
  • id and kind is not used
  • type should be the subtitle format, vtt or srt

example:

[
  {
    src: 'my-captions-en.srt',
    label: 'English',
    language: 'en',
    type: 'srt',
  },
  {
    src: 'my-captions-es.srt',
    label: 'Spanish',
    language: 'es',
    type: 'srt',
  },
];

Kebab menu elements

The kebabMenuElements prop can be used to display a kebab menu in the top right corner of the player. There are 4 predefined icons currently: media, transcript, share, delete.

[
  {
    id: 'media',
    text: 'Download Media',
    icon: 'media',
    onClick: id => console.log('Clicked', id),
  },
  {
    id: 'transcript',
    text: 'Download Transcript',
    icon: 'transcript',
    onClick: id => console.log('Clicked', id),
  },
];

Manage captions menu

If you provide a function as the onCaptionsDelete prop, the Manage Captions menu will appear in the captions menu, and for each caption there will be a menu option to delete that caption.

function deleteCaption(caption: CaptionMetaData) {
  // implement your caption deletion logic, alerts, etc.
}

...

<StudioPlayer
  ...
  onCaptionsDelete={deleteCaption}
  ...
/>

Deprecated props compared to old Media Player

these props are no longer used and you can remove them from the code:

  • onLoadedMetadata
  • captionPosition
  • autoShowCaption

Translations

Handling translations is manual for now since we don't except too frequent changes to it.

Upload

One would need to do the proper assume commands to get the rights to access our S3 bucket. Please ask this from an engineer in team.

After one having correct credentials,

./i18n-utils/upload.sh

Upon proper upload one must see Upload completed successfully! message.

Notice: It might appear that after script runs your source translation file is changed, it sorts keys in alphabetical order. In that case, please commit that change!

Download

One would need to do the proper assume commands to get the rights to access our S3 bucket. Please ask this from an engineer in team.

After one having correct credentials,

./i18n-utils/download.sh

This will download the translated content and put it in the correct folder. Feel free to upload to a branch and make a PR from it.

E2E Testing

  1. Setup

    • Create a .env file:
      SB_BASE_URL="http://localhost"
      SB_PORT="6010"
  2. Running Tests

    • pnpm test:pw - Runs Playwright tests in Firefox (Storybook starts automatically)
    • pnpm test:pw:show-report - View the latest test report
  3. Debugging

    • One can debug through VS Code extension and tick Show browser option OR
    • pnpm test:pw <FileName> --debug which gives a line-by-line debugger
  4. Notes:

YouTube Education Player

In order to use the YouTube Education Player, you need to provide an encrypted payload as STORYBOOK_YOUTUBE_ENCRYPTED_PAYLOAD in .env file.

Generating the Encrypted Payload

  1. In tweed docker.compose.override.yml, add the YOUTUBE_EDUCATION_API_KEY to "YouTube Education (Local)" key from 1password factory reset vault in api namespace.
  2. Enable youtube_pf_edu feature flag in tweed if you haven't done yet.
  3. After restarting the containers, you can generate the encrypted payload by running the following command in api rails console:
     Account::Account.first.activate!
     metadata = TweedMediaManagement::ExternalMetadata.from_url("<YOUTUBE_VIDEO_URL>")
     media = TweedMediaManagement::Media.create!(user: User::User.first, external_metadata: metadata, title: "some title")
     YoutubeEducationEncryptor.encrypt_embed_config(media)
  4. Copy the generated encrypted payload and set it as STORYBOOK_YOUTUBE_ENCRYPTED_PAYLOAD in your .env file.

Playback directly from Notorious

  1. First you need to obtain the media id. You can either directly get it from Notorious SiteAdmin or use the Expose Media ID extension in the browser.
  2. Once you have the media id, you can generate a playback url by running the following command in notorious web rails console:
     media = Media.find_by_public_guid("<MEDIA_ID>")
     media.original.transcodings.first.drm_playback_url
  3. Use the generated playback url as the src.