diff --git a/README.md b/README.md index 6a11979..09f65b7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # kirbytag html5video -by jtByt.Pictures, Jannik Beyerstedt from Hamburg, Germany -[jannik.beyerstedt.de](http://jannik.beyerstedt.de) | [Github](https://github.com/jbeyerstedt) +by Jannik Beyerstedt from Hamburg, Germany +[jannikbeyerstedt.de](http://jannikbeyerstedt.de) | [Github](https://github.com/jbeyerstedt) ## responsive html5 video player for lazy people diff --git a/html5video.php b/html5video.php index 5ebb992..45c7da4 100644 --- a/html5video.php +++ b/html5video.php @@ -2,13 +2,14 @@ /* * kirbytag html5video * html5 video player embedding for lazy people - * + * * copyright: Jannik Beyerstedt | http://jannikbeyerstedt.de | code@jannikbeyerstedt.de * license: http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 License * - * version 2.0 (03.11.2014) + * version 2.1 (06.04.2015) * changelog: * - v2.0: kirby 2 support + * - v2.1: fix broken default values */ kirbytext::$tags['html5video'] = array( @@ -19,37 +20,37 @@ ), 'html' => function($tag) { $source = $tag->attr('html5video'); - + $baseurl = url('/video/'); $posterurl = $baseurl . urlencode($source) . '-poster.png'; - - - - if ($tag->attr('hls') == true) { + + + if ($tag->attr('hls') == null || $tag->attr('hls') == true ) { $hlsurl = $baseurl . urlencode($source) . '-hls/' . urlencode($source) . '-index.m3u8'; $hlssource = '';} else { $hlssource = "";} - - if ($tag->attr('h264') == true) { + + if ($tag->attr('hls') == null || $tag->attr('h264') == true) { $mp4url = $baseurl . urlencode($source) . '-h264.mp4'; $mp4source = '';} else { $mp4source = "";} - - if ($tag->attr('webm') == true) { - $webmurl = $baseurl . urlencode($source) . '-webm.webm'; + + if ($tag->attr('hls') == null || $tag->attr('webm') == true) { + $webmurl = $baseurl . urlencode($source) . '-webm.webm'; $webmsource = '';} else { $webmsource = "";} - - return '