Added more documentation.

This commit is contained in:
2022-04-16 04:57:34 -05:00
parent bf35220703
commit d2343a611b
8 changed files with 129 additions and 20 deletions

View File

@@ -3,6 +3,8 @@ import SongPlaylist from "./SongPlaylist.js";
/**
* A song with metadata that can be used as part of a {@link SongPlaylist}.
*
* Typically should not be manually instantiated. Instead, create the song via {@link SongPlaylist}.
*/
export default class PlayListSong {
@@ -98,6 +100,8 @@ export default class PlayListSong {
/**
* Begins audio playback as soon as possible.
*
* This function uses the {@link PlaylistSong#getAudio} function and specifically, the {@link AudioEventCallback}.
*/
play() {
this.getAudio((audio) => {
@@ -156,6 +160,9 @@ export default class PlayListSong {
/**
* Unloads the audio data.
* Makes sure the audio is paused.
*
* Also calls {@link PlaylistSong#unloadVisualizer}.
*/
unloadAudio() {
if (!this.isAudioInstantiated()) return;
@@ -186,6 +193,7 @@ export default class PlayListSong {
/**
* Unloads the visualizer.
* Stops the visualizer.
*/
unloadVisualizer() {
this._visualizer.stop();