Skip to content

Commit

Permalink
fix: MetadataReceived event parameters bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LichKing-2234 committed Dec 18, 2020
1 parent daefc68 commit 56ab25b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Callback.swift
Expand Up @@ -17,14 +17,14 @@ protocol Callback: class {
}

extension Callback {
func code(_ code: Int32?, _ runnable: ((Int32) -> Any?)? = nil) {
func code(_ code: Int32?, _ runnable: ((Int32?) -> Any?)? = nil) {
if code == nil || code! < 0 {
let newCode = abs(Int(code ?? Int32(AgoraErrorCode.notInitialized.rawValue)))
failure(String(newCode), AgoraRtcEngineKit.getErrorDescription(newCode) ?? "")
return
}

let res = runnable?(code!)
let res = runnable?(code)
if res is Void {
success(nil)
} else {
Expand Down
4 changes: 1 addition & 3 deletions MediaObserver.swift
Expand Up @@ -43,9 +43,7 @@ extension MediaObserver: AgoraMediaMetadataDataSource {
extension MediaObserver: AgoraMediaMetadataDelegate {
func receiveMetadata(_ data: Data, fromUser uid: Int, atTimestamp timestamp: TimeInterval) {
emitter([
"buffer": String(data: data, encoding: .utf8),
"uid": uid,
"timeStampMs": timestamp
"data": [String(data: data, encoding: .utf8) ?? "", uid, timestamp]
])
}
}

0 comments on commit 56ab25b

Please sign in to comment.