Last active
August 29, 2015 14:26
-
-
Save samnabi/c4f023543b7ad8fe080d to your computer and use it in GitHub Desktop.
Kirbytext extension for Gfycat
This file contains 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 | |
kirbytext::$tags['gfycat'] = array( | |
'html' => function($tag) { | |
$gfyID = $tag->attr('gfycat'); | |
return '<video poster="//thumbs.gfycat.com/'.$gfyID.'-poster.jpg" loop autoplay mute> | |
<source id="webmsource" type="video/webm" src="//zippy.gfycat.com/'.$gfyID.'.webm"></source> | |
<source id="mp4source" type="video/mp4" src="//fat.gfycat.com/'.$gfyID.'.mp4"></source> | |
<img src="//giant.gfycat.com/'.$gfyID.'.gif"></img> | |
</video>'; | |
} | |
); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/site/tags/gfycat.php
(gfycat: ExhaustedVapidGorilla)
Gfycat's regular embed code uses an
iframe
and other superfluous code. This Kirbytext extension strips it down to the nativevideo
element.