Html5 audio in item

Hello, I am trying to create a digital library for the 78rpm discography in Greece, I am having the MP3s in an external site that i am also personally maintaining and I want to refer to them with something like in order for an html5 player to appear in the item.

Is this possible? I do not want to download them and upload them in Omeka as media files, as this would double the effort and also the storage needs, as the files are already in an external http accesible database.

You can do this pretty easily with a customized theme by putting the URL to the external media in a metadata field and then displaying that using HTML5’s audio tag. But of course that requires a little coding.

Thank you. Is there a reference URL in Omeka’s documentation on how I start customizing a theme according to your suggestion?

Hello.

You can find details on HTML Audio tag here:

In order to use it in your custom theme (say, f.i., in your items/show.php file), if you were saving the external URL in the DC:Source element, you would then want to retrieve that value and pass it to the audio tag as its src property. Something like this, maybe:

<audio controls>
	<source src="<?php echo metadata('item', array('Dublin Core', 'Source')); ?>" type="audio/mpeg">
	Your browser does not support the audio element.
</audio>

You might want to additionally check that you’re actually passing an mp3 file to the control.

Hope this helps.

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.