From 3eccf2b9270b69beee169d5e4271526eef13239e Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Mon, 20 Nov 2017 16:46:30 -0800 Subject: [PATCH] Expose elementSource behind a feature flag --- js/config.js | 1 + js/media/elementSource.js | 4 +++- js/media/index.js | 8 +++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/js/config.js b/js/config.js index ad74a29a..4c47d628 100644 --- a/js/config.js +++ b/js/config.js @@ -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; diff --git a/js/media/elementSource.js b/js/media/elementSource.js index fa8ba43e..cbe634d5 100644 --- a/js/media/elementSource.js +++ b/js/media/elementSource.js @@ -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; } /* diff --git a/js/media/index.js b/js/media/index.js index c44422bd..eab44dbf 100644 --- a/js/media/index.js +++ b/js/media/index.js @@ -1,7 +1,8 @@ /* Emulate the native