mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-07 12:15:51 +00:00
21 lines
561 B
HTML
21 lines
561 B
HTML
<html>
|
|
<head>
|
|
<title>Sound Service Play Example</title>
|
|
</head>
|
|
|
|
<body>
|
|
<script>
|
|
var filespec = Components.classes["component://netscape/filespec"].createInstance();
|
|
filespec = filespec.QueryInterface(Components.interfaces.nsIFileSpec);
|
|
filespec.URLString = "file://res/samples/test.wav";
|
|
|
|
var sample = Components.classes["component://netscape/sound"].createInstance();
|
|
sample = sample.QueryInterface(Components.interfaces.nsISound);
|
|
</script>
|
|
|
|
<form name="form">
|
|
<input type="button" value="Play Sound" onclick="sample.Play(filespec);">
|
|
<form>
|
|
</body>
|
|
</html>
|