summaryrefslogtreecommitdiff
path: root/inc/parser/xhtml.php
diff options
context:
space:
mode:
authorAnika Henke <anika@selfthinker.org>2013-08-02 23:53:28 +0100
committerAnika Henke <anika@selfthinker.org>2013-08-02 23:53:28 +0100
commit99f943f68e3a6bd43d9b5b90f39e058ee2acfa9d (patch)
tree258b4b1e8535a9b9033072faa9b97f6f7fee287d /inc/parser/xhtml.php
parent3d7a9e0a1cba0b173b6b03f5c88a8eb975286cc7 (diff)
downloadrpg-99f943f68e3a6bd43d9b5b90f39e058ee2acfa9d.tar.gz
rpg-99f943f68e3a6bd43d9b5b90f39e058ee2acfa9d.tar.bz2
added poster attribute to video if jpg or png with same file name exists
Diffstat (limited to 'inc/parser/xhtml.php')
-rw-r--r--inc/parser/xhtml.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index bb5f6a4d2..8b7405402 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -1278,9 +1278,15 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
// mp4 would be 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"', but Android doesn't like it
$types['mp4'] = '';
$alternatives = media_alternativefiles($src, $extensions);
+ $poster = media_alternativefiles($src, array('jpg', 'png'), true);
+ $posterUrl = '';
+ if (!empty($poster)) {
+ $posterUrl = ml(reset($poster),array('cache'=>$cache),true,'&');
+ }
- // @todo: add poster
- $this->doc .= '<video '.buildAttributes($atts).' controls="controls">'.NL;
+ $this->doc .= '<video '.buildAttributes($atts).' controls="controls"';
+ if ($posterUrl) $this->doc .= ' poster="'.$posterUrl.'"';
+ $this->doc .= '>'.NL;
foreach($alternatives as $ext => $file) {
$url = ml($file,array('cache'=>$cache),true,'&');
$type = $types[$ext];