mdobler
September 7, 2023, 1:34pm
1
I’ve a problem with videos.
When I load pictures I use a thumb server route. So I give the file:// and in responds I get a picture.
https://mdobler.uber.space/thumbserver/file://YkHGh8l1ebSzycJt?size_id=3
This is my input! And when I open this link I get a picture direkt in the browser or in other words my mobile app loads the picture. Works like a charm.
Now my question. Is there any way to do the same with a video?
texnixe
September 7, 2023, 2:00pm
2
Do you mean create different versions of video files, similar to how you can select different video types and resolutions from YouTube and the like?
mdobler
September 7, 2023, 2:18pm
3
No, if you klick my link the picture opens in the browser!
I just would like a link opening a video direkt in the browser. No modifications needed.
At the moment I use this:
https://mdobler.uber.space/videourl/file://oQVwrPm9GM4R4HVz
But then I’ve to load the location in my app. Would be great to get the video direct
texnixe
September 7, 2023, 2:55pm
4
The problem is that to display a video, you need an html video tag, not just a link to a file
mdobler
September 7, 2023, 3:23pm
5
When I call a video directly its playing without any html:
https://mdobler.uber.space/1.mp4
texnixe
September 7, 2023, 6:39pm
6
Please post the code for this route.
mdobler
September 8, 2023, 3:27am
7
At the moment, I’m getting the url from the file and return it as a json. Here is my code:
//
// video url
//
[
'pattern' => 'videourl/(:any)',
'action' => function ($fileUuid) {
$file = site()->index()->files()->findBy('uuid', 'file://' . $fileUuid);
$videoUrl = $file->url();
$json = '{"video_url":"'.$videoUrl.'"}';
return $json;
}
],