opentok / opentok-node

OpenTok Server SDK for node.js
MIT License
165 stars 167 forks source link

archive.url always null #148

Open acellam opened 7 years ago

acellam commented 7 years ago

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

synthmusic commented 6 years ago

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:

pronebird commented 5 years ago

There seem to be two distinct flows supported by OpenTok:

  1. When using OpenTok storage, url field is also null when the status of archive is uploaded. This is outlined in the documentation. However, in this flow, OpenTok server sends another statusavailable. This is when you're supposed to receive the url for archive.

  2. When using external S3 or Azure (only tested with S3), url field is always null and the archive never shifts to available 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