]>
git.proxmox.com Git - sencha-touch.git/blob - src/src/Audio.js
2 * {@link Ext.Audio} is a simple class which provides a container for the
3 * [HTML5 Audio element](http://developer.mozilla.org/en-US/docs/Using_HTML5_audio_and_video).
5 * ## Recommended File Types/Compression:
7 * * Uncompressed WAV and AIF audio
14 * On Android devices, the audio tags controls do not show. You must use the {@link #method-play},
15 * {@link #method-pause}, and {@link #toggle} methods to control the audio (example below).
19 * This example shows the use of the {@link Ext.Audio} component in a fullscreen container--change
20 * the url: item for the location of an audio file--note that the audio starts on page load:
23 * Ext.create('Ext.Container', {
38 * url : 'touch-build/examples/audio/crash.mp3'
43 * You can also set the {@link #hidden} configuration of the {@link Ext.Audio} component to true by default,
44 * and then control the audio by using the {@link #method-play}, {@link #method-pause}, and {@link #toggle} methods:
47 * Ext.create('Ext.Container', {
64 * handler: function() {
65 * var container = this.getParent().getParent(),
66 * // use ComponentQuery to get the audio component (using its xtype)
67 * audio = container.down('audio');
70 * this.setText(audio.isPlaying() ? 'Pause' : 'Play');
74 * { text: 'Play', flex: 1 }
78 * html: 'Hidden audio!',
79 * styleHtmlContent: true
84 * url : 'touch-build/examples/audio/crash.mp3'
89 Ext
.define('Ext.Audio', {
98 cls
: Ext
.baseCSSPrefix
+ 'audio'
102 * The location of the audio to play.
104 * ### Recommended file types are:
105 * * Uncompressed WAV and AIF audio
114 onActivate: function() {
119 if (Ext
.os
.is
.Phone
) {
125 onDeactivate: function() {
130 if (Ext
.os
.is
.Phone
) {
139 cls
: Ext
.baseCSSPrefix
+ 'component'