diff --git a/App.vue b/App.vue index 04a7a20..43adea6 100644 --- a/App.vue +++ b/App.vue @@ -81,7 +81,7 @@ listenerUI: { cameraRotation: 270, objectFit: 'fill', - enableToggleCamera: false + enableToggleCamera: true } }) wmpfVoip.setVoipEndPagePath({ diff --git a/manifest.json b/manifest.json index 3afe025..22d3396 100644 --- a/manifest.json +++ b/manifest.json @@ -104,7 +104,6 @@ "modules" : { "Bluetooth" : {}, "VideoPlayer" : {}, - "LivePusher" : {}, "Camera" : {}, "Record" : {} }, diff --git a/uni_modules/xhj-tencent-xp2p/utssdk/app-ios/index.uts b/uni_modules/xhj-tencent-xp2p/utssdk/app-ios/index.uts index 55d5158..c9e0cbd 100644 --- a/uni_modules/xhj-tencent-xp2p/utssdk/app-ios/index.uts +++ b/uni_modules/xhj-tencent-xp2p/utssdk/app-ios/index.uts @@ -4,6 +4,42 @@ import { Result } from '../interface.uts' +function avRecvHandle( + id: Optional>, + recv_buf: Optional>, + recv_len: Int +) { + if (id != null) { + const idString = P2PConversionHelper.cStringToString(id) + // console.log(`avRecvHandle: ${idString}`) + } +} + +function msgHandle( + id: Optional>, + type: XP2PType, + msg: Optional> +): Optional> { + const idString = id != null ? P2PConversionHelper.cStringToString(id) : '' + const msgString = msg != null ? P2PConversionHelper.cStringToString(msg) : '' + if (type == XP2PTypeLog) { + console.log(`${msgString}`) + } + return null +} + +function deviceDataHandle( + id: Optional>, + recv_buf: Optional>, + recv_len: Int +): Optional> { + if (id != null) { + const idString = P2PConversionHelper.cStringToString(id) + // console.log(`deviceDataHandle: ${idString}, len: ${recv_len}`) + } + return null +} + export const startServiceFunction = async function ( appKey: string, appSecret: string, @@ -18,7 +54,10 @@ export const startServiceFunction = async function ( config.ip = UnsafePointer(strdup('')!) config.port = 20002 config.type = XP2P_PROTOCOL_AUTO - config.cross = false + config.cross = true + + // 设置回调 + setUserCallbackToXp2p(avRecvHandle, msgHandle, deviceDataHandle) const result = startService(`${productId}/${deviceName}`, productId, deviceName, config)