Re: [node-webkit] Need assistance setting up node-webkit to play mp3

13 views
Skip to first unread message

Roger WANG

unread,
Dec 20, 2012, 8:05:51 AM12/20/12
to ram...@mangosense.com, node-...@googlegroups.com
<ram...@mangosense.com> writes:

> Hi All,
> I am evaluating node-webkit for e-publishing platform. The app is
> going to be a cross platform, so i thought it would be a great fit. I am
> able to run the current chrome app with few changes in node-webkit. It
> worked like a charm. But then i found the major trouble with mp3 codecs. As
> per this post
> https://github.com/rogerwang/node-webkit/wiki/Support-mp3-and-h264-in-video-and-audio-tag ,
> dud to licencing issues nw doesn't supply the necessary codecs to play
> mp3.

Though nw doesn't ship with any MP3 codec, you can add it on your own if
you have the patent license. The way to add it is listed on the wiki.
>
> So i though i could distribute the flash player with the app and let the
> flash take care of mp3 playing part. So i have downloaded flash .so file
> (for linux) and put it in the plugins folder. And I have verified the
> "navigator.plugins" in javascript. It loaded just fine. But now i am facing
> another issue. Flash seems to not to load the local .swf files due to
> security reasons. I got the following error
>
> *An ActionScript error has occurred:*
> *SecurityError: Error #2060: Security sandbox violation: ExternalInterface
> caller file:///home/yoxb/work/pubber/scripts/Jplayer.swf cannot access
> file:///home/yox/work/pubber/index.html.*

I'll see whether there is a workaround for this error.

--
Roger WANG Intel Open Source Technology Center

Ram

unread,
Dec 20, 2012, 8:10:15 AM12/20/12
to node-...@googlegroups.com, ram...@mangosense.com
Thanks Roger. waitin for the good news :)

Ram

unread,
Dec 21, 2012, 7:42:58 AM12/21/12
to node-...@googlegroups.com, ram...@mangosense.com

Hi Roger. Any updates on the flash issue.

Thanks
Ramesh

Jonathan Chayce Dickinson

unread,
Dec 24, 2012, 3:12:56 AM12/24/12
to node-...@googlegroups.com
Any specific reason you rejected Ogg Vorbis?

Jonathan


On Thu, Dec 20, 2012 at 2:59 PM, Ramesh kumar Velusamy <rame...@gmail.com> wrote:
Hi All,
       I am evaluating  node-webkit for e-publishing platform. The app is going to be a cross platform, so i thought it would be a great fit. I am able to run the current chrome app with few changes in node-webkit. It worked like a charm. But then i found the major trouble with mp3 codecs. As per this post https://github.com/rogerwang/node-webkit/wiki/Support-mp3-and-h264-in-video-and-audio-tag , dud to licencing issues nw doesn't supply the necessary codecs to play mp3. 

So i though i could distribute the flash player with the app and let the flash take care of mp3 playing part. So i have downloaded flash .so file (for linux) and put it in the plugins folder. And I have verified the "navigator.plugins" in javascript. It loaded just fine. But now i am facing another issue. Flash seems to not to load the local .swf files due to security reasons. I  got the following error

An ActionScript error has occurred:
SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller file:///home/yoxb/work/pubber/scripts/Jplayer.swf cannot access file:///home/yox/work/pubber/index.html.

I have tried adding crossdomain.xml file but the error still persist. I am totally struck here now. I know this error is from flash. And i know there is a option in flash settings to allow local files to be accessed from browser. But i wanted to know is there a better way or a workaround to fix this issue.?

If there is no way, what would be the other alternatives to load mp3 content  node-webkit. 

Any help would really be appreciated.

Cheers
Ramesh

Thomas Klaen

unread,
Dec 24, 2012, 5:11:54 AM12/24/12
to node-...@googlegroups.com, ram...@mangosense.com
Not really a help to your problem, but generally, MP3 licensing is not open, so majority of developers prefer OGG or compressed WAV in their projects (games, etc), as it is as good, and in some cases even better alternative to MP3.

Jonathan Chayce Dickinson

unread,
Dec 25, 2012, 5:36:31 AM12/25/12
to node-...@googlegroups.com, ram...@mangosense.com
Ram the workaround would be to run a HTTP server in the node part of webkit and redirect the user to that.

However, really consider Ogg. Ogg is superior to MP3 (in theory, it's on-par with MP3+): you get more quality out of it for a lower bitrate. There are some blind tests here: http://soundexpert.org/encoders. In general, Ogg is better at all bitrates except around 128kbps - where it is similar.

Jonathan
Reply all
Reply to author
Forward
0 new messages