简体   繁体   中英

Trying to make a audio visualizer and Having Youtube CORS problem when getting used as Source

Im trying to make a visualizer for a youtube player. I have...

<audio id="aplayer" preload="auto" crossorigin>
       <source src="https://sample.googlevideo.com/videoplayback?..." type="audio/webm">
</audio>

When trying to audioCtx.createMediaElementSource(aplayer); i face the

blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present...

by googleChrome, i just the network in dev tools and seems im getting a 302 Error and the headers look like this for request

Request URL: ...
Request Method: GET
Status Code: 302 
Referrer Policy: strict-origin-when-cross-origin

and in response

content-type: text/html
cross-origin-resource-policy: cross-origin
...
vary: Origin
x-content-type-options: nosniff

Doesnt that response cors policy: cross-origin telling im supposed to be able to Read that data, what am i missing here? i know there are lots of youtube visulizer extensions for chrome so this should not be something impossible, hope someone can point me what is it that im missing here.

Thank you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2023 STACKOOM.COM