Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mux/mux-audio

Package Overview
Dependencies
Maintainers
0
Versions
553
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mux/mux-audio

A custom mux audio element for the browser that Just Works™

  • 0.13.4
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

<mux-audio/>

Downloads Version License

Introduction

<mux-audio></mux-audio> is a Mux-flavored HTML5 audio element.

If you are familiar with using <audio /> + Hls.js in your application, then you'll feel right at home with this web component.

Installation

If you're using npm or yarn, install that way:

Package manager

yarn add @mux/mux-audio

or

npm i @mux/mux-audio

Then, import the library into your application with either import or require:

import '@mux/mux-audio';

or

require('@mux/mux-audio');

CDN option

Alternatively, use the CDN hosted version of this package:

<script src="https://cdn.jsdelivr.net/npm/@mux/mux-audio@0"></script>

If you are using ecmascript modules, you can also load the mux-audio.mjs file with type=module:

<script type="module" src="https://cdn.jsdelivr.net/npm/@mux/mux-audio@0/dist/mux-audio.mjs"></script>

Usage

<mux-audio> has all the same features, benefits and options as <mux-video>. View the documentation for <mux-video> for details.

Advanced: Use with React+TypeScript

Even though we don't (yet!) have our own React version of <mux-audio>, you can still use it in your React app. However, if you're also using TypeScript, make sure you add the following TypeScript definitions, since custom elements (like as <mux-audio>) will not be recognized as Intrinsic Elements:

interface MuxAudioHTMLAttributes<T> extends React.AudioHTMLAttributes<T> {
  debug?: boolean;
  autoplay?: boolean;
}

declare global {
  namespace JSX {
    interface IntrinsicElements {
      'mux-audio': React.DetailedHTMLProps<MuxAudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>;
    }
  }
}

Keywords

FAQs

Package last updated on 20 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc