提交 abadf284 编写于 作者: fxy060608's avatar fxy060608

merge

上级 4d0dde01
...@@ -11,7 +11,7 @@ const callbacks = { ...@@ -11,7 +11,7 @@ const callbacks = {
} }
class RecorderManager { class RecorderManager {
constructor() { constructor () {
callbacks = callbacks =
onMethod('onRecorderStateChange', res => { onMethod('onRecorderStateChange', res => {
const state = res.state const state = res.state
...@@ -24,46 +24,46 @@ class RecorderManager { ...@@ -24,46 +24,46 @@ class RecorderManager {
}) })
}) })
} }
onError(callback) { onError (callback) {
callbacks.error.push(callback) callbacks.error.push(callback)
} }
onFrameRecorded(callback) { onFrameRecorded (callback) {
} }
onInterruptionBegin(callback) { onInterruptionBegin (callback) {
} }
onInterruptionEnd(callback) { onInterruptionEnd (callback) {
} }
onPause(callback) { onPause (callback) {
callbacks.pause.push(callback) callbacks.pause.push(callback)
} }
onResume(callback) { onResume (callback) {
callbacks.resume.push(callback) callbacks.resume.push(callback)
} }
onStart(callback) { onStart (callback) {
callbacks.start.push(callback) callbacks.start.push(callback)
} }
onStop(callback) { onStop (callback) {
callbacks.stop.push(callback) callbacks.stop.push(callback)
} }
pause() { pause () {
invokeMethod('operateRecorder', { invokeMethod('operateRecorder', {
operationType: 'pause' operationType: 'pause'
}) })
} }
resume() { resume () {
invokeMethod('operateRecorder', { invokeMethod('operateRecorder', {
operationType: 'resume' operationType: 'resume'
}) })
} }
start(options) { start (options) {
invokeMethod('operateRecorder', Object.assign({}, options, { invokeMethod('operateRecorder', Object.assign({}, options, {
operationType: 'start' operationType: 'start'
})) }))
} }
stop() { stop () {
invokeMethod('operateRecorder', { invokeMethod('operateRecorder', {
operationType: 'stop' operationType: 'stop'
}) })
...@@ -72,6 +72,6 @@ class RecorderManager { ...@@ -72,6 +72,6 @@ class RecorderManager {
let recorderManager let recorderManager
export function getRecorderManager() { export function getRecorderManager () {
return recorderManager || (recorderManager = new RecorderManager()) return recorderManager || (recorderManager = new RecorderManager())
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册