UNPKG

node-tunein-radio

Version:

NodeJS Module to browse, search and play streams from TuneIn Radio

1,936 lines (1,160 loc) 53.9 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <base data-ice="baseUrl" href="../../"> <title data-ice="title">TuneIn | node-tunein-radio</title> <link type="text/css" rel="stylesheet" href="css/style.css"> <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css"> <script src="script/prettify/prettify.js"></script> <script src="script/manual.js"></script> <meta name="description" content="NodeJS Module to browse, search and play streams from TuneIn Radio"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="node-tunein-radio"><meta property="twitter:description" content="NodeJS Module to browse, search and play streams from TuneIn Radio"></head> <body class="layout-container" data-ice="rootContainer"> <header> <a href="./">Home</a> <a href="identifiers.html">Reference</a> <a href="source.html">Source</a> <div class="search-box"> <span> <img src="./image/search.png"> <span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span> </span> <ul class="search-result"></ul> </div> <a style="position:relative; top:3px;" href="https://github.com/piffio/node-tunein-radio"><img width="20px" src="./image/github.png"></a></header> <nav class="navigation" data-ice="nav"><div> <ul> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/index.js~TuneIn.html">TuneIn</a></span></span></li> </ul> </div> </nav> <div class="content" data-ice="content"><div class="header-notice"> <div data-ice="importPath" class="import-path"><pre class="prettyprint"><code data-ice="importPathCode">import TuneIn from &apos;<span><a href="file/src/index.js.html#lineNumber21">node-tunein-radio</a></span>&apos;</code></pre></div> <span data-ice="access">public</span> <span data-ice="kind">class</span> <span data-ice="source">| <span><a href="file/src/index.js.html#lineNumber21">source</a></span></span> </div> <div class="self-detail detail"> <h1 data-ice="name">TuneIn</h1> <div class="description" data-ice="description"><p>TuneIn class, the main class implementing the module</p> </div> <div data-ice="exampleDocs"> <h4>Example:</h4> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">let tuneinOptions = { protocol: &apos;https&apos;, // Protocol to use, either http or https cacheRequests: true, // Wheter to cache results or not, default false cacheTTL: 1000 * 60 * 60, // Cache TTL, default 5 minutes partnerId: process.env.TUNEIN_PARTNERID, // PartnerID to be used when interacting with the TuneIn API }; let tunein = new TuneIn(tuneinOptions);</code></pre> </div> </div> </div> <div data-ice="constructorSummary"><h2>Constructor Summary</h2><table class="summary" data-ice="summary"> <thead><tr><td data-ice="title" colspan="3">Public Constructor</td></tr></thead> <tbody> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-constructor-constructor">constructor</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>)</span> </p> </div> <div> <div data-ice="description"><p>Constructur for a TuneIn object.</p> </div> </div> </td> <td> </td> </tr> </tbody> </table> </div> <div data-ice="methodSummary"><h2>Method Summary</h2><table class="summary" data-ice="summary"> <thead><tr><td data-ice="title" colspan="3">Public Methods</td></tr></thead> <tbody> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-authenticate">authenticate</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span>*</span></span> </p> </div> <div> <div data-ice="description"><p>Authenticate with supplied username / password, to get access to favorite and customised results</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-browse">browse</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span></span> </p> </div> <div> <div data-ice="description"><p>Browse will browse the TuneIn directory depending on the supplied options paramethers</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-browse_best">browse_best</a></span></span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> </p> </div> <div> <div data-ice="description"><p>Browse the best streams category</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-browse_langs">browse_langs</a></span></span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> </p> </div> <div> <div data-ice="description"><p>Browse streams languages</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-browse_local">browse_local</a></span></span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> </p> </div> <div> <div data-ice="description"><p>Browse the local streams category</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-browse_locations">browse_locations</a></span></span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> </p> </div> <div> <div data-ice="description"><p>Browse streams locations</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-browse_music">browse_music</a></span></span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> </p> </div> <div> <div data-ice="description"><p>Browse the Music streams category</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-browse_podcast">browse_podcast</a></span></span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> </p> </div> <div> <div data-ice="description"><p>Browse the podcasts directory</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-browse_popular">browse_popular</a></span></span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> </p> </div> <div> <div data-ice="description"><p>Browse the popular streams category</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-browse_show">browse_show</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span>*</span></span> </p> </div> <div> <div data-ice="description"><p>Browse a podcast (Show) for episodes details</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-browse_sports">browse_sports</a></span></span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> </p> </div> <div> <div data-ice="description"><p>Browse the sports streams category</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-browse_talk">browse_talk</a></span></span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> </p> </div> <div> <div data-ice="description"><p>Browse the talk streams category</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-describe">describe</a></span></span><span class="code" data-ice="signature">(id: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, nowplaying: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>): <span>*</span></span> </p> </div> <div> <div data-ice="description"><p>Describe a stream.</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-search">search</a></span></span><span class="code" data-ice="signature">(query: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> </p> </div> <div> <div data-ice="description"><p>Search TuneIn for a match</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-tune_radio">tune_radio</a></span></span><span class="code" data-ice="signature">(id: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> </p> </div> <div> <div data-ice="description"><p>Tune a stream.</p> </div> </div> </td> <td> </td> </tr> </tbody> </table> <table class="summary" data-ice="summary"> <thead><tr><td data-ice="title" colspan="3">Private Methods</td></tr></thead> <tbody> <tr data-ice="target"> <td> <span class="access" data-ice="access">private</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-_call_browse">_call_browse</a></span></span><span class="code" data-ice="signature">(options: <span>*</span>, req: <span>*</span>): <span>*</span></span> </p> </div> <div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">private</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-_call_tunein_get">_call_tunein_get</a></span></span><span class="code" data-ice="signature">(req: <span>*</span>): <span>*</span></span> </p> </div> <div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">private</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/index.js~TuneIn.html#instance-method-_call_tunein_post">_call_tunein_post</a></span></span><span class="code" data-ice="signature">(req: <span>*</span>, postData: <span>*</span>): <span>*</span></span> </p> </div> <div> </div> </td> <td> </td> </tr> </tbody> </table> </div> <div data-ice="constructorDetails"><h2 data-ice="title">Public Constructors</h2> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-constructor-constructor"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">constructor</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>)</span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber33">source</a></span></span> </span> </h3> <div data-ice="description"><p>Constructur for a TuneIn object.</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">options</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>this is an options object with all the optionals parameters used to initialise the TuneIn client</p> </td> </tr> </tbody> </table> </div> </div> <div data-ice="example"> <h4>Example:</h4> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">let tuneinOptions = { protocol: &apos;https&apos;, // Protocol to use, either http or https cacheRequests: true, // Wheter to cache results or not, default false cacheTTL: 1000 * 60 * 60, // Cache TTL, default 5 minutes partnerId: process.env.TUNEIN_PARTNERID, // PartnerID to be used when interacting with the TuneIn API };</code></pre> </div> </div> </div> </div> <div data-ice="methodDetails"><h2 data-ice="title">Public Methods</h2> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-authenticate"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">authenticate</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span>*</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber172">source</a></span></span> </span> </h3> <div data-ice="description"><p>Authenticate with supplied username / password, to get access to favorite and customised results</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">options</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>Options to be passed to the POST call, must contain user&apos;s credential</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span>*</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> <div data-ice="example"> <h4>Example:</h4> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">let authOptions = { username: &apos;user@example.com&apos;, password: &apos;secretpassword&apos; }; let auth = tunein.authenticate(authOptions); auth.then(function(results) { console.log(results[0].AccountId); });</code></pre> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-browse"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">browse</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber244">source</a></span></span> </span> </h3> <div data-ice="description"><p>Browse will browse the TuneIn directory depending on the supplied options paramethers</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">options</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>Options object for browsing</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span></td> <td class="return-desc" data-ice="returnDescription"><p>results - A JSON object with results from the remote API</p> </td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-browse_best"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">browse_best</span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber320">source</a></span></span> </span> </h3> <div data-ice="description"><p>Browse the best streams category</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">username</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>Currently ignored</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span>*</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-browse_langs"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">browse_langs</span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber296">source</a></span></span> </span> </h3> <div data-ice="description"><p>Browse streams languages</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">username</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>Currently ignored</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span>*</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-browse_local"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">browse_local</span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber256">source</a></span></span> </span> </h3> <div data-ice="description"><p>Browse the local streams category</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">username</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>Currently ignored</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span>*</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-browse_locations"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">browse_locations</span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber288">source</a></span></span> </span> </h3> <div data-ice="description"><p>Browse streams locations</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">username</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>Currently ignored</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span>*</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-browse_music"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">browse_music</span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber264">source</a></span></span> </span> </h3> <div data-ice="description"><p>Browse the Music streams category</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">username</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>Currently ignored</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span>*</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-browse_podcast"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">browse_podcast</span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber304">source</a></span></span> </span> </h3> <div data-ice="description"><p>Browse the podcasts directory</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">username</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>Currently ignored</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span>*</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-browse_popular"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">browse_popular</span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber312">source</a></span></span> </span> </h3> <div data-ice="description"><p>Browse the popular streams category</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">username</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>Currently ignored</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span>*</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-browse_show"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">browse_show</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>): <span>*</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber230">source</a></span></span> </span> </h3> <div data-ice="description"><p>Browse a podcast (Show) for episodes details</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">options</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>Options object including the show ID</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span>*</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> <div data-ice="example"> <h4>Example:</h4> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">let showOptions = { c: &apos;pbrowse&apos;, id: &apos;p191418&apos; }; let show = tunein.browse_show(showOptions); show.then(function(results) { console.log(results); });</code></pre> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-browse_sports"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">browse_sports</span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber280">source</a></span></span> </span> </h3> <div data-ice="description"><p>Browse the sports streams category</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">username</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>Currently ignored</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span>*</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-browse_talk"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">browse_talk</span><span class="code" data-ice="signature">(username: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber272">source</a></span></span> </span> </h3> <div data-ice="description"><p>Browse the talk streams category</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">username</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>Currently ignored</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span>*</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-describe"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">describe</span><span class="code" data-ice="signature">(id: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, nowplaying: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>): <span>*</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber146">source</a></span></span> </span> </h3> <div data-ice="description"><p>Describe a stream. This method will retrieve detailed information about a stream.</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">id</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>The ID of the stream to fetch information for</p> </td> </tr> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">nowplaying</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>If true it also fetches information about the show being currently aired</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span>*</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-search"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">search</span><span class="code" data-ice="signature">(query: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber70">source</a></span></span> </span> </h3> <div data-ice="description"><p>Search TuneIn for a match</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">query</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>a query string to search for in the TuneIn catalog</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span>*</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> <div data-ice="example"> <h4>Example:</h4> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">let queryString = &apos;rai radio&apos;; let search = tunein.search(queryString); search.then(function(results) { console.log(results); });</code></pre> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-tune_radio"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">tune_radio</span><span class="code" data-ice="signature">(id: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber130">source</a></span></span> </span> </h3> <div data-ice="description"><p>Tune a stream. This will return an object containing details for the specific stream, including URL and format.</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">id</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>The ID of the stream to tune, usually resulting from a browsing or a search call</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span>*</span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <h2 data-ice="title">Private Methods</h2> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-_call_browse"> <span class="access" data-ice="access">private</span> <span class="code" data-ice="name">_call_browse</span><span class="code" data-ice="signature">(options: <span>*</span>, req: <span>*</span>): <span>*</span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/index.js.html#lineNumber186">source</a></span></span> </span> </h3> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">options</td> <td data-ice="type" class="code"><span>*</span></td> <td data-ice="appendix"></td> <td data-ice="description"></td> </tr> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">req</td> <td data-ice="type" class="code"><span>*</span></td> <td data-ice="appendix"></td> <td data-ice="description"></td> </tr> </tbody> </table> </div> <