I believe a "tap" event in a Javascript page viewed in Safari fires normal
"click" handlers, so you could use the built-in attachEvent() function in
javascript or set an onclick="" attribute in HTML -- or you could use a
mini-framework like Zepto (https://github.com/madrobby/zepto#readme).
As far as playing a sound, there are a couple ways to play a sound natively
(http://www.phon.ucl.ac.uk/home/mark/audio/play.htm), but most of these
techniques will only work for uncompressed WAV files (and of course the IE &
Java approaches won't work on iOS). The usual approach is to use a free
embeddable flash-based player
(http://designshack.co.uk/articles/html/four-quick-and-easy-ways-to-embed-mp
3-files-into-your-site), but this won't work on iOS either.
-- peter
--
You received this message because you are subscribed to the Google Groups
"iPhoneWebDev" group.
To post to this group, send email to iphone...@googlegroups.com.
To unsubscribe from this group, send email to
iphonewebdev...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/iphonewebdev?hl=en.
R.
Le 17 janv. 11 à 11:42, Sudhakar a écrit :
That does on iOS and even the new blackberry 6.
Sent from my iPhone
Am i doing something wrong?
http://we-are-gurus.com/labs/audio.html
R.
Le 17 janv. 11 à 14:05, Stan Wiechers a écrit :
Sent from my iPhone
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
/* Play music in the background */
function play()
{
var a=new Audio("Apoptygma Berzerk - Kathy's Song (VNV Nation
Remix).mp3");
a.load();
a.play();
}
</script>
</head>
<body>
<div onClick='play();' style='width:50px; height:50px;
background-color:red;'></div>
</body>
</html>
/Mogens
On 17-01-2011 14:05, Stan Wiechers wrote:
> a=new Audio(URL);
> a.load();
> a.play();
>
> That does on iOS and even the new blackberry 6.
>
>
> Sent from my iPhone
>
> On Jan 17, 2011, at 6:15 AM, "R�mi Grumeau"<remi.g...@gmail.com> wrote:
>
>> Playing a video or music on an iPhone can only be done via QuickTime afaik.
>> I can be done on an iPad (at least H264 videos for sure)
>>
>> R.
>>
>> Le 17 janv. 11 � 11:42, Sudhakar a �crit :
Le 17 janv. 11 à 21:06, Mogens Beltoft a écrit :
>> On Jan 17, 2011, at 6:15 AM, "Rémi
>> Grumeau"<remi.g...@gmail.com> wrote:
>>
>>> Playing a video or music on an iPhone can only be done via
>>> QuickTime afaik.
>>> I can be done on an iPad (at least H264 videos for sure)
>>>
>>> R.
>>>
>>> Le 17 janv. 11 à 11:42, Sudhakar a écrit :
>>>
WOW !
Works here too (on iPhone 4)
Le 17 janv. 11 à 21:06, Mogens Beltoft a écrit :
I can make it work on iOS 4.2.1 by making a div, adding an onClick handler and calling your code from that handler.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
/* Play music in the background */
function play()
{
var a=new Audio("Apoptygma Berzerk - Kathy's Song (VNV Nation Remix).mp3");
a.load();
a.play();
}
</script>
</head>
<body>
<div onClick='play();' style='width:50px; height:50px; background-color:red;'></div>
http://google.com/search?q=safari+html+filetype:pdf+site:developer.apple.com
--
Jorge.
If I leave out the controls attribute the controls are not visible, but
the audio element takes up the same amount of space whether the controls
are there or not.
/Mogens
On 17-01-2011 21:37, Jorge Chamorro wrote:
> audio
> Embeds audio into a webpage.
> Syntax
> <audio src="url" autoplay="autoplay"<!-- Boolean attribute. Omit to prevent autoplay. --> start="00:00:00.00" loopstart="00:00:00.07"<!-- 7 seconds --> loopend="00:00:00.19" end="00:00:00.27" playcount="4"<!-- play 4x --> controls="true">
> Discussion
> The audio element may contain fallback content for browers that do not support this element. Any content enclosed within the audio element is ignored by browsers that support the audio element (but it must be valid HTML).
> The audio element supports inclusion of source elements to provide multiple versions of an audio clip encoded with different codecs, at different bit rates, and so on. These source elements must be the first elements inside the audio element before any fallback content. See �source� (page 42) for more information.