I am currently working on a website that includes a musicplayer made with SoundJS.
I, myself, am using Google Chrome to test and debug my website, and it worked like a charm, but when I recently tested it in FireFox, I noticed this strange error.
When I hit the play button and the sound is being registered I get this error:
The buffer passed to decodeAudioData contains an unknown content type
The code I use in my javascript file to create the soundInstance:
'response' is a string containing the location of the .mp3 file (this all works perfectly in Chrome).
createjs.Sound.registerSound('uploads/songs/'+response,'song');
When I test this same piece of code with an 'ogg' file it works perfectly in FireFox.
I also heard from some people that it doesn't work in Safari too, but unfortunatly I am a windows user.
If you want to test it for yourself:
www.playmesome.be . Just hit the play button and it will keep on loading infinitely because of this error.
Thanks for reading!
there is a known issue with Firefox on windows that does not load all mp3 files properly, and therefore it is recommended that you load another supported file type first (such as ogg).
Hope that helps.
Related
I'm growing frustrated with the whole mix of Spring Tool Suite, Tomcat and Chrome. I'm working on a website's back end and I'm having all sorts of troubles getting my webpage to reload properly when I make changes to the JavaScript. I've made a fix to a problem in my code and when I go to preview, the error is still there. When I inspect the JavaScript in the Chrome Dev Tools, I see that it is still loading the JavaScript before I made the change, despite me having saved the file. I've rebooted Tomcat, I've been using Incognito mode, I've been deleting my cache and yet even in incognito, Chrome won't dump the old JavaScript file for the new one.
It's getting frustrating, because I waste time with every change I make with the JavaScript trying to wrestle with Chrome and Tomcat to get my webpage to use the most recent saved version of my JavaScript. I don't know if this matters, but I'm not writing my JavaScript in STS with Tomcat and my Java code, but it is in the same folder as my project and when I open it in STS, it always has my most recent save changes anyways.
Is there any fix to this?
I use Sentry to track the error in my website. The problem is sometimes chrome mobile for android has a null localStorage that cause all related method such as getItem or setItem will produce an error (Yeah, it's flaky). Have you ever got the problem like this before? I'd like to know the best solution for this problem.
Thanks :)
Maybe it is because this question is almost 2 years old and they've changed things but localStorage definitely works in Android Chrome with localStorage.setItem() and getItem() calls.
There is no need for the polyfill.
However, there is a problem / challenge that occurs if you've already put a page out there and you add localStorage that is related to Chrome Caching behavior. That's the problem I was having.
I had a page on the web than did some things via JavaScript. Then I added the simple localStorage calls to write and read a string value. I found that localStorage would fail.
Finally I loaded the .js file directly in my Android chrome browser and saw that the JS was the cached version of the file.
I reloaded the JS file and saw it update in Android Chrome so I went back to the page that uses the JS file and it still didn't save to localStorage.
To get it to work I had to close Android Chrome entirely (after refreshing the JS file) and finally localStorage did indeed work.
Here's a plunkr where you can point your mobile device at and save a value in localStorage to prove to yourself that it works.
http://plnkr.co/edit/dWgfh5WuMcM3InR0OaN4?p=info
Type in a screen name and press the Save button:
Then you can Stop and Run the plunkr again and you'll see that your Screen Name has been saved to localStorage and read out of localStorage to populate the top message:
I've actually tested this on various versions of Android, iOS (on an iPad) and in various desktop browsers and it works in every case.
Here's the code that calls localStorage.setItem()
function writeScreeNameToStorage(screenName){
var encodedScreenName = getEncodedValue(screenName);
localStorage.setItem("screenName", encodedScreenName);
}
I try to play sounds with "Howler.js", but it's not working in FF in every other browser it works.
To test if it is a problem with the sound files I opened the directory containing the files with the browser.
I have a '.mp3' file, a '.ogg' file, a '.wav' and a '.webm' file.
In FF none of them are working, FF only gives me the message "Video could not be played, because the file is broken.".
Now I'm totally confused, because other browsers don't complain about the audio files.
I appreciate any help.
Found a solution myself. The problem was that I started the Code via node and gulp, which resulted in wrong mime types, which was a problem for Firefox. When the application is started via apache, the mime types are correct and everythings working fine.
I'm having some major trouble with AppCache.
I've got a single page application (with real URLs using using Page.js and loading HTML from the server on page load, (dispatch: false)
It's running on Bode.js, in particular it's a Sails.js app.
I've got a manifest file in the HTML tag of the layout. The manifest file has been tested repeatedly and everything checks out. It works flawlessly in Chrome. Even in Safari, it shows up in the inspector correctly and has a list of the assets listed in the file. So far so good.
However, when offline, Safari fails to load anything but the HTML document itself. So I'm basically seeing just an unstyled list of headers. The console shows a bunch of 404s. So even though it's reading the manifest file correctly, it's not caching anything.
Firefox doesn't even detect the manifest file and just seems to working like it didn't exist.
Safari on iOS7 is behaving like Firefox and not showing anything, when offline.
Anyone with any bright ideas why this may be happening?
I'm having a really annoying problem with debugging javascript with VS2008.
If I simply press F5 (or choose 'start Debugging' from the Debug menu), the iexplore process is attached, but no breakpoints break in the scripts. The Script Documents tree doesn't even appear in the solution explorer.
I already know:
I can set a breakpoint in Javascript just fine. It does NOT show the "This point will not be hit" message.
Calling the debugger through using the 'debugger' keyword works fine, but attaching to the iexplore process doesn't since it gives a "process already attached to a debugger" message.
Using the manual 'Attach to process...' works just fine. The Script Documents appears as well.
The project has recently been converted to a Web Application from a WebSite.
I already tried:
Clearing the IE cache.
Shutting down VS2008, Stopping the IIS and deleting the temporary asp.NET files restarting both IIS and VS2008 afterwards.
Setting IE7 as the default browser both for windows and for VS2008.
Resetting my user settings for VS2008.
Checking that IE script debugging is enabled.
Nothing has worked so far. While Attaching to process isn't too taxing, it is very annoying when I'm used to just hitting F5.
If anyone can think of a solution, please please please (I'm begging here!) let me know!
Is silverlight debugging enabled on the website project properties? This will disable Javascript debugging.