Commit 0612ef0e by qlintonger xeno

眼镜端修复

parent 5aa8066f
...@@ -333,13 +333,19 @@ export class AgoraHandle { ...@@ -333,13 +333,19 @@ export class AgoraHandle {
case 'File': case 'File':
{ {
console.log('收到ws眼镜端消息点', msgData) console.log('收到ws眼镜端消息点', msgData)
msgData.msgData.tip = { // msgData.msgData.tip = {
fileSize: 0, // fileSize: 0,
fileType: 'video', // fileType: 'video',
fileUrl: msgData.msgData.tip, // fileUrl: msgData.msgData.tip,
fileName: msgData.msgData.tip.slice(msgData.msgData.tip.lastIndexOf('/') + 1) // fileName: msgData.msgData.tip.slice(msgData.msgData.tip.lastIndexOf('/') + 1)
} // }
addMessageItemInMeeting(msgData) // addMessageItemInMeeting(msgData);
const msgType = msgData.msgData.tip.endsWith('.mp4') ? 'ChatVideo' :
['.jpg', '.png', '.jpeg'].some(a=>msgData.msgData.tip.endsWith(a)) ? 'ChatImage' :
'ChatFile'
this.AnyRemote.sendRaw(
fromID, fromName, msgType
)
break; break;
} }
case 'ChatAudio': case 'ChatAudio':
...@@ -426,6 +432,13 @@ export class AgoraHandle { ...@@ -426,6 +432,13 @@ export class AgoraHandle {
msgId: generateMessageId() msgId: generateMessageId()
} }
) )
this.AnyRemote.sendWSFromCall(
'-2',
{
tip: text,
channelID: chatChannelState.value.chatChannelId,
}
)
} }
sendImage(data) { sendImage(data) {
...@@ -446,6 +459,14 @@ export class AgoraHandle { ...@@ -446,6 +459,14 @@ export class AgoraHandle {
} }
} }
) )
this.AnyRemote.sendWSFromCall(
'-2',
'Image',
{
tip: data.fileUrl,
channelID
}
)
} }
sendFile(data) { sendFile(data) {
...@@ -466,6 +487,14 @@ export class AgoraHandle { ...@@ -466,6 +487,14 @@ export class AgoraHandle {
} }
} }
) )
this.AnyRemote.sendWSFromCall(
'-2',
'File',
{
tip: data.fileUrl,
channelID
}
)
} }
sendVideo(data, fileType = 'video') { sendVideo(data, fileType = 'video') {
...@@ -487,6 +516,14 @@ export class AgoraHandle { ...@@ -487,6 +516,14 @@ export class AgoraHandle {
'-2', '-2',
'ChatVideo', md 'ChatVideo', md
) )
this.AnyRemote.sendWSFromCall(
'-2',
'File',
{
tip: data.fileUrl,
channelID
}
)
} }
endMark(cancelType = 'video') { endMark(cancelType = 'video') {
...@@ -669,7 +706,10 @@ export class AgoraHandle { ...@@ -669,7 +706,10 @@ export class AgoraHandle {
this.AnyRemote.sendWSFromCall( this.AnyRemote.sendWSFromCall(
'-2', '-2',
'BlinkSpot', 'BlinkSpot',
v {
...v,
channelID: chatChannelState.value.chatChannelId,
}
) )
} }
} }
\ No newline at end of file
...@@ -21,6 +21,17 @@ export class AnyRemote { ...@@ -21,6 +21,17 @@ export class AnyRemote {
this.errorCB = errorCB this.errorCB = errorCB
} }
sendRaw(fromID, fromName, msgType, msgData, channelID, toID) {
this.wsInt.send({
msgData,
toID,
channelID,
msgType,
fromID,
fromName
})
}
sendWSFromCall(toID, msgType, msgData, channelID) { sendWSFromCall(toID, msgType, msgData, channelID) {
this.wsInt.send({ this.wsInt.send({
fromID: userStates.value.currentUserId, fromID: userStates.value.currentUserId,
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
:key="q.id" :key="q.id"
:data-id="`${q.id}`" :data-id="`${q.id}`"
:style="{ :style="{
top: `${q.yPos * 100}%`, top: `${q.y * 100}%`,
left: `${q.xPos * 100}%` left: `${q.x * 100}%`
}" }"
class="red-ball absolute z-[999]" class="red-ball absolute z-[999]"
@animationend="centerEnded" @animationend="centerEnded"
...@@ -223,18 +223,13 @@ function handleBlinkingStart($e: PointerEvent) { ...@@ -223,18 +223,13 @@ function handleBlinkingStart($e: PointerEvent) {
if (chatChannelState.value.blinkSpotSet.find((a) => a.id === userStates.value.currentUserId)) return if (chatChannelState.value.blinkSpotSet.find((a) => a.id === userStates.value.currentUserId)) return
const { offsetX, offsetY, target } = $e const { offsetX, offsetY, target } = $e
const { clientWidth, clientHeight } = target as HTMLElement const { clientWidth, clientHeight } = target as HTMLElement
const xPos = offsetX / clientWidth const x = offsetX / clientWidth
const yPos = offsetY / clientHeight const y = offsetY / clientHeight
const id = userStates.value.currentUserId const id = userStates.value.currentUserId
console.log('d passed', {
id,
xPos,
yPos
})
AnyR?.agora.sendBlinkSpot({ AnyR?.agora.sendBlinkSpot({
id, id,
xPos, x,
yPos y
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment