react-native-audio-api
Version:
react-native-audio-api provides system for controlling audio in React Native environment compatible with Web Audio API specification
27 lines (26 loc) • 1.12 kB
JavaScript
;
import AudioScheduledSourceNode from "./AudioScheduledSourceNode.js";
import { NotSupportedError } from "../errors/index.js";
/**
* StreamerNode is an AudioNode that allows you to stream audio from a file or
* URL. It uses FFmpeg to decode the audio data and provides it as an audio
* source. Note: This node requires the build to use FFmpeg, and will throw an
* error if FFmpeg is not available.
*
* @deprecated Use the `<Audio>` element with MediaElementAudioSourceNode for
* streaming audio instead to achieve the same functionality.
*/
export default class StreamerNode extends AudioScheduledSourceNode {
constructor(context, options) {
if (__DEV__) {
console.warn('StreamerNode is deprecated and will be removed in a future version. ' + 'Please migrate to using the <Audio> element for streaming audio.');
}
const node = context.context.createStreamer(options);
if (!node) {
throw new NotSupportedError('StreamerNode requires FFmpeg build');
}
super(context, node);
this.streamPath = options.streamPath;
}
}
//# sourceMappingURL=StreamerNode.js.map