Skip to content

Commit cf6a67e

Browse files
committed
refactor: flip allowConcurrentAudioPlayback to disabled
1 parent 6efbbd0 commit cf6a67e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/components/Attachment/__tests__/Audio.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ describe('Audio', () => {
246246
it('differentiates between in thread and in channel audio player', async () => {
247247
const message = generateMessage();
248248
render(
249-
<WithAudioPlayback>
249+
<WithAudioPlayback allowConcurrentPlayback>
250250
<MessageProvider value={{ message }}>
251251
<Audio og={audioAttachment} />
252252
</MessageProvider>

src/components/Attachment/__tests__/Card.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ describe('Card', () => {
325325
render(
326326
<ChatProvider value={{}}>
327327
<ChannelStateProvider value={{}}>
328-
<WithAudioPlayback>
328+
<WithAudioPlayback allowConcurrentPlayback>
329329
<MessageProvider value={{ message }}>
330330
<Card {...audioAttachment} />
331331
</MessageProvider>
@@ -372,7 +372,7 @@ describe('Card', () => {
372372
render(
373373
<ChatProvider value={{}}>
374374
<ChannelStateProvider value={{}}>
375-
<WithAudioPlayback>
375+
<WithAudioPlayback allowConcurrentPlayback>
376376
<MessageProvider value={{ message }}>
377377
<Card {...audioAttachment} />
378378
</MessageProvider>

src/components/AudioPlayer/AudioPlayerPool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class AudioPlayerPool {
88
private allowConcurrentPlayback: boolean;
99

1010
constructor(config?: { allowConcurrentPlayback?: boolean }) {
11-
this.allowConcurrentPlayback = config?.allowConcurrentPlayback ?? true;
11+
this.allowConcurrentPlayback = !!config?.allowConcurrentPlayback;
1212
}
1313

1414
get players() {

src/components/Channel/Channel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ type ChannelPropsForwardedToComponentContext = Pick<
168168
export type ChannelProps = ChannelPropsForwardedToComponentContext & {
169169
/** Custom handler function that runs when the active channel has unread messages and the app is running on a separate browser tab */
170170
activeUnreadHandler?: (unread: number, documentTitle: string) => void;
171-
/** Allows a single audio to be played by any audio player at a time. */
171+
/** Allows multiple audio players to play the audio at the same time. Disabled by default. */
172172
allowConcurrentAudioPlayback?: boolean;
173173
/** The connected and active channel */
174174
channel?: StreamChannel;
@@ -291,7 +291,7 @@ const ChannelInner = (
291291
) => {
292292
const {
293293
activeUnreadHandler,
294-
allowConcurrentAudioPlayback = true,
294+
allowConcurrentAudioPlayback,
295295
channel,
296296
channelQueryOptions: propChannelQueryOptions,
297297
children,

0 commit comments

Comments
 (0)