icecast-metadata-js

Javascript library that reads, parses, and queues real-time metadata from an Icecast stream.


Icecast Metadata Player "Bare Minimum" HTML Demo Source for this demo

This module is a part of icecast-metadata-js. See the links in the header for more information.

This page demonstrates the bare-minimum usage of the IcecastMetadataPlayer module. See the other demo links in the header for more detailed examples.

Usage / Example
  1. Download the latest build, or install via NPM.
  2. Include the file in a <script> tag in your html.
  3. IcecastMetadataPlayer is made available as a global variable in your webpage to use wherever.
  4. Checkout the README for more information.
Example
    <script src="icecast-metadata-player-1.17.2.main.min.js"></script>
    <script>
      const onMetadata = (metadata) => {
        document.getElementById("metadata").innerHTML = metadata.StreamTitle;
      };
      const player = 
        new IcecastMetadataPlayer(
          "https://dsmrad.io/stream/isics-all", // stream endpoint
          { onMetadata }                        // options (onMetadata callback)
        );
    </script>
    <body>
      <button onclick="player.play();"> Play </button>
      <button onclick="player.stop();"> Stop </button>
      <p> Now Playing: <span id="metadata"></span> </p>
    </body>
  


Now Playing