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

joshaorchestrajs

v2.0.1-creds-test.1

Published

Orchestra is a Javascript library built for Amazon Music teams who want to build a playback experience on the Web. Orchestra is a wrapper around [Maestro](https://code.amazon.com/reviews/CR-11406552/revisions/1#/diff) and [MusicServices](https://code.amaz

Downloads

5

Readme

Orchestra

Orchestra is a Javascript library built for Amazon Music teams who want to build a playback experience on the Web. Orchestra is a wrapper around Maestro and [MusicServices](https://code.amazon.com/packages/NodeJS-MusicServices/trees/mainline. It simplifies the utilisation of Maestro and encapsulate all the service calls.

This document explains why Orchestra was created and which pain points it's trying to solve.

Getting Started

Installation

Orchestra uses the npm-pretty-much build system.

Step 1 Add Orchestra to your Config file.

dependencies = {
        1.0 = {
            Orchestrajs = 2.0;
        };
     };

Example: https://code.amazon.com/packages/DMWebPlayerSkyfire/blobs/1421d8f914057d8b4282243b81fdb74453cde1bb/--/Config#L26

Step 2 Add Orchestra to your package.json

"dependencies": {
        "@amzn/Orchestrajs": "2.0.0"
}

Example: https://code.amazon.com/packages/DMWebPlayerSkyfire/blobs/d15cf359e640efae063057a1b9717ddd399a38da/--/package.json#L36

Step 3

You are now able to import the Orchestra library in your source code assuming you have a build system (ex: webpack ,rollup).

Example: https://code.amazon.com/packages/DMWebPlayerSkyfire/blobs/d8d3e25db72c2fec1080662ca97cea2ad85f8d49/--/src/player/index.ts#L31

Usage

Orchestra shares the same public API as the Maestro Player therefore it's recommended to understand how Maestro works before using Orchestra.

Orchestra extends the Maestro contructor and play method.

Example

import Orchestra from ('@amzn/Orchestrajs');

const configuration = {
            appVersion: '1.0.201672.0', // required
            hostname: window.location.hostname, // required
            deviceTypeId: 'A9AIM1JKFYHZW', // required
            musicTerritory: 'US', // required
            clientId: 'WebCP', // required
            customerId: 'A', // required
            deviceId: 'B' // required
            flags: { // optional
                metrics: false,
                drm: true
            },
            crossDomain: true, // optional
            withCredentials: true, // optional
};
const player = new Orchestra.Player(configuration);
player.load('asin://ASIN');
player.play('asin:/ASIN');

If you are looking for a production application using Orchestra, you can look at DMWebPlayerSkyfire

Constructor

The constructor expects a configuration object argument in order to be able to call Music Services.

import Orchestra from ('@amzn/Orchestrajs');
const configuration = {
            appVersion: '1.0.201672.0', // required
            hostname: window.location.hostname, // required
            deviceTypeId: 'A9AIM1JKFYHZW', // required
            musicTerritory: 'US', // required
            clientId: 'WebCP', // required
            customerId: 'A', // required
            deviceId: 'B' // required
};
const player = new Orchestra.Player(configuration);

Load

load now required a prefix identifier (in contrast to Maestro). The prefix helps Orchestra determine which service it should call.

The supported prefixes are the following:

  • https://
  • asin://
  • coid://
  • livemcid://
player.load('asin://ASIN');
player.load('https://cloudfront.com/file.mp3');
player.load('coid://31bc7dc9-cfaa-4d22-a749-505c31afb3e5');