I wracked my brain for a whole day but I did it! I added audio to Jack Dougherty's leaflet storymap.
To do this:
Open your terminal and cd
to the leaflet-storymap
directory
Make a new folder for audio files mkdir audio
Add your audio files to this new folder
Open script.js
Underneath the var source
code add
var audio = $('<audio></audio>', {
src: feature.properties['audio'],
controls: 'controls',
preload: 'auto',
});
Then, below the variables append audio to the container: container.append(chapter).append(image).append(source).append(audio).append(description);
Open data.geojson
After your "source-link"
add "audio": "audio/yourfile.mp3"
Done!
It is not perfect. It is just a simple audio control that needs to have some stylistic adjustments. Also, I would rather have a glyphicon play/pause. I will update once I get that going. But for now, audio is functioning!