Hi, I have a video file in a S3 bucket. I also have the bucket name, Accesskey og secret keys for it.
How do I set up the htmlviewer in Xojo to play that video ?
loadURL does not work with the url directly then I get access denied… so I have to read/stream it using the access keys/secrets… but don’t know how to set that up with the htmlviewer…
maybe MBS or Chilkat can help, but so far no good…
or are there any trick with i.e. using the access keys and secrets in the url directly ?
you could use our AWSPresignURL function in CURL class and then pass that signed URL to the htmlviewer to load it.
Hi Christian, using your example and set it up like this ?
hw.loadurl(d2.AWSPresignURL(AWSAccessKeyId, AWSSecretAccessKey, Region, Service, Path2, Domain, Verb, 86400, nil,nil))
where d2 and path2 is just a copy of your example, hw = htmlviewer
But doing this with a 5 GB file, just make my app spinning
kevin_g
(kevin g)
March 16, 2022, 1:01pm
4
Has the video been encoded so that it is streamable?
Maybe try putting the signed URL into a web browser to see what that does.
I’ll try that, but I did try a shared version of it from the bucket, but they last only 7 days… and that on played well inside Xojo…
well, does it do the URL correctly?
did you take a look?
you can try the same URL in a normal browser.
Should this get the url ?
call d2.AWSPresignURL(AWSAccessKeyId, AWSSecretAccessKey, Region, Service, Path2, Domain, Verb, 86400, nil,nil)
e = d2.perform
tf.text = d2.OutputData
this gives nothing…
I can not find a GetSignedURL in the options ?
results = 3
d2.debugData gives: MBS Xojo Plugins 21.3 with CURL 7.77.0 on macOS.
kevin_g
(kevin g)
March 16, 2022, 2:09pm
8
AWSPresignURL is a shared method so I think you need to do something like:
myURL = CURLMBS AWSPresignURL(AWSAccessKeyId, AWSSecretAccessKey, Region, Service, Path2, Domain, Verb, 86400)
thanks Kevin, that was the solution… I get so confused about doing call / boolean / string return…etc…
so you say if it is a shared method then I can always use it directly i.e. string = curl shared method ?
kevin_g
(kevin g)
March 16, 2022, 2:34pm
10
Yes, shared methods in Xojo (like static methods in other languages) don’t require an instance of the class to be created.