mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-24 10:37:16 +00:00
Expose elementSource behind a feature flag
This commit is contained in:
parent
e7d1d0c5e2
commit
3eccf2b927
3 changed files with 9 additions and 4 deletions
|
|
@ -18,5 +18,6 @@ export const skinUrl = config.skinUrl === undefined ? skin : config.skinUrl;
|
|||
export const audioUrl = config.audioUrl === undefined ? audio : config.audioUrl;
|
||||
export const noMarquee = config.noMarquee || false;
|
||||
export const hideAbout = config.hideAbout || false;
|
||||
export const elementSource = config.elementSource || false;
|
||||
export const initialState = config.initialState || undefined;
|
||||
export const sentryDsn = SENTRY_DSN;
|
||||
|
|
|
|||
|
|
@ -104,7 +104,9 @@ export default class ElementSource extends Emitter {
|
|||
}
|
||||
|
||||
getSampleRate() {
|
||||
return null;
|
||||
// This is a lie. This is the sample rate of the context, not the
|
||||
// underlying source media.
|
||||
return this._context.sampleRate;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/* Emulate the native <audio> element with Web Audio API */
|
||||
import { elementSource } from "../config";
|
||||
import { BANDS } from "../constants";
|
||||
import BufferSource from "./bufferSource";
|
||||
//import ElementSource from "./elementSource";
|
||||
import ElementSource from "./elementSource";
|
||||
|
||||
export default class Media {
|
||||
constructor(fileInput) {
|
||||
|
|
@ -76,8 +77,9 @@ export default class Media {
|
|||
// |
|
||||
// <destination>
|
||||
|
||||
//this._source = new ElementSource(this._context, this._staticSource);
|
||||
this._source = new BufferSource(this._context, this._staticSource);
|
||||
this._source = elementSource
|
||||
? new ElementSource(this._context, this._staticSource)
|
||||
: new BufferSource(this._context, this._staticSource);
|
||||
|
||||
this._source.on("positionChange", () => {
|
||||
this._callbacks.timeupdate();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue