Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
swdev:js:javascript_code_snippets [2016/05/20 10:03] smayr [Audio Support] |
swdev:js:javascript_code_snippets [2018/02/09 14:07] (current) smayr |
||
---|---|---|---|
Line 37: | Line 37: | ||
</ | </ | ||
== Query Touch Device == | == Query Touch Device == | ||
- | <code html file sample.php> | + | File '' |
+ | <code html > | ||
< | < | ||
... | ... | ||
Line 69: | Line 70: | ||
</ | </ | ||
- | <code javascript file utils.js> | + | File '' |
+ | <code javascript> | ||
// | // | ||
// Test whether client device supports touch. | // Test whether client device supports touch. | ||
Line 97: | Line 99: | ||
Preload audio clips and play them. Add the following to a webpage: | Preload audio clips and play them. Add the following to a webpage: | ||
- | < | + | < |
< | < | ||
< | < | ||
Line 132: | Line 134: | ||
<div class=" | <div class=" | ||
< | < | ||
- | <p>An audio clip</ | + | <p>A preloaded |
<audio controls preload=" | <audio controls preload=" | ||
<source src=" | <source src=" | ||
Line 139: | Line 141: | ||
Your browser does not support the audio element. | Your browser does not support the audio element. | ||
</ | </ | ||
+ | <p>An autoplay clip</ | ||
+ | <audio src=" | ||
</ | </ | ||
</ | </ | ||
Source: | Source: | ||
- | * [[http:// | + | * [[http:// |
+ | * [[http:// | ||
* [[http:// | * [[http:// |