icecast-metadata-player
Advanced tools
Comparing version 1.17.5 to 1.17.6
{ | ||
"name": "icecast-metadata-player", | ||
"version": "1.17.5", | ||
"version": "1.17.6", | ||
"description": "Simple to use Javascript class that plays an Icecast stream with real-time metadata updates", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -81,11 +81,11 @@ # Icecast Metadata Player | ||
| - | - | | ||
| <a href="https://raw.githubusercontent.com/eshaz/icecast-metadata-js/master/src/icecast-metadata-player/build/icecast-metadata-player-1.17.5.main.min.js" download>`icecast-metadata-player-1.17.5.main.min.js`</a> | Core functionality (playback, metadata) <br> **Use this file in your `<script>` tag** | | ||
| <a href="https://raw.githubusercontent.com/eshaz/icecast-metadata-js/master/src/icecast-metadata-player/build/icecast-metadata-player-1.17.5.synaudio.min.js" download>`icecast-metadata-player-1.17.5.synaudio.min.js`</a> | Gapless playback support | | ||
| <a href="https://raw.githubusercontent.com/eshaz/icecast-metadata-js/master/src/icecast-metadata-player/build/icecast-metadata-player-1.17.5.mediasource.min.js" download>`icecast-metadata-player-1.17.5.mediasource.min.js`</a> | Mediasource playback support | | ||
| <a href="https://raw.githubusercontent.com/eshaz/icecast-metadata-js/master/src/icecast-metadata-player/build/icecast-metadata-player-1.17.5.mpeg.min.js" download>`icecast-metadata-player-1.17.5.mpeg.min.js`</a> | MPEG playback support (webaudio) | | ||
| <a href="https://raw.githubusercontent.com/eshaz/icecast-metadata-js/master/src/icecast-metadata-player/build/icecast-metadata-player-1.17.5.flac.min.js" download>`icecast-metadata-player-1.17.5.flac.min.js`</a> | FLAC playback support (webaudio) | | ||
| <a href="https://raw.githubusercontent.com/eshaz/icecast-metadata-js/master/src/icecast-metadata-player/build/icecast-metadata-player-1.17.5.opus.min.js" download>`icecast-metadata-player-1.17.5.opus.min.js`</a> | Opus playback support (webaudio) | | ||
| <a href="https://raw.githubusercontent.com/eshaz/icecast-metadata-js/master/src/icecast-metadata-player/build/icecast-metadata-player-1.17.5.vorbis.min.js" download>`icecast-metadata-player-1.17.5.vorbis.min.js`</a> | Vorbis playback support (webaudio) | | ||
| <a href="https://raw.githubusercontent.com/eshaz/icecast-metadata-js/master/src/icecast-metadata-player/build/icecast-metadata-player-1.17.5.common.min.js" download>`icecast-metadata-player-1.17.5.common.min.js`</a> | Common functions (webaudio) | | ||
2. Add a `<script>` tag referencing `icecast-metadata-player-1.17.5.main.min.js` in your html. | ||
| <a href="https://raw.githubusercontent.com/eshaz/icecast-metadata-js/master/src/icecast-metadata-player/build/icecast-metadata-player-1.17.6.main.min.js" download>`icecast-metadata-player-1.17.6.main.min.js`</a> | Core functionality (playback, metadata) <br> **Use this file in your `<script>` tag** | | ||
| <a href="https://raw.githubusercontent.com/eshaz/icecast-metadata-js/master/src/icecast-metadata-player/build/icecast-metadata-player-1.17.6.synaudio.min.js" download>`icecast-metadata-player-1.17.6.synaudio.min.js`</a> | Gapless playback support | | ||
| <a href="https://raw.githubusercontent.com/eshaz/icecast-metadata-js/master/src/icecast-metadata-player/build/icecast-metadata-player-1.17.6.mediasource.min.js" download>`icecast-metadata-player-1.17.6.mediasource.min.js`</a> | Mediasource playback support | | ||
| <a href="https://raw.githubusercontent.com/eshaz/icecast-metadata-js/master/src/icecast-metadata-player/build/icecast-metadata-player-1.17.6.mpeg.min.js" download>`icecast-metadata-player-1.17.6.mpeg.min.js`</a> | MPEG playback support (webaudio) | | ||
| <a href="https://raw.githubusercontent.com/eshaz/icecast-metadata-js/master/src/icecast-metadata-player/build/icecast-metadata-player-1.17.6.flac.min.js" download>`icecast-metadata-player-1.17.6.flac.min.js`</a> | FLAC playback support (webaudio) | | ||
| <a href="https://raw.githubusercontent.com/eshaz/icecast-metadata-js/master/src/icecast-metadata-player/build/icecast-metadata-player-1.17.6.opus.min.js" download>`icecast-metadata-player-1.17.6.opus.min.js`</a> | Opus playback support (webaudio) | | ||
| <a href="https://raw.githubusercontent.com/eshaz/icecast-metadata-js/master/src/icecast-metadata-player/build/icecast-metadata-player-1.17.6.vorbis.min.js" download>`icecast-metadata-player-1.17.6.vorbis.min.js`</a> | Vorbis playback support (webaudio) | | ||
| <a href="https://raw.githubusercontent.com/eshaz/icecast-metadata-js/master/src/icecast-metadata-player/build/icecast-metadata-player-1.17.6.common.min.js" download>`icecast-metadata-player-1.17.6.common.min.js`</a> | Common functions (webaudio) | | ||
2. Add a `<script>` tag referencing `icecast-metadata-player-1.17.6.main.min.js` in your html. | ||
3. `IcecastMetadataPlayer` is made available as a global variable in your webpage to use wherever. | ||
@@ -96,3 +96,3 @@ | ||
```html | ||
<script src="icecast-metadata-player-1.17.5.main.min.js"></script> | ||
<script src="icecast-metadata-player-1.17.6.main.min.js"></script> | ||
<script> | ||
@@ -442,3 +442,3 @@ const onMetadata = (metadata) => { | ||
IcecastMetadataPlayer builds are supplied with a source map, which allows the minified code to be viewed as fully formatted code in a browser debugger. | ||
* To enable the source map, simply copy `icecast-metadata-player-1.17.5.min.js.map` located in the build folder of this project to the location along side `icecast-metadata-player-1.17.5.min.js` in your website. | ||
* To enable the source map, simply copy `icecast-metadata-player-1.17.6.min.js.map` located in the build folder of this project to the location along side `icecast-metadata-player-1.17.6.min.js` in your website. | ||
* The source map can be used to step through and debug the code as well as see the full variable names and file origin on stack traces if you are facing any issues. | ||
@@ -445,0 +445,0 @@ |
@@ -127,2 +127,3 @@ import { | ||
const headers = instanceVariables[hasIcy] ? { "Icy-MetaData": 1 } : {}; | ||
// Work around for Icecast implementations that require range | ||
headers["Range"] = "bytes=0-"; | ||
@@ -136,6 +137,18 @@ | ||
const res = await fetch(this._endpoint, { | ||
method: "GET", | ||
headers, | ||
signal: instanceVariables[abortController].signal, | ||
const request = () => | ||
fetch(this._endpoint, { | ||
method: "GET", | ||
headers, | ||
signal: instanceVariables[abortController].signal, | ||
}); | ||
const res = await request().catch((e) => { | ||
// work around for Safari desktop to remove Range header for CORS | ||
// Even though it's a safelisted header, and this shouldn't be needed | ||
// See: https://fetch.spec.whatwg.org/#cors-safelisted-request-header | ||
if (e.name === "TypeError" && e.message === "Load failed") { | ||
delete headers["Range"]; | ||
return request(); | ||
} | ||
throw e; | ||
}); | ||
@@ -142,0 +155,0 @@ |
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
1470503
4587