Share mp3 files from google drive with javascript

I have different mp3 files stored in Google Drive and with javascript I play them in my Axure prototype. First I used the following code:

var audio1 = new Audio("'id'");

But then I suddenly got the warning message of cors policy no ‘access-control-allow-origin’ and suddenly the audio files did not work anymore with a get 403 error. Then I used Google API with the following code:

var audio1 = new Audio(“‘id’?alt=media&key=‘key’&v=.mp3”);

Someone this does also not work. The audio stops playing suddenly. I receive a get 403 error about the files. Occasionally I even get the message of too many requests. I searched on internet and they recommended to change the credentials in the http header. However it is not possible to access this in Axure.

Does someone know how to play different mp3 files in repeat without facing any credentials problems?

Google–and other large companies–are always changing things for security, walled garden, or whatever reasons. Someone posted about a year ago they had success (but maybe this doesn’t work anymore?)

I’ve found that is great for hosting audio and video for prototypes, as well as accessing tons of public domain content.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.