Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MediaElementAudioSource outputs zeroes due to CORS access restrictions #71

Closed
ThatIsAPseudo opened this issue Jul 14, 2021 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@ThatIsAPseudo
Copy link

Describe the bug
Skip-Silence does not work on Invidious, shows the error MediaElementAudioSource outputs zeroes due to CORS access restrictions.

To Reproduce
Steps to reproduce the behavior:

  1. Enable skip-silence
  2. Open https://yewtu.be/watch?v=DQ8orIurGxw
  3. See error in developer console : MediaElementAudioSource outputs zeroes due to CORS access restrictions
  4. Video sound does not work without reloading the page

Expected behavior
Skip-silence should work as expected.

Desktop (please complete the following information):

  • OS: macOS Big Sur
  • Browser: Vivaldi 4.0.2312.38
  • Skip Silence Version 3

Additional context
I found this related Stack Overflow question, don't know if it could help
On youtube the extension works well though.

@ThatIsAPseudo ThatIsAPseudo added the bug Something isn't working label Jul 14, 2021
@vantezzen
Copy link
Owner

vantezzen commented Jul 23, 2021

It looks like Invidious directly uses the video from googlevideo.com. Due to this Skip Silence is missing CORS permissions to access the volume of the video.
I don't know if Skip Silence's content script is able to go around this restriction so it might not be possible to fix this.

@vantezzen
Copy link
Owner

I still can't find a way to solve this issue, even when modifying response headers.

I created a test-extension to see how this could be achieved without needing to integrate it into Skip Silence: https://github.com/vantezzen/cors-audio-extension-test

Stackoverflow Discussion about this issue: https://stackoverflow.com/q/64519532/10590162

"only XMLHttpRequest and fetch will bypass cross origin restrictions" (regarding the host permission system, not headers)

Chrome Bug Tracker: https://bugs.chromium.org/p/chromium/issues/detail?id=477692

Solved by setting crossOrigin = 'anonymous' but that doesn't seem to work

https://bugs.chromium.org/p/chromium/issues/detail?id=511251

Also uses crossOrigin = 'anonymous'

@vantezzen
Copy link
Owner

Currently testing a new idea of using the background script instead of content script to analyze the volume on a per-tab basis instead (similar to how https://github.com/piousdeer/chrome-volume-manager works)

@vantezzen
Copy link
Owner

The next version of Skip silence will come with a selector to choose the recorder type:

image

I'm still looking into how this can be presented user-friendly but switching to a different analysis method will solve this issue.

@vantezzen vantezzen unpinned this issue Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants