Add jot videos inline and with poster if possible
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user