Obs-Browser는 CEF (Chromium Embedded Framework)가 OBS Studio에 구동되는 크로스 플랫폼 브라우저 소스를 소개합니다. 브라우저 소스를 통해 사용자는 현대 웹 API에 완전히 액세스하여 웹 기반 오버레이를 장면에 통합 할 수 있습니다.
또한 Obs-Browser는 Wayland (Linux)를 제외한 모든 지원되는 플랫폼에서 서비스 통합 (타사 서비스 링크) 및 브라우저 부두 (인터페이스 자체에로드 됨)를 활성화 할 수 있습니다.
이 플러그인은 Windows, MacOS, Ubuntu PPA 및 공식 Flatpak (대부분의 Linux 배포)의 공식 패키지에 기본적으로 포함됩니다 .
Obs-Browser는 JavaScript의 일부 OBS 관련 기능에 액세스 할 수있는 글로벌 객체를 제공합니다. 이것은 OBS의 변화에 동적으로 적응하는 오버레이를 생성하는 데 사용될 수 있습니다.
TypeScript를 사용하는 경우 OBS- 브라우저 바인딩의 정의를 유형으로 유형으로 NPM 및 원사를 통해 사용할 수 있습니다.
# npm
npm install --save-dev @types/obs-studio
# yarn
yarn add --dev @types/obs-studio
/**
* @returns {string} OBS Browser plugin version
*/
window . obsstudio . pluginVersion
// => 2.17.0
/**
* @callback EventListener
* @param {CustomEvent} event
*/
/**
* @param {string} type
* @param {EventListener} listener
*/
window . addEventListener ( 'obsSceneChanged' , function ( event ) {
var t = document . createTextNode ( event . detail . name )
document . body . appendChild ( t )
} )
이러한 이벤트에 대한 설명은 여기에서 찾을 수 있습니다.
필요한 권한 : 없음
/**
* @typedef {number} Level - The level of permissions. 0 for NONE, 1 for READ_OBS (OBS data), 2 for READ_USER (User data), 3 for BASIC, 4 for ADVANCED and 5 for ALL
*/
/**
* @callback LevelCallback
* @param {Level} level
*/
/**
* @param {LevelCallback} cb - The callback that receives the current control level.
*/
window . obsstudio . getControlLevel ( function ( level ) {
console . log ( level )
} )
필수 권한 : read_obs
/**
* @typedef {Object} Status
* @property {boolean} recording - not affected by pause state
* @property {boolean} recordingPaused
* @property {boolean} streaming
* @property {boolean} replaybuffer
* @property {boolean} virtualcam
*/
/**
* @callback StatusCallback
* @param {Status} status
*/
/**
* @param {StatusCallback} cb - The callback that receives the current output status of OBS.
*/
window . obsstudio . getStatus ( function ( status ) {
console . log ( status )
} )
필수 권한 : read_user
/**
* @typedef {Object} Scene
* @property {string} name - name of the scene
* @property {number} width - width of the scene
* @property {number} height - height of the scene
*/
/**
* @callback SceneCallback
* @param {Scene} scene
*/
/**
* @param {SceneCallback} cb - The callback that receives the current scene in OBS.
*/
window . obsstudio . getCurrentScene ( function ( scene ) {
console . log ( scene )
} )
필수 권한 : read_user
/**
* @callback ScenesCallback
* @param {string[]} scenes
*/
/**
* @param {ScenesCallback} cb - The callback that receives the scenes.
*/
window . obsstudio . getScenes ( function ( scenes ) {
console . log ( scenes )
} )
필수 권한 : read_user
/**
* @callback TransitionsCallback
* @param {string[]} transitions
*/
/**
* @param {TransitionsCallback} cb - The callback that receives the transitions.
*/
window . obsstudio . getTransitions ( function ( transitions ) {
console . log ( transitions )
} )
필수 권한 : read_user
/**
* @callback TransitionCallback
* @param {string} transition
*/
/**
* @param {TransitionCallback} cb - The callback that receives the transition currently set.
*/
window . obsstudio . getCurrentTransition ( function ( transition ) {
console . log ( transition )
} )
필요한 권한 : 기본
/**
* Does not accept any parameters and does not return anything
*/
window . obsstudio . saveReplayBuffer ( )
필요한 권한 : 고급
/**
* Does not accept any parameters and does not return anything
*/
window . obsstudio . startReplayBuffer ( )
필요한 권한 : 고급
/**
* Does not accept any parameters and does not return anything
*/
window . obsstudio . stopReplayBuffer ( )
필요한 권한 : 고급
/**
* @param {string} name - Name of the scene
*/
window . obsstudio . setCurrentScene ( name )
필요한 권한 : 고급
/**
* @param {string} name - Name of the transition
*/
window . obsstudio . setCurrentTransition ( name )
필요한 권한 : 모두
/**
* Does not accept any parameters and does not return anything
*/
window . obsstudio . startStreaming ( )
필요한 권한 : 모두
/**
* Does not accept any parameters and does not return anything
*/
window . obsstudio . stopStreaming ( )
필요한 권한 : 모두
/**
* Does not accept any parameters and does not return anything
*/
window . obsstudio . startRecording ( )
필요한 권한 : 모두
/**
* Does not accept any parameters and does not return anything
*/
window . obsstudio . stopRecording ( )
필요한 권한 : 모두
/**
* Does not accept any parameters and does not return anything
*/
window . obsstudio . pauseRecording ( )
필요한 권한 : 모두
/**
* Does not accept any parameters and does not return anything
*/
window . obsstudio . unpauseRecording ( )
필요한 권한 : 모두
/**
* Does not accept any parameters and does not return anything
*/
window . obsstudio . startVirtualcam ( )
필요한 권한 : 모두
/**
* Does not accept any parameters and does not return anything
*/
window . obsstudio . stopVirtualcam ( )
이 방법은 유산입니다. 대신 이벤트 청취자를 등록하십시오.
/**
* onVisibilityChange gets callbacks when the visibility of the browser source changes in OBS
*
* @deprecated
* @see obsSourceVisibleChanged
* @param {boolean} visibility - True -> visible, False -> hidden
*/
window . obsstudio . onVisibilityChange = function ( visibility ) {
} ;
이 방법은 유산입니다. 대신 이벤트 청취자를 등록하십시오.
/**
* onActiveChange gets callbacks when the active/inactive state of the browser source changes in OBS
*
* @deprecated
* @see obsSourceActiveChanged
* @param {bool} True -> active, False -> inactive
*/
window . obsstudio . onActiveChange = function ( active ) {
} ;
Obs-Browser에는 Obs-Websocket의 공급 업체 요청과 통합이 포함됩니다. 사용할 공급 업체 이름은 obs-browser
이며 사용 가능한 요청은 다음과 같습니다.
emit_event
event_name
과? event_data
매개 변수. 모든 브라우저 소스에 맞춤 이벤트를 제출합니다. 이벤트를 구독하려면 여기를 참조하십시오현재 사용 가능한 공급 업체 이벤트가 없습니다.
OBS 브라우저는 독립형을 구축 할 수 없습니다. OBS Studio의 일부로 제작되었습니다.
지침을 따르면 세 가지 플랫폼 모두에서 브라우저 소스 및 사용자 정의 브라우저 도크가 가능합니다. BUILD_BROWSER
와 CEF_ROOT_DIR
모두 필요합니다.
빌드 지침을 따르고 CEF 래퍼를 다운로드하고 CMAKE에 CEF_ROOT_DIR
설정하여 추출 된 래퍼를 가리 키십시오.
MacOS 전체 빌드 스크립트를 사용하십시오. OBS 브라우저를 자동으로 다운로드하고 활성화합니다.
빌드 지침을 따르고 "브라우저가있는 경우 빌딩하는 경우"옵션을 선택하십시오. 여기에는 CEF 래퍼를 다운로드/추출하고 필요한 CMAKE 변수를 설정하는 단계가 포함됩니다.