aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Wall_attach.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2019-04-27 17:20:38 -0700
committerzotlabs <mike@macgirvin.com>2019-04-27 17:20:38 -0700
commit9536a490b3fc5fc02a6d0a79275e8df03ee8156b (patch)
treee3e52f17fcfe9fa19dce22f8dbd25aef916878d4 /Zotlabs/Module/Wall_attach.php
parent0c1e80320887f9e1152edc4017f0639080ede6cc (diff)
downloadvolse-hubzilla-9536a490b3fc5fc02a6d0a79275e8df03ee8156b.tar.gz
volse-hubzilla-9536a490b3fc5fc02a6d0a79275e8df03ee8156b.tar.bz2
volse-hubzilla-9536a490b3fc5fc02a6d0a79275e8df03ee8156b.zip
Add jot videos inline and with poster if possible
Diffstat (limited to 'Zotlabs/Module/Wall_attach.php')
-rw-r--r--Zotlabs/Module/Wall_attach.php21
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) {