Controlling volume through links


#1

I develop one of the syrinscape extensions for Fantasy Grounds. In the recent post on Roll20, Ben mentioned being able to adjust volume via links. Is this possible to trigger via the syrinscape-online:// links that the player picks up? or only through the REST API? If it is possible, can I get some information on how to format the links to do the adjustment.

thanks


#2

Sorry @mattekure, we missed this one!

I’ll ask @sonofconan to send over the details :slight_smile:


#3

@mattekure We do not have any official API documentation to release right now. If you open Chrome dev tools while using the master interface and filter by XHR, then trigger some actions (e.g. change element volume) you will see the necessary call.

For example, changing an element volume triggers a POST request to /online/frontend-api/elements/357/set_current_volume/ with a payload {"current_volume":0.34}.

Changing the global volume triggers a PATCH request to /online/frontend-api/state/global/ with a payload {"volume":0.51}.

You could make these calls from FG, if FG is able to make POST and PATCH requests, and you add an auth_token to the URL.

I suspect that FG is unable to make these requests directly, and passing URLs to the OS to handle would open a browser window.

Our bundled (on Windows) proxy application that handles syrinscape-online:// URLs will only make a HEAD request to our server and cannot currently be used for other API calls.

I’ll add this to our list as a feature request, but I don’t know when we might get to it. Strong integrations with 3rd parties are important to us, though.


#4

Thanks for the info. FG currently does not have the capability to do POST or PATCH requests natively, but I have requested that functionality be added. If/when the ability gets added to either FG or the proxy application, I will be sure to add a volume control to the FG extension.