mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Mention the OBS version requirement in the docos
This commit is contained in:
@ -3287,6 +3287,67 @@
|
||||
"lead": "",
|
||||
"type": "class",
|
||||
"examples": []
|
||||
},
|
||||
{
|
||||
"subheads": [],
|
||||
"description": "Open a projector window or create a projector on a monitor. Requires OBS v24.0.4 or newer.",
|
||||
"param": [
|
||||
"{String (Optional)} `type` Type of projector: Preview (default), Source, Scene, StudioProgram, or Multiview (case insensitive).",
|
||||
"{int (Optional)} `monitor` Monitor to open the projector on. If -1 or omitted, opens a window.",
|
||||
"{String (Optional)} `geometry` Size and position of the projector window (only if monitor is -1). Encoded in base 64.",
|
||||
"{String (Optional)} `name` Name of the source or scene to be displayed (ignored for other projector types)."
|
||||
],
|
||||
"api": "requests",
|
||||
"name": "OpenProjector",
|
||||
"category": "general",
|
||||
"since": "4.7.0",
|
||||
"params": [
|
||||
{
|
||||
"type": "String (Optional)",
|
||||
"name": "type",
|
||||
"description": "Type of projector: Preview (default), Source, Scene, StudioProgram, or Multiview (case insensitive)."
|
||||
},
|
||||
{
|
||||
"type": "int (Optional)",
|
||||
"name": "monitor",
|
||||
"description": "Monitor to open the projector on. If -1 or omitted, opens a window."
|
||||
},
|
||||
{
|
||||
"type": "String (Optional)",
|
||||
"name": "geometry",
|
||||
"description": "Size and position of the projector window (only if monitor is -1). Encoded in base 64."
|
||||
},
|
||||
{
|
||||
"type": "String (Optional)",
|
||||
"name": "name",
|
||||
"description": "Name of the source or scene to be displayed (ignored for other projector types)."
|
||||
}
|
||||
],
|
||||
"names": [
|
||||
{
|
||||
"name": "",
|
||||
"description": "OpenProjector"
|
||||
}
|
||||
],
|
||||
"categories": [
|
||||
{
|
||||
"name": "",
|
||||
"description": "general"
|
||||
}
|
||||
],
|
||||
"sinces": [
|
||||
{
|
||||
"name": "",
|
||||
"description": "4.7.0"
|
||||
}
|
||||
],
|
||||
"heading": {
|
||||
"level": 2,
|
||||
"text": "OpenProjector"
|
||||
},
|
||||
"lead": "",
|
||||
"type": "class",
|
||||
"examples": []
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
|
@ -118,6 +118,7 @@ auth_response = base64_encode(auth_response_hash)
|
||||
+ [GetStats](#getstats)
|
||||
+ [BroadcastCustomMessage](#broadcastcustommessage-1)
|
||||
+ [GetVideoInfo](#getvideoinfo)
|
||||
+ [OpenProjector](#openprojector)
|
||||
* [Outputs](#outputs)
|
||||
+ [ListOutputs](#listoutputs)
|
||||
+ [GetOutputInfo](#getoutputinfo)
|
||||
@ -1332,6 +1333,29 @@ _No specified parameters._
|
||||
| `colorRange` | _String_ | Color range (full or partial) |
|
||||
|
||||
|
||||
---
|
||||
|
||||
### OpenProjector
|
||||
|
||||
|
||||
- Added in v4.7.0
|
||||
|
||||
Open a projector window or create a projector on a monitor. Requires OBS v24.0.4 or newer.
|
||||
|
||||
**Request Fields:**
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | :---: | ------------|
|
||||
| `type` | _String (Optional)_ | Type of projector: Preview (default), Source, Scene, StudioProgram, or Multiview (case insensitive). |
|
||||
| `monitor` | _int (Optional)_ | Monitor to open the projector on. If -1 or omitted, opens a window. |
|
||||
| `geometry` | _String (Optional)_ | Size and position of the projector window (only if monitor is -1). Encoded in base 64. |
|
||||
| `name` | _String (Optional)_ | Name of the source or scene to be displayed (ignored for other projector types). |
|
||||
|
||||
|
||||
**Response Items:**
|
||||
|
||||
_No additional response items._
|
||||
|
||||
---
|
||||
|
||||
## Outputs
|
||||
|
@ -300,7 +300,7 @@ HandlerResponse WSRequestHandler::HandleGetVideoInfo(WSRequestHandler* req) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a projector window or create a projector on a monitor.
|
||||
* Open a projector window or create a projector on a monitor. Requires OBS v24.0.4 or newer.
|
||||
*
|
||||
* @param {String (Optional)} `type` Type of projector: Preview (default), Source, Scene, StudioProgram, or Multiview (case insensitive).
|
||||
* @param {int (Optional)} `monitor` Monitor to open the projector on. If -1 or omitted, opens a window.
|
||||
@ -313,7 +313,7 @@ HandlerResponse WSRequestHandler::HandleGetVideoInfo(WSRequestHandler* req) {
|
||||
* @since 4.7.0
|
||||
*/
|
||||
HandlerResponse WSRequestHandler::HandleOpenProjector(WSRequestHandler* req) {
|
||||
#if LIBOBS_API_VER >= 0x18000003
|
||||
#if LIBOBS_API_VER >= 0x18000004
|
||||
const char *type = obs_data_get_string(req->data, "type");
|
||||
int monitor = -1;
|
||||
if (req->hasField("monitor")) {
|
||||
@ -324,6 +324,6 @@ HandlerResponse WSRequestHandler::HandleOpenProjector(WSRequestHandler* req) {
|
||||
obs_frontend_open_projector(type, monitor, geometry, name);
|
||||
return req->SendOKResponse();
|
||||
#else
|
||||
return req->SendErrorResponse("Projector opening requires libobs v21.0.3 or newer.");
|
||||
return req->SendErrorResponse("Projector opening requires libobs v21.0.4 or newer.");
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user