Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement deeplink commands for the Raycast Extension #48

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

ItsEeleeya
Copy link
Contributor

Solves 28

Added deep-link command support.
The Raycast extension will be able to use these to send commands to Cap.
Currently, you can start/stop recording with specified media devices, as well as open your account's Dashboard.

What needs testing:
Make sure OAuth still works.

To test on macOS, make sure you first build a debug version of the app via pnpm tauri:build --debug and then "install" it. (Putting the resulted .app into your Applications folder.)
Read more about it here
You can find the dmg/app at the path below:
<repo>/apps/desktop/src-tauri/target/universal-apple-darwin/debug/bundle/[dmg | macos]

Then run the app via pnpm dev

The structure of the deep-link scheme is as caprecorder://:command?parameters

Copy and paste the URI below into a browser to try it out:
caprecorder://start-recording?mic_in_label=MacBook%20Pro%20Microphone&vid_in_label=FaceTime%20HD%20Camera

The URI must be encoded. You can also use none as the value for a media device label to disable it.

You can find the source for the extension here

To test the extension, make sure Cap is built with --debug and installed. Then run it in development.
Then in the extension directory, run npm install & npm run dev

Screenshot showing Raycast open with the "Start Recording" command showing a form to select a microphone and camera to launch Cap with.

Copy link

vercel bot commented Jul 4, 2024

@ItsEeleeya is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

@richiemcilroy
Copy link
Contributor

Looks great, got it all working @ItsEeleeya! is it possible to remember the previous mic/webcam state in Raycast when you want to record? or maybe pull the current selected state directly from Cap?

Other than that, think we're ready to go

@ItsEeleeya
Copy link
Contributor Author

Looks great, got it all working @ItsEeleeya! is it possible to remember the previous mic/webcam state in Raycast when you want to record? or maybe pull the current selected state directly from Cap?

Other than that, think we're ready to go

Yes, I believe Raycast has a preserve option for forms and the name of devices can be stored.
The potential downside is if you've removed the selected device since the last time you used the extension, then there could be a slight delay in loading device labels.
(I'm not sure how much faster the built version of the swift code is, with debug it takes a couple of seconds for me)

About pulling the state from Cap, if it's done with deeplinks both apps might flash in and out for a split second so I'm not so sure about it yet.

@ItsEeleeya
Copy link
Contributor Author

Done! Now it caches the devices labels and your selected device.
Since it's using Raycast's default behavior, you need to perform the primary action on the form before it stores the selected devices.
It still shows the loading indicator as it tries to resolve device name.

The changes are here

@ItsEeleeya ItsEeleeya mentioned this pull request Aug 3, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants