Last active
March 26, 2018 12:08
-
-
Save fanningert/0bf714b2f6fd29a88c61 to your computer and use it in GitHub Desktop.
HTML5 audio tag for Kirby CMS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* Install | |
* ======= | |
* Move this file to /site/snippets/ and rename it audio.php | |
* | |
* @author: Thomas Fanninger <[email protected]> | |
* @version: 0.3 | |
*/ | |
?> | |
<audio<?php echo (!empty($preload))?' preload="'.$preload.'"':''; ?><?php echo ($controls)?' controls="constrols"':''; ?><?php echo ($loop)?' loop="loop"':''; ?><?php echo ($autoplay)?' autoplay="autoplay"':''; ?><?php echo ($muted)?' muted="muted"':''; ?><?php echo (!empty($class))?' class="'.$class.'"':''; ?>> | |
<?php if(!empty($mp3)) { ?> | |
<source src="<?php echo $mp3; ?>" type="audio/mpeg"/> | |
<?php } ?> | |
<?php if(!empty($ogg)){ ?> | |
<source src="<?php echo $ogg; ?>" type="audio/ogg"/> | |
<?php } ?> | |
<?php if(!empty($wav)){ ?> | |
<source src="<?php echo $wav; ?>" type="audio/wav"/> | |
<?php } ?> | |
Your browser does not support the <code>audio</code> element. | |
</audio> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment