You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🚀 Feature: Url to view file in addition to uInt8List #63
I'm currently developing a Flutter App for mobile, web and desktop. Each platform has it's unique challenges. Currently I'm trying to play video from my appwrite backend. While it is no problem to create a local file from a byteList on mobile and play a video from it, there is no play from file on web.
Of course, I can call the appwrite rest Api with the /view directive and view the file in my browser. What about some way to get the URL to pass it to a audio or video player on web.
As I can see, the getFileDownload and getFileView methods do basically the same thing in the Appwrite Flutter SDK.
🎤 Pitch
What if getFileView would actually return a URL to access the File. The URL could be passed to any Video or Audio Player package and would make the appwrite flutter sdk work better on web.
👀 Have you spent some time to check if this issue has been raised before?
Hey @lohanidamodar thanks for the trick. But I really would like to use authentication. My project guidelines do not allow to make the files public. Is there any other solution?
Hey @lohanidamodar thanks for the trick. But I really would like to use authentication. My project guidelines do not allow to make the files public. Is there any other solution?
Generating JWT for user and passing jwt=token in the preview endpoint along with project as the query parameter might work (not completely sure). But we are working on solving this automatically in the SDKs as well.
Activity
lohanidamodar commentedon May 26, 2022
@hey-nicolasklein For now you can construct the URL yourself easily. Here's the trick
[YOUR_ENDPOINT]/storage/buckets/{bucketId}/files/{fileId}/preview?project=[PROJECT_ID].Make sure to use the endpoint. If you do this, you need to make the file public.
hey-nicolasklein commentedon Jun 10, 2022
Hey @lohanidamodar thanks for the trick. But I really would like to use authentication. My project guidelines do not allow to make the files public. Is there any other solution?
lohanidamodar commentedon Jun 13, 2022
Generating JWT for user and passing
jwt=tokenin the preview endpoint along withprojectas the query parameter might work (not completely sure). But we are working on solving this automatically in the SDKs as well.hey-nicolasklein commentedon Jun 14, 2022
Can you explain what you mean by putting project as the query parameter?
You mean like
...{fileId}/preview?jwt=token?project=[PROJECT_ID]?lohanidamodar commentedon Jun 19, 2022
Yes like this.
..{fileId}/preview?jwt=token&project=[PROJECT_ID]?hey-nicolasklein commentedon Jul 11, 2022
Can I get the JWT Token from the current session (in the Flutter SDK)?
lohanidamodar commentedon Jul 14, 2022
You can by calling
account.createJWTafter you have an active sessionstnguyen90 commentedon Jul 14, 2022
Closing as no further action is required.