improve quickstart tutorial
This commit is contained in:
parent
e8f97b8cae
commit
9d2db78c98
1 changed files with 19 additions and 12 deletions
|
@ -7,23 +7,16 @@ console.log(radio.getName())
|
||||||
```
|
```
|
||||||
|
|
||||||
Now we have `radio`, a {@link Radio} object, which can be seen as the "center" of our data. From here, we can
|
Now we have `radio`, a {@link Radio} object, which can be seen as the "center" of our data. From here, we can
|
||||||
get more data. How about this?
|
get more data.
|
||||||
|
|
||||||
```javascript
|
|
||||||
const show = radio.getShowAtTime()
|
|
||||||
if (show !== null) {
|
|
||||||
console.log(show.getName())
|
|
||||||
} else {
|
|
||||||
console.log("Nothing special going on right now, sorry")
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Streaming
|
## Streaming
|
||||||
|
|
||||||
The first thing we could want to do is just to *play* the radio.
|
The first thing we could want to do is just to *play* the radio. Let's use the {@link RadioStreaming#pickURLs
|
||||||
|
RadioStreaming.pickURLs} method then
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var urls = await radio.pickURLs()
|
var streaming = radio.getStreaming()
|
||||||
|
var urls = await streaming.pickURLs()
|
||||||
console.log(urls)
|
console.log(urls)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -40,6 +33,20 @@ for more details.
|
||||||
var shows = radio.getShows()
|
var shows = radio.getShows()
|
||||||
console.log(shows.map(s => s.getName()))
|
console.log(shows.map(s => s.getName()))
|
||||||
```
|
```
|
||||||
|
## Schedule
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const show = radio.getShowAtTime()
|
||||||
|
if (show !== null) {
|
||||||
|
console.log(show.getName())
|
||||||
|
} else {
|
||||||
|
console.log("Nothing special going on right now, sorry")
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
{@link Radio#getShowAtTime getShowAtTime} is a shortcut, but using {@link Radio#getSchedule} you'll get a nice
|
||||||
|
{@link RadioSchedule}, which has many useful methods to get meaningful information about what's going on right
|
||||||
|
now and {@link RadioSchedule#getNextShow what will go on next}
|
||||||
|
|
||||||
## Conclusions
|
## Conclusions
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue