The <<= some HTML code here>> method is known as the “stupid print trick”, and you had to use that with older versions of SugarCube for things like this.
However, with newer versions of SugarCube (preferably v2.23.5+) it’s a lot simpler to use attribute directives instead. Using that, your code would simply be:
The @ before the “src” attribute directs SugarCube to evaluate the contents of that attribute and use that value. Thus the above will randomly display either the images/(1).webm or the images/(2).webm video.