diff options
author | Mario <mario@mariovavti.com> | 2019-04-29 11:58:59 +0200 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-04-29 11:58:59 +0200 |
commit | 674215e9e6632ac22a1b87f9996f0323f5949d94 (patch) | |
tree | 152c71c2b99c337ec3ca35d9644a6fe4ec9ff5a4 /Zotlabs/Module/Wall_attach.php | |
parent | dce6a5763d925e6bf70c6a293be079a05269ce36 (diff) | |
parent | d89d6e8a01ef9af0d300c192367445c385e0252b (diff) | |
download | volse-hubzilla-674215e9e6632ac22a1b87f9996f0323f5949d94.tar.gz volse-hubzilla-674215e9e6632ac22a1b87f9996f0323f5949d94.tar.bz2 volse-hubzilla-674215e9e6632ac22a1b87f9996f0323f5949d94.zip |
Merge branch 'dev' into 'dev'
Add jot videos inline and with poster if possible
See merge request hubzilla/core!1613
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) { |