Closed PJStation closed 3 months ago
Hi @PJStation If you want to get URL and e.g. embed it on your page you can use getEmbedLink function. Alternatively, you could look into shared links if they fit your use case.
Hi @PJStation If you want to get URL and e.g. embed it on your page you can use getEmbedLink function. Alternatively, you could look into shared links if they fit your use case.
getEmbedLink Link cannot be played shared links rerturn failure
Could you provide more details about what you are trying to achieve? Perhaps you could also provide an sample code (example project) so we can see what's the issue.
Could you provide more details about what you are trying to achieve? Perhaps you could also provide an sample code (example project) so we can see what's the issue.
//get a mp4 file
client.files.getEmbedLink(forFile: file.id) { result in
switch result {
case let .success(expiringEmbedLink):
var options = [String : Any]()
options["AVURLAssetHTTPHeaderFieldsKey"] = ["Authorization": "Bearer \(expiringEmbedLink.token!.accessToken!)"]
let asset = AVURLAsset(url: expiringEmbedLink.url!,options: options)
if asset.isPlayable {
print("isPlayable")
} else {
print("not playable")
}
break
case let .failure(error):
break
}
}
isPlayable always false
Hi @PJStation
Can you try with this url scheme: https://api.box.com/2.0/files/:file_id:/content
and attach with your access token in the header.
Let me know if it's working.
Best, Minh
https://api.box.com/2.0/files/:file_id:/content Thanks,it's working!
how to get streaming video URL from Box via ios BoxSDK 5.6.0