GoogleChrome/audion

Navigating "back" puts the visualizer in a weird state

hoch opened this issue · 4 comments

hoch commented

Repro steps:

  1. Go to https://googlechromelabs.github.io/web-audio-samples/.
  2. Click "Shiny Drum Machine".
  3. Press play button in the drum machine.
  4. While audio is playing, press browser's back button.

Expected behavior:
When navigating out of a page, the DT panel should be reset.

Current behavior:
The previous graph visualization stuck in the panel.

Screen Shot 2021-09-02 at 12 55 10 PM

@hoch Ah. Transitioning to no graph (either by navigating away from the page or the last audio context being destroyed) isn't pushing a new graph (or rather a lack of one) to the layout thread. I think we could replace the filter in GraphSelector with a default empty graph. That would push the empty graph to the layout worker and the result from the worker would delete the previous nodes.

I'll post a PR for that.

hoch commented

I am reopening this because the PR did not completely fix the issue.

Technically the observer is doing what it is supposed to do. There's no signal from the Web Audio inspector (Blink) after the page is unloaded, so the visualizer won't be updated.

I think one possible workaround is to capture an event of "navigating away", and reset the state in the extension.

@hoch for this would you be able to specify the url you were going back to? Any urls you can provide that do not work with the back button we would like documented.

hoch commented

Just revised the description - not only that I just tried to reproduce the issue, but it seems to be fixed. :)

Let me sit on it a couple of more days before closing this.