requests: Get/Set local file path in BrowserSource settings

This commit is contained in:
Philip Loche
2017-11-14 09:21:58 +01:00
committed by Stéphane L
parent 408b336057
commit a6bab968f5

View File

@ -801,7 +801,8 @@ void WSRequestHandler::HandleSetTextGDIPlusProperties(WSRequestHandler* req) {
* @param {String} `source` Name of the source.
*
* @return {boolean} `is_local_file` Indicates that a local file is in use.
* @return {String} `url` Url or file path.
* @return {String} `local_file` file path.
* @return {String} `url` Url.
* @return {String} `css` CSS to inject.
* @return {int} `width` Width.
* @return {int} `height` Height.
@ -858,7 +859,8 @@ void WSRequestHandler::HandleGetBrowserSourceProperties(WSRequestHandler* req) {
* @param {String (optional)} `scene-name` Name of the scene that the source belongs to. Defaults to the current scene.
* @param {String} `source` Name of the source.
* @param {boolean (optional)} `is_local_file` Indicates that a local file is in use.
* @param {String (optional)} `url` Url or file path.
* @param {String (optional)} `local_file` file path.
* @param {String (optional)} `url` Url.
* @param {String (optional)} `css` CSS to inject.
* @param {int (optional)} `width` Width.
* @param {int (optional)} `height` Height.
@ -916,6 +918,11 @@ void WSRequestHandler::HandleSetBrowserSourceProperties(WSRequestHandler* req) {
obs_data_get_bool(req->data, "is_local_file"));
}
if (req->hasField("local_file")) {
obs_data_set_string(settings, "local_file",
obs_data_get_string(req->data, "local_file"));
}
if (req->hasField("url")) {
obs_data_set_string(settings, "url",
obs_data_get_string(req->data, "url"));