Service worker throws errors while extracting MP3 audio
I would like my web app to be promoted to Add to home screen for users on Android + Chrome. (inspired by: Chromium blog post )
For this I need a Service Worker , even a dummy one. (Chrome needs a Service Worker as proof that I'm serious about web apps)
So I created a Service Worker dummy with no content. It is served with correct no-cache headers, served over HTTPS, and bound to the entire domain.
The thing works in general, however every time I try to create a sound element on the fly:
jQuery( '<audio><source src="/beep.mp3" type="audio/mpeg"></source></audio>' );
... my console is showing some misfortune (taken from Chrome Canary for better messaging with worker worker thread, but basically the same result is in current Chrome):
Mixed Content: The page at 'https://my.domain.com/some/page' was loaded over HTTPS, but requested an insecure video ''. This content should also be served over HTTPS. GET https://my.domain.com/beep.mp3 400 (Service Worker Fallback Required)
I suppose it's important to note that obviously I am not getting the resource directly, just creating the element and letting the browser fetch the MP3.
MP3 does get sampled (I can run the .play () method on the audio element). It's just that errors in my console log are piling up and making me suspect how reliable this approach is. Also, by the way, in Canary (but not current) a crash will change my "HTTPS lock" indicator from green to "warning" (so future problem).
The audio source is on the same domain as the page and both are HTTPS. Thus, the Mixed Content message from the worker thread is strange; he refers to the video with "how".
Question : Am I doing something wrong or is this a Chrome bug? Do I need more than an empty (empty) worker service? If I am doing something wrong, I would like to find a best practice / long term type solution, not hack something together, but I will take what I can get.;)
source to share
it seems to be a bug. This is a google code problem:
source to share