opentok-node
opentok-node copied to clipboard
archive.url always null
My files are being saved on s3 and status is uploaded on my tokbox account but when i query for file details using getArchive, the url property is always null
Just started using this library. Everything works nice and straight forward with getArchive - until cloud storage (e.g. s3) is added, and then I had similar confusion.
tl:dr: makes sense, the file was moved somewhere else.
And then, a litany of notes:
After some digging, it probably makes sense, as the file has been moved off the TokBox servers and over to somebody else's storage. I had assumed the files would still be openTok accessible for the 72 hour period, but now my previously working prototype requires me to go figure out s3 APIs for individual user permission downloads and deletes.
Note that delete (at least in the node sdk) no longer removes items from the archive list, and instead returns 'Unexpected response from OpenTok' which after digging has an error from the rest api. Also, cannot modify archive entries, so you cannot sync to any deleted files from the s3 bucket. And the call for listArchives does not seem to respond to a status in the options json. So you'll manage this in your app, too.
I can think of a few things that would help here:
- mention all this in the archiving reference docs wherever setting up s3 is discussed, such as
https://tokbox.com/developer/guides/archiving/using-s3.html
once you setup cloud storage:
- your files will not be available to download from the openTok API any longer.
- calls to delete will return an error
- you should expect to manage archive lists and states in your app
There seem to be two distinct flows supported by OpenTok:
-
When using OpenTok storage,
url
field is alsonull
when the status of archive isuploaded
. This is outlined in the documentation. However, in this flow, OpenTok server sends anotherstatus
–available
. This is when you're supposed to receive theurl
for archive. -
When using external S3 or Azure (only tested with S3),
url
field is alwaysnull
and the archive never shifts toavailable
status. While this is inconsistent with the previous flow, it also makes sense because you basically always know the URL of the file, you only need to know when OpenTok finished uploading to S3.
https://${bucketName}.s3.amazonaws.com/${apiKey}/${archiveId}/archive.mp4