wulkano / Kap

An open-source screen recorder built with web technology
https://getkap.co
MIT License
18.07k stars 825 forks source link

Plugin authoring #797

Open jsejcksn opened 4 years ago

jsejcksn commented 4 years ago

I just finished writing a gfycat plugin for Kap and the experience made me consider a couple of things about the system:

Does anyone have thoughts about these and how they might be addressed?

karaggeorge commented 4 years ago

Thid-party processing

I think the way you did it is correct. Any part of the action after converting the file is not blocking. As in, Kap will move on to the next export while this is happening. So I would assume the action would set an indeterminate progress with a status of Processing and poll the endpoint until it's ready. If the status comes as error, then it can fail. But if it's still processing I would assume the polling would continue without giving up

Messaging

We can add an action to the notification, as an optional second parameter, which will be called when the notification is clicked

Tests

If you are asking about testing the integration of the plugin with Kap, you can look into, you can look how to utilize the test modules we have available in this example

sindresorhus commented 4 years ago

But if it's still processing I would assume the polling would continue without giving up

It should give up at some point though and show a timeout error. However, it's really up to the plugin author to decide how long it should try before timing out.

We can add an action to the notification, as an optional second parameter, which will be called when the notification is clicked

👍

jsejcksn commented 4 years ago

But if it's still processing I would assume the polling would continue without giving up

It should give up at some point though and show a timeout error. However, it's really up to the plugin author to decide how long it should try before timing out.

Do you have a recommendation for your UX guidelines?

Currently, I wait for up to 1 min—and then, if it's still processing, I return the link to the unprocessed upload in the clipboard, informing the user of the unprocessed state in a notification.

sindresorhus commented 4 years ago

@jsejcksn Hmm, I think I would either return the URL to the unprocessed upload almost right away or just wait until it's completely done. Does images too also need processing?

jsejcksn commented 4 years ago

Does images too also need processing?

I'm not sure what you mean by this.

sindresorhus commented 4 years ago

Do GIFs also need processing? I'm just trying to get a clear picture on how it works. Because if not, or if they have a very short processing time, I would wait for it.

jsejcksn commented 4 years ago

Ah, I see. I have not found any documentation that indicates a relationship between filetype and processing time. In my experience, pixels and frames have more effect on processing time.

jsejcksn commented 4 years ago

I want to include this idea here:

It'd be nice to have a way to show the user something like a log of temporary, but persisting information which can include links. Like if the export progress window had a "details" view for each export that could be expanded and could be directly linked to from notifications.