You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ripple.apache.org by "Tomsz Trejderowski (JIRA)" <ji...@apache.org> on 2013/07/23 09:20:57 UTC

[jira] [Created] (RIPPLE-41) Incorrect path for playing audio using PhoneGap's Media object

Tomsz Trejderowski created RIPPLE-41:
----------------------------------------

             Summary: Incorrect path for playing audio using PhoneGap's Media object
                 Key: RIPPLE-41
                 URL: https://issues.apache.org/jira/browse/RIPPLE-41
             Project: Apache Ripple
          Issue Type: Bug
            Reporter: Tomsz Trejderowski


When developing PhoneGap application for Android platfrom, following path fix is required (path <strong>/android_asset/www/</strong> must be added to real path to played file):

<code>playAudio: function(file)
{
    /**
     * Fix for Android platform
     * 
     * https://gist.github.com/alunny/2380994
     */
    if(device.platform === 'Android') file = '/android_asset/www/' + file;

    var media = new Media(file, successFunction, errorFunction);

    media.play();
}</code>

Without this fix, Android won't play audio in PhoneGap application and will call <strong>errorFunction</strong> instead, with error code corresponding to file not being found condition).

Yet, Ripple doesn't make use of that fix, if Android is selected as a platform. If file path is given without extra addition, Ripple plays audio (while it shouldn't) and when fix is applied, it calls errorFunction (while it should play audio then).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira