Help with sound, please

20 views
Skip to first unread message

hartum

unread,
Nov 26, 2009, 11:27:31 AM11/26/09
to phonegap
Hi everybody (and sorry for my english)

I am trying to play a sound in an iphone, so I dowload the phonegap
code, go to to folder /iphone and execute the "PhoneGap.xcodeproj"
everything work fine.

Then I go to "/iphone/www/index.html" and edit the "index.html" file,
with this code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
TR/html4/strict.dtd">
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html;
charset=utf-8">
<title>My sound test</title>
<link rel="stylesheet" href="master.css" type="text/css"
media="screen" title="no title" charset="utf-8">

<script type="text/javascript" charset="utf-8">
new Media('beep.wav').play();
</script>
</head>
<body id="stage" class="theme">
</body>
</html>

But is not working :-(, I think I need to include some js file but I
have not idea about what.
can you help me with this? It will be very apreciatte.

Thank you very much.

Shazron Abdullah

unread,
Nov 26, 2009, 11:58:04 AM11/26/09
to hartum, phonegap
You forgot to include the "phonegap.js" file. See the original
index.html
> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com

hartum

unread,
Nov 26, 2009, 12:39:34 PM11/26/09
to phonegap
That is what I thought, but still not working.
I tried this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
TR/html4/strict.dtd">
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html;
charset=utf-8">
<title>My sound test.</title>
<link rel="stylesheet" href="master.css" type="text/css"
media="screen" title="no title" charset="utf-8">
<script type="text/javascript" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8">
new Media('beep.wav').play();
</script>
</head>
<body id="stage" class="theme">
</body>
</html>


But if I include the "app.js" It work but write a lot rubbish in the
screen, just in this way:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
TR/html4/strict.dtd">
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html;
charset=utf-8">
<title>My sound test.</title>
<link rel="stylesheet" href="master.css" type="text/css"
media="screen" title="no title" charset="utf-8">
<script type="text/javascript" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8">
new Media('beep.wav').play();
</script>
</head>
<body id="stage" class="theme">
</body>
</html>

any ideas?

Thanks a lot

hartum

unread,
Nov 26, 2009, 12:52:53 PM11/26/09
to phonegap

sorry there is a mistake in my last post, resume:

if I include:
<script type="text/javascript" charset="utf-8" src="phonegap.js"></
script>
Media Don't work


If I include:
<script type="text/javascript" charset="utf-8" src="app.js"></script>

Media work, and the sound play

any ideas?

Shazron Abdullah

unread,
Nov 26, 2009, 1:11:17 PM11/26/09
to phonegap
Phonegap.js not loaded yet
Call your code in window load event or onclick event of an element
Reply all
Reply to author
Forward
0 new messages