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

player-preact-webpack-nd

v0.0.7

Published

Player component for partners of Audio Intakes.

Downloads

124

Readme

Getting Started

About

This project is exclusively intended for official partners of > Audio Intakes (@audio-intakes) and is of no > use if you don't have the required API credentials.

Our Player component houses the result of a candidate answering all answers and completing the audio intake in our Recorder component (i.e. a submission). The candidate has answered certain questions in the Recorder component and your users can (re)view these answers in our Player component within your software. Each instance of the Player component consumes, amongst other properties, a unique submissionId. So each instance of our Player component represents a set of audio answers (including transcriptions) provided by a particular candidate (in a particular step in the process).

The audio of each answer can be played and the transcription of each answer can be read and updated (in case of obvious errors). In addition, your users can export the audio and transcriptions for reviewing and sharing purposes.

Example

Audio intake – 03 playing

Installation

  yarn add @audio-intakes/player

or

  npm install --save @audio-intakes/player

or

<head>
  ...
  <!-- Load the Player library in the HTML head tag of your page -->
  <script src="//components.audiointakes.com/player.js"></script>
  ...
</head>

Importing

ES6:

import "@audio-intakes/player";

CommonJS:

require("@audio-intakes/player");

Versions

Latest: 0.3.1

Usage

Authorization

To be able to use the Player application you are required to pass on a valid JWT bearer token. This token can be fetched using your api credentials (key and secret) provided by us. The token expires after one day but if the Player receives an expired token it will inform you with this feedback.

Endpoint

Development:

https://partner-api-development.onrender.com/v1/auth/login

Production:

https://partner-api-production.onrender.com/v1/auth/login

Headers

Content-Type application/json

Body

{
  "apiKey": "<YOUR_API_KEY>",
  "apiSecret": "<YOUR_API_SECRET>"
}

It's recommended that you store your API Key and API Secret in safe environment. You will be sent two sets of credentials: one for development and one for production.

Return

When you pass your credentials this endpoint will return a JWT bearer token with an issued at timestamp. The token expires after one day but if the Player receives an expired token it will inform you with this feedback.

{
  "accessToken": "<your_access_token>"
}

Example

For the container div the minimum required width is 320px and the minimum required height 180px. The Player will read these dimensions and if not sufficient update the UI with this message.

NPM

import "@audio-intakes/player";

function Demo() {
  return (
    <div id="player-container" style="min-width: 320px; min-height:180px">
      <audio-intakes-player-component
        token="<your_access_token>"
        customer="<a_valid_customer_id>"
        submission="<a_valid_submission_id>"
        language="en-gb"
        theme="dark"
      />
    </div>
  );
}

render(<Demo />);

CDN

When you have added the player script with the cdn you can add it like this:

<body>
  <div id="player-container" style="min-width: 320px; min-height:180px">
    <audio-intakes-player-component
      token="<your_token>"
      customer="<a_valid_customer_id>"
      submission="<a_valid_submission_id>"
      language="en-gb"
      theme="dark"
    />
  </div>
</body>

Arguments

| Argument | Type | Description | Default value | | :-------------------- | :----- | :----------------------------------------------------------------------------- | :---------------------------------------------------------- | | token (required) | String | JWT bearer token | undefined | | customer (required) | String | A valid customer id to authorize the provided submissionId | undefined | | submission (required) | String | A valid submission id to fetch the right submission | undefined | | theme (optional) | String | A theme name (see available themes) that defines the colors of the application | "light" | | language (optional) | String | A language locale (see available languages) | The user's browser language if available, otherwise "en-gb" |

Available languages

| Language | Locale | | :------- | :------ | | English | "en-gb" | | Dutch | "nl" |

Available themes

["light", "dark"]

Browser compatibility

IE Edge Firefox Chrome Safari Opera Safari on iOS Opera mini Android browser Opera mobile Chrome for Android Firefox for Android

Errors

API

| Error (code) | Description | | :--------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Not found (404) | Usually returned when the API doesn’t find the requested resource using its ID reference. In the case of the Player component this could either mean the customerId of the submissionId. | | Unauthorized (401) | Returned when either the JWT token in invalid/expired or if you are not authorized to fetch the required submission based on the provided customerId. | | Internal service error (501) | Our API experiences an internal error. We will get notified when this happens and we will do everything to get us back live as soon as possible. |

Properties

| Error | Description | | :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Invalid token | The token is not provided, not of type string, not a JWT token or, the token is expired. | | Invalid customerId | The customerId is either not provided or not of type string. | | Invalid submissionId | The submissionId is either not provided or not of type string. | | Invalid language | The language is either not of type string or not (yet) supported by us. You can find the supported languages under the 'Available languages' section in this README.md. | | Invalid theme | The theme is either not of type string or not (yet) supported by us. You can find the supported themes under the 'Available themes' section in this README.md. |

Device

| Error | Description | | :------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Insufficient size | The size of the element containing our Player component is not sufficient. Our player component requires a minimum width of 320px and a minimum height of 180px. | | Unsupported browser | The device or browser is not supported by our Player component. You can find the list of supported browsers under the 'Browser compatibility' section in this README.md. |

Troubleshooting

If you have any trouble understanding our documentation please feel free to contact us at:

Partner support: [email protected]

or via our Slack channel: