tj.playMusicFromStart() plays music loaded with tj.loadMusic(), but always from the start.
If the music is already playing, it will start over.
Most web browsers won't play any music until the user has clicked the page. There is no delay in the enabling of music however, so the music will play if you play it on the same frame as a click.
The following demo shows loading music and then playing it on a button click. Any time you click the play button, the music will start over.
If you'd like to see a demonstration of a range of TinksJS Audio functions, you may like to check out the Audio Player example.
Encouragement Music (encouragement.mp3) | Unnamed author on Free SFX |
---|---|
Free Audio Hosting | DropBox |