mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update MediaTransformer, add hls_manifest attribute
This commit is contained in:
parent
4e3e23db36
commit
fac7c3c5e7
1 changed files with 5 additions and 0 deletions
|
@ -4,6 +4,7 @@ namespace App\Transformer\Api;
|
|||
|
||||
use App\Media;
|
||||
use League\Fractal;
|
||||
use Storage;
|
||||
|
||||
class MediaTransformer extends Fractal\TransformerAbstract
|
||||
{
|
||||
|
@ -28,6 +29,10 @@ class MediaTransformer extends Fractal\TransformerAbstract
|
|||
'blurhash' => $media->blurhash ?? 'U4Rfzst8?bt7ogayj[j[~pfQ9Goe%Mj[WBay'
|
||||
];
|
||||
|
||||
if(config('media.hls.enabled') && $media->hls_transcoded_at != null && $media->hls_path) {
|
||||
$res['hls_manifest'] = url(Storage::url($media->hls_path));
|
||||
}
|
||||
|
||||
if($media->width && $media->height) {
|
||||
$res['meta'] = [
|
||||
'focus' => [
|
||||
|
|
Loading…
Reference in a new issue