Javascript library that reads, parses, and queues real-time metadata from an Icecast stream.
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.
<script src="icecast-metadata-player-1.17.6.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>
audio
element to play the stream.