This is a completely self-contained example, all in one file, and without any unnecessary features, showing how to play a Csound piece in a Web browser using csound-extended for WebAssembly. This example uses the AudioWorklet implementation of WebAudio defined in CsoundAudioNode.js.
The complete .csd file of the Xanadu example from the Csound repository is stored in the text area below. Clicking on the Play button performs this file. Clicking on the Stop button ends the performance. The .csd should (and sometimes must) set sr (probably 48000), ksmps = 128, nchnls, nchnls_i, and sample word format to be consistent with the host.