mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +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 App\Media;
|
||||||
use League\Fractal;
|
use League\Fractal;
|
||||||
|
use Storage;
|
||||||
|
|
||||||
class MediaTransformer extends Fractal\TransformerAbstract
|
class MediaTransformer extends Fractal\TransformerAbstract
|
||||||
{
|
{
|
||||||
|
@ -28,6 +29,10 @@ class MediaTransformer extends Fractal\TransformerAbstract
|
||||||
'blurhash' => $media->blurhash ?? 'U4Rfzst8?bt7ogayj[j[~pfQ9Goe%Mj[WBay'
|
'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) {
|
if($media->width && $media->height) {
|
||||||
$res['meta'] = [
|
$res['meta'] = [
|
||||||
'focus' => [
|
'focus' => [
|
||||||
|
|
Loading…
Reference in a new issue