1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    2
    Vote Rating
    0
    sergzach is on a distinguished road

      0  

    Default Unanswered: Can't play audio on Android - Sencha Touch SDK tools 2.0.0

    Unanswered: Can't play audio on Android - Sencha Touch SDK tools 2.0.0


    I heard that Android devices do not play some audio files in html5 (for example they support mp3 but do not play files created with help of some standart soft: [the link][1]).


    I tried different variants, but no one worked for me.


    E.g. the standart example from [here][2]:




    Ext.create('Ext.Container', {
    fullscreen: true,
    layout: {
    type: 'vbox',
    pack: 'center'
    },
    items: [
    {
    xtype : 'toolbar',
    docked: 'top',
    title : 'Ext.Audio'
    },
    {
    xtype: 'toolbar',
    docked: 'bottom',
    defaults: {
    xtype: 'button',
    handler: function() {
    var container = this.getParent().getParent(),
    // use ComponentQuery to get the audio component (using its xtype)
    audio = container.down('audio');

    audio.toggle();
    this.setText(audio.isPlaying() ? 'Pause' : 'Play');
    }
    },
    items: [
    { text: 'Play', flex: 1 }
    ]
    },
    {
    html: 'Hidden audio!',
    styleHtmlContent: true
    },
    {
    xtype : 'audio',
    hidden: true,
    url : 'touch/examples/audio/crash.mp3'
    }
    ]
    });


    And audio in html:


    <audio controls>
    <source src="resources/sound/1.mp3" type="audio/mpeg">
    Can't play sound on your device.
    </audio>


    When I debug my application with help of the Chrome browser I hear the sound, but I do not hear it on a real device (Android 2.3.5).


    In case of the html variant I see that a slider twitches and immediately stay at the end of a progress bar. In case of the 'play' button everything works normally (graphics, play/pause) except the sound that is missing.


    I did not find any special Android permission option for sound, so, I think the permissions are not the reason.


    **The question**. Am I wrong and is it possible to play any mp3 audio? What is the easiest work around?


    [1]: http://www.brianhadaway.com/html5-au...droid-devices/
    [2]: http://docs.sencha.com/touch/2-0/#!/api/Ext.Audio

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Answers
    3540
    Vote Rating
    851
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    While I haven't tried Android 2.3 device is a very long time I know I have had the audio example that comes with ST 2 (and ST 1) working just fine.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Dec 2012
    Posts
    2
    Vote Rating
    0
    sergzach is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    While I haven't tried Android 2.3 device is a very long time I know I have had the audio example that comes with ST 2 (and ST 1) working just fine.
    Is it a standart example in sencha-touch-2.1.0-commercial/examples/ or something else? I tried also 'audio' example from the directory, it does not sound too.

Thread Participants: 1

Tags for this Thread