happy-dom
Version:
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It includes many web standards from WHATWG DOM and HTML.
29 lines (25 loc) • 658 B
text/typescript
import NamespaceURI from '../../config/NamespaceURI.js';
import HTMLAudioElement from './HTMLAudioElement.js';
import * as PropertySymbol from '../../PropertySymbol.js';
/**
* Image as constructor.
*
* Reference:
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement/Audio.
*/
export default class Audio extends HTMLAudioElement {
public [PropertySymbol.tagName] = 'AUDIO';
public [PropertySymbol.localName] = 'audio';
public [PropertySymbol.namespaceURI] = NamespaceURI.html;
/**
* Constructor.
*
* @param [url] source URL.
*/
constructor(url: string = null) {
super();
if (url !== null) {
this.src = url;
}
}
}