* Stops all tracks and clears current play data. Removes all * currently playing sounds. Calling stop resets all data on all * tracks regardless of play state for each track. * * @param opts.unload {boolean} Unload sound from memory * * @return Array of sound IDs that
({ state, dispatch }, opts = {})
| 141 | * @return Array of sound IDs that were stopped |
| 142 | */ |
| 143 | async stopAll ({ state, dispatch }, opts = {}) { |
| 144 | const unload = opts.unload |
| 145 | |
| 146 | const stops = Object.keys(state.tracks) |
| 147 | .map(track => dispatch('stopTrack', { track, unload })) |
| 148 | |
| 149 | const ids = await Promise.all(stops) |
| 150 | return ids.flat() |
| 151 | }, |
| 152 | |
| 153 | /** |
| 154 | * Plays the specified track. Track must be valid. Noop when already playing. |
nothing calls this directly
no test coverage detected