HTML5 Audio tag

Moderator: cah

Post Reply
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1342
Joined: Sun Aug 17, 2008 5:05 am

HTML5 Audio tag

Post by cah »

In the past, the openwebmail needs QuickTime plugin to pronounce "You've got mail!" with the <embed> tag.

Apple stopped supporting it for windows and the last available version is 7.7.9.

I checked online and found HTML5 provides a similar function without the need of the plugin. It is either the <video> or <audio> tag that can play audio and video.

I then changed the source code of openwebmail (openwebmail-main.pl and openwebmail-read.pl) to use the HTML <audio tag>.

Old:

Code: Select all

$html.=qq|<embed src="$config{'ow_htmlurl'}/sounds/$prefs{'newmailsound'}" autostart="true" hidden="true">\n|;
New:

Code: Select all

$html.=qq|<audio autoplay>\n<source src="$config{'ow_htmlurl'}/sounds/$prefs{'newmailsound'}" type="audio/wav">\n</audio>\n|;
It worked as expected.

<video> tag can do similar. More to explore.
CAH, The Great
Post Reply