diff options
author | Manuel Jiménez Friaza <mjfriaza@openmailbox.org> | 2019-05-19 13:25:00 +0200 |
---|---|---|
committer | Manuel Jiménez Friaza <mjfriaza@openmailbox.org> | 2019-05-19 13:25:00 +0200 |
commit | 429140df97a2c273fba6974147ac2e48e7688263 (patch) | |
tree | 2e337542da1b0f4c9c383dfeb8a7d9eb63990a72 /Zotlabs/Module/Wall_attach.php | |
parent | f92d2e3f7c6573bd7bab04223c7e28662605c6d8 (diff) | |
parent | af2b263bc74b16601ec7c123a58f0549613aed27 (diff) | |
download | volse-hubzilla-429140df97a2c273fba6974147ac2e48e7688263.tar.gz volse-hubzilla-429140df97a2c273fba6974147ac2e48e7688263.tar.bz2 volse-hubzilla-429140df97a2c273fba6974147ac2e48e7688263.zip |
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'Zotlabs/Module/Wall_attach.php')
-rw-r--r-- | Zotlabs/Module/Wall_attach.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Zotlabs/Module/Wall_attach.php b/Zotlabs/Module/Wall_attach.php index 2250e6e44..0ede3ad90 100644 --- a/Zotlabs/Module/Wall_attach.php +++ b/Zotlabs/Module/Wall_attach.php @@ -96,9 +96,26 @@ class Wall_attach extends \Zotlabs\Web\Controller { $s = "\n\n" . $r['body'] . "\n\n"; } else { - $s = "\n\n" . '[attachment]' . $r['data']['hash'] . ',' . $r['data']['revision'] . '[/attachment]' . "\n"; + if(strpos($r['data']['filetype'],'video') === 0) { + // give a wee bit of time for the background thumbnail processor to do its thing + // or else we'll never see a video poster + sleep(3); + $url = z_root() . '/cloud/' . $channel['channel_address'] . '/' . $r['data']['display_path']; + $thumb = Linkinfo::get_video_poster($url); + if($thumb) { + $s = "\n\n" . '[zvideo poster=\'' . $thumb . '\']' . $url . '[/zvideo]' . "\n\n"; + } + else { + $s = "\n\n" . '[zvideo]' . $url . '[/zvideo]' . "\n\n"; + } + } + if(strpos($r['data']['filetype'],'audio') === 0) { + $url = z_root() . '/cloud/' . $channel['channel_address'] . '/' . $r['data']['display_path']; + echo "\n\n" . '[zaudio]' . $url . '[/zaudio]' . "\n\n"; + } + + $s .= "\n\n" . '[attachment]' . $r['data']['hash'] . ',' . $r['data']['revision'] . '[/attachment]' . "\n"; } - $sync = attach_export_data($channel,$r['data']['hash']); if($sync) { |