Sound files on the internet won't load

72 views
Skip to first unread message

Eflite

unread,
Jan 17, 2012, 7:51:34 PM1/17/12
to gwt-voices
Sound files (wav) bundled with my GWT-project, residing in the war-
folder, loades without problems. However, when I'm loading a url
located on the internet, it seems as the load state never changes from
LOAD_STATE_SUPPORTED_NOT_READY. Obviously, the sound won't play.

Have I missed something, -is there any caveats to this?

Cheers,
Eflite

Fred Sauer

unread,
Jan 21, 2012, 7:13:40 PM1/21/12
to gwt-v...@googlegroups.com
This is a cross domain / cross origin (CORS) restriction.

Eflite

--
You received this message because you are subscribed to the Google Groups "gwt-voices" group.
To post to this group, send email to gwt-v...@googlegroups.com.
To unsubscribe from this group, send email to gwt-voices+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gwt-voices?hl=en.




--
Fred Sauer
fr...@allen-sauer.com

Eflite

unread,
Feb 18, 2012, 2:27:45 PM2/18/12
to gwt-voices
Thank you for replying, but the link you posted didn't really make me
any wiser.
Is there any way to play cross-origin sounds through gwt?

Thanks,
Eflite

On Jan 22, 1:13 am, Fred Sauer <f...@allen-sauer.com> wrote:
> This is a cross domain / cross origin (CORS <http://www.w3.org/TR/cors/>)
> restriction.
> T
>
>
>
>
>
>
>
>
> On Tue, Jan 17, 2012 at 4:51 PM, Eflite <skjerv...@gmail.com> wrote:
> > Sound files (wav) bundled with my GWT-project, residing in the war-
> > folder, loades without problems. However, when I'm loading a url
> > located on the internet, it seems as the load state never changes from
> > LOAD_STATE_SUPPORTED_NOT_READY. Obviously, the sound won't play.
>
> > Have I missed something, -is there any caveats to this?
>
> > Cheers,
> > Eflite
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "gwt-voices" group.
> > To post to this group, send email to gwt-v...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > gwt-voices+...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/gwt-voices?hl=en.
>
> --
> Fred Sauer
> f...@allen-sauer.com

Fred Sauer

unread,
Feb 22, 2012, 12:28:25 AM2/22/12
to gwt-v...@googlegroups.com
Yes. You may need to use SoundController#createSound(String mimeType, String url, boolean streaming, boolean crossOrigin) with crossOrigin=true. In addition, you will then need to set the appropriate CORS headers on the server, as part of the response when you serve those cross origin sound files.
fr...@allen-sauer.com

Eflite

unread,
Feb 23, 2012, 5:28:03 AM2/23/12
to gwt-voices
Thank you replying.
I implemented both steps, adding the CORS header stuff to my internet
server, and the crossOrigin=true in your lib. However, it didn't seem
to have any effect.

The sound file I'm trying to play is http://ajaxroom.com/AppResources/flop.wav

I've altered the HTTP response headers for this site through IIS, and
I can't figure out why it's still not working. Any suggestions?

cheers,
Eflite
> f...@allen-sauer.com

Eflite

unread,
Feb 23, 2012, 5:32:43 AM2/23/12
to gwt-voices
By the way, I inspected the received http response header, and it
looks like this:

HTTP/1.1 200 OK
Content-Type: audio/wav
Last-Modified: Sat, 07 Jan 2012 01:55:25 GMT
Accept-Ranges: bytes
ETag: "8024156cdfcccc1:0"
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Access-Control-Allow-Origin: *
Date: Thu, 23 Feb 2012 10:30:56 GMT
Content-Length: 2300


To my understanding, this should be ok?

Cheers,
Eflite


On Feb 23, 11:28 am, Eflite <skjerv...@gmail.com> wrote:
> Thank you replying.
> I implemented both steps, adding the CORS header stuff to my internet
> server, and the crossOrigin=true in your lib. However, it didn't seem
> to have any effect.
>
> The sound file I'm trying to play ishttp://ajaxroom.com/AppResources/flop.wav

Fred Sauer

unread,
Feb 24, 2012, 2:45:25 PM2/24/12
to gwt-v...@googlegroups.com
Can you confirm that the HTTP request contains
   Origin: yourdomain.com

The response then should have:
  Access-Control-Allow-Origin: yourdomain.com
or:
  Access-Control-Allow-Origin: *

Reply all
Reply to author
Forward
0 new messages