// @flow import React from 'react'; import AbstractAudio from '../AbstractAudio'; import type { AudioElement } from '../AbstractAudio'; /** * The React/Web {@link Component} which is similar to and wraps around * {@code HTMLAudioElement} in order to facilitate cross-platform source code. */ export default class Audio extends AbstractAudio { /** * Set to true when the whole file is loaded. */ _audioFileLoaded: boolean; /** * Reference to the HTML audio element, stored until the file is ready. */ _ref: ?AudioElement; /** * Creates new Audio element instance with given props. * * @param {Object} props - The read-only properties with which the new * instance is to be initialized. */ constructor(props: Object) { super(props); // Bind event handlers so they are only bound once for every instance. this._onCanPlayThrough = this._onCanPlayThrough.bind(this); this._setRef = this._setRef.bind(this); } /** * Implements React's {@link Component#render()}. * * @inheritdoc * @returns {ReactElement} */ render() { return (