Code Monkey home page Code Monkey logo

Comments (12)

Okazari avatar Okazari commented on August 20, 2024

Gonna try an angular integration tomorrow to see if i can reproduce.

from rythm.js.

stefanoslig avatar stefanoslig commented on August 20, 2024

ok, thanks

from rythm.js.

Okazari avatar Okazari commented on August 20, 2024

I have doubts about your mp3 URL. it may be "/assets/rythm.mp3" or import mySong from '../assets/rythm.mp3' depending on the way you load statics into your app but i don't think relative could work here out of the box.

from rythm.js.

stefanoslig avatar stefanoslig commented on August 20, 2024

I have tried to use an absolute path but didn't work

from rythm.js.

Okazari avatar Okazari commented on August 20, 2024

Could you try with this one ? (just tell me if there is CORS) https://okazari.github.io/Rythm.js/samples/rythmC.mp3

from rythm.js.

stefanoslig avatar stefanoslig commented on August 20, 2024

It's working on Edge with this url. I get the following error on Chrome:

MediaElementAudioSource outputs zeroes due to CORS access restrictions for https://okazari.github.io/Rythm.js/samples/rythmC.mp3

from rythm.js.

Okazari avatar Okazari commented on August 20, 2024

from rythm.js.

stefanoslig avatar stefanoslig commented on August 20, 2024

ok, thanks a lot for your time!

from rythm.js.

nesvand avatar nesvand commented on August 20, 2024

Depending on your build chain @stefanos- I'd suggest using something like https://github.com/webpack-contrib/url-loader to generate the correct URL string to pass in to the library at run time

from rythm.js.

Okazari avatar Okazari commented on August 20, 2024

I did try on my angular poc... I did eject the conf to add "mp3" in the url-loader regex into the webpack config but i'm still running into a build issue module "./rythmC.mp3" not found...
God i hate angular 😂

from rythm.js.

Okazari avatar Okazari commented on August 20, 2024

So, the easiest solution that worked for me here is :
1 - Add your file into the "assets" folder
2 - You should be able to acces it at /assets/rythm.mp3 in your browser
3 - The call to rythm.setMusic("/assets/rythm.mp3") should now work.

from rythm.js.

Okazari avatar Okazari commented on August 20, 2024

Closing, no activity in more than 1 month.

from rythm.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.