-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚀 Feature: getURLToFile #23
Comments
I had the same issue a week ago. But I had short videos in my case, so the solution was saving files to the cache directory and playing them locally. Maybe it'll work for you too. |
It's a good point. However, in my case I have a large video files so I need stream file functionality. |
@davilico05, does the way you're using the URL allow you to pass headers? If so, you can use |
So we need to make something like let path = "/storage/buckets/\(bucketId)/files/\(fileId)/view"
let headers: [String: Any] = ["x-appwrite-project": projectId]
let url = URL(string: endPoint + path)!
let asset = AVURLAsset(url: url, options: ["AVURLAssetHTTPHeaderFieldsKey": headers]) I think it's would be better to have access to |
@ftp27, you're missing the JWT token as mentioned here: #23 (comment). I've proposed a change to the SDKs to generate the url so you don't need to do: let path = "/storage/buckets/\(bucketId)/files/\(fileId)/view"
let headers: [String: Any] = ["x-appwrite-project": projectId]
let url = URL(string: endPoint + path)! That issue is here: appwrite/sdk-generator#557 But you would still need to create the JWT token. |
I don't need it in my case, so I can't check the "solution" with JWT. When I'm trying to make a token I receive a message with something about the configuration of my dashboard :) |
Ah, if you're file is public then there's no need to create and include a JWT token.
Interesting...maybe you disabled JWT tokens. No worries though if you don't need it. |
🔖 Feature description
I'm playing with appWrite for a personal project. I've using appwrite database and storage.
All great until trying to use AVPlayer...
We need an url to load the video and I have ByteBuffer from SwiftNIO 🫠
It would be great to have and url way to access file.
¿Already it exist any way to load a video from existing getFileView into AVPlayer? ¿Anyone can help me?
Sorry if it is a unnecessary issue on GitHub
🎤 Pitch
Other SDKs like VimeoSDK give you an url with special token of the file requested
appWrite URL:
https://127.0.0.1/v1/storage/buckets/123/files/123/view?project=123
Vimeo URL:
https://127.0.0.1/v1/storage/buckets/123/files/123/view?project=123&token=123
That token include security directives, role, etc. That way allow us (developers) to use the URL for AVPlayer for example without conversions and keep the streaming file (I think they use HLS for video file instead of byte ranges)
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: