Skip to content

🚀 Feature: Url to view file in addition to uInt8List #63

Closed as not planned

Description

@hey-nicolasklein

🔖 Feature description

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?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Activity

  1. lohanidamodar commented on May 26, 2022

    @lohanidamodar
    Member

    @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.

  2. hey-nicolasklein commented on Jun 10, 2022

    @hey-nicolasklein
    Author

    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?

  3. lohanidamodar commented on Jun 13, 2022

    @lohanidamodar
    Member

    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.

  4. hey-nicolasklein commented on Jun 14, 2022

    @hey-nicolasklein
    Author

    Can you explain what you mean by putting project as the query parameter?
    You mean like ...{fileId}/preview?jwt=token?project=[PROJECT_ID]?

  5. lohanidamodar commented on Jun 19, 2022

    @lohanidamodar
    Member

    Yes like this.
    ..{fileId}/preview?jwt=token&project=[PROJECT_ID]?

  6. hey-nicolasklein commented on Jul 11, 2022

    @hey-nicolasklein
    Author

    Can I get the JWT Token from the current session (in the Flutter SDK)?

  7. lohanidamodar commented on Jul 14, 2022

    @lohanidamodar
    Member

    Can I get the JWT Token from the current session (in the Flutter SDK)?

    You can by calling account.createJWT after you have an active session

  8. stnguyen90 commented on Jul 14, 2022

    @stnguyen90
    Contributor

    Closing as no further action is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions