Nevertheless, I got MediaelementJS to work “50% of the time, all the time”, with just these basic steps, right out of the box – albeit with missing images of the controls. The 50% of the time where a problem though, and having a visible play button etc. also would be “good”, so some “fixing” was necessary.
After some trial-and-error, I got MediaelementJS to find it’s button images – but only when I put them in the root directory of my app. In hindsight, I think I simply put the path together the wrong way, when trying to get the mediaelementplayer.css to point to the app/assets/images or the public folder of my app, for example. While the assets/images folder is indeed where I put the bottons in the end now, neither is a good solution as such though, as I learned through finding this Q&A on Stack Overflow and asking at OpenTech School‘s Ruby learners meetup. My app would be okay in development mode, but the links to the images would break in production. What needs to be done is to change mediaelementJS’ CSS to an SCSS file and change the URLs referenced in it from ” url(somefile.png) ” to ” asset-url(“somefile.png“) “ – and Sprocket will take care of things.
Thanks to Jose from OTS for answering my questions! I been to told that this Railscast should be helpful to understand the Asset Pipeline (that makes these URL changes necessary) better – haven’t watched it myself yet though. Feedback on this post? Write me on Twitter.