Skip to content

Commit 09401cb

Browse files
committed
Add browser plugin version property to obsstudio js object
1 parent 653ead5 commit 09401cb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ CEF Based obs-studio browser plugin
66

77
obs-browser provides a global object that allows access to some obs specific functionality from javascript.
88

9-
### Get OBS Studio Version
9+
### Get OBS Studio Browser Plugin Version
1010
```
11-
window.obsstudio.version
12-
// => 0.14.2
11+
window.obsstudio.pluginVersion
12+
// => 1.24.0
1313
```
1414

1515
### Register for visibility callbacks

shared/browser-app.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "include/cef_browser.h"
2525
#include "include/cef_command_line.h"
2626
#include "include/wrapper/cef_helpers.h"
27+
#include "browser-version.h"
2728

2829
BrowserApp::BrowserApp(){
2930
}
@@ -66,9 +67,8 @@ void BrowserApp::OnContextCreated(CefRefPtr<CefBrowser> browser,
6667
CefRefPtr<CefV8Value> obsStudioObj = CefV8Value::CreateObject(0);
6768
globalObj->SetValue("obsstudio", obsStudioObj, V8_PROPERTY_ATTRIBUTE_NONE);
6869

69-
// Figure out how to get OBS version here
70-
CefRefPtr<CefV8Value> version = CefV8Value::CreateString("0.0.0");
71-
obsStudioObj->SetValue("version", version, V8_PROPERTY_ATTRIBUTE_NONE);
70+
CefRefPtr<CefV8Value> pluginVersion = CefV8Value::CreateString(OBS_BROWSER_VERSION);
71+
obsStudioObj->SetValue("pluginVersion", pluginVersion, V8_PROPERTY_ATTRIBUTE_NONE);
7272
}
7373

7474
bool BrowserApp::OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,

0 commit comments

Comments
 (0)