Skip to content

Commit

Permalink
arrayBuffer を明示する
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Nov 26, 2024
1 parent c6bd186 commit 958b0b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/sdk/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import type {
} from './types'
import {
ConnectError,
addStereoToFmtp,
compressMessage,
createDataChannelData,
createDataChannelEvent,
Expand All @@ -70,7 +71,6 @@ import {
isSafari,
parseDataChannelEventData,
trace,
addStereoToFmtp,
} from './utils'

declare global {
Expand Down Expand Up @@ -2158,7 +2158,7 @@ export default class ConnectionBase {
const dataChannel = event.target as RTCDataChannel
let data: ArrayBuffer | undefined = undefined
if (typeof event.data === 'string') {
data = new TextEncoder().encode(event.data)
data = new TextEncoder().encode(event.data).buffer as ArrayBuffer
} else if (event.data instanceof ArrayBuffer) {
data = event.data
} else {
Expand Down

0 comments on commit 958b0b0

Please sign in to comment.