Skip to content

Commit 2396d0d

Browse files
authored
Merge pull request #319 from b-ma/fix/destination-constraints
Fix `AudioDestination` constraints
2 parents f9a25ab + d710c91 commit 2396d0d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/node/destination.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ impl AudioNode for AudioDestinationNode {
6161
self.channel_config.set_count(v);
6262
}
6363
fn set_channel_count_mode(&self, _v: ChannelCountMode) {
64-
panic!("InvalidStateError: AudioDestinationNode has channel count mode constraints");
64+
// [spec] If the AudioDestinationNode is the destination node of an
65+
// OfflineAudioContext, then the channel count mode cannot be changed.
66+
// An InvalidStateError exception MUST be thrown for any attempt to change the value.
67+
if self.registration.context().offline() {
68+
panic!("InvalidStateError: AudioDestinationNode has channel count mode constraints");
69+
}
6570
}
6671
}
6772

0 commit comments

Comments
 (0)