Widget.assets
Your files from the Studio library: those in assets of manifest.json are used by name, and those in the
image, video and audio menu fields with Widget.parameters.asset.
Each one is loaded once and reused. If one is missing (it was deleted), it comes out empty and the alert goes on without it.
url(name): the URL of a file inassets, for asrcor abackground;""if it is not declared.image(source): a copy of the already loaded<img>, ready forappend;nullif there is no file or it could not load.play(source, { volume }): plays a sound (volumefrom 0 to 1) and finishes when it ends; with no file, it finishes at once.stop(source?): stops a playing sound (or all of them, withoutsource); itsplayfinishes at once.video(source): the widget’s only<video>with that WebM loaded, forappendandplay();nullif there is no file.
await Widget.assets.play("bell.mp3", { volume: 0.6 });const logo = await Widget.assets.image("logo.png");if (logo) app.append(logo);