Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Javascript media player not working on Android (working on browsers and iOS)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
barney  
View profile  
 More options Oct 10 2012, 6:34 am
From: barney <bradysde...@gmail.com>
Date: Wed, 10 Oct 2012 03:34:38 -0700 (PDT)
Local: Wed, Oct 10 2012 6:34 am
Subject: Javascript media player not working on Android (working on browsers and iOS)

I am creating an app which plays audio using a JS audio player. The idea is
to use Phonegap and deploy it on multiple platforms. It’s working fine on
iOS, Firefox (when .ogg is used) and Chrome. When I try to run it using the
Android emulator it doesn’t run. It does when I use a website URL and not a
locally saved ogg file. Therefore I think it is something simple, a little
over my head though!

Here <http://jsfiddle.net/barney278/DVqj4/> is the index file and JS script.

Not sure how to load files on the site, but I’m sure you can get the idea.
The ogg file is located in the assets folder of the Android project on my
computer.

Here is the log from eclipse:

10-09 12:38:26.140: E/MediaPlayer(876): Error (-38,0) 10-09 12:38:26.370:
D/CordovaLog(876): Uncaught TypeError: Cannot call method 'confirm' of
undefined 10-09 12:38:26.370: D/CordovaLog(876):
file:///android_asset/www/scripts/html5audio.js: Line 75 : Uncaught
TypeError: Cannot call method 'confirm' of undefined 10-09 12:38:26.370:
E/Web Console(876): Uncaught TypeError: Cannot call method 'confirm' of
undefined at file:///android_asset/www/scripts/html5audio.js:75 10-09
12:38:26.440: E/MediaPlayer(876): error (1, -2147483648) 10-09
12:38:26.500: E/MediaPlayer(876): Error (1,-2147483648)

And here is the bit of JS which seems to be causing the problem, line 75 is
highlighted:

// navigator.notification.alert('Streaming failed. Possibly due to a network error.', null, 'Stream error', 'OK');
***LINE 75***navigator.notification.confirm(
            'Streaming failed. Possibly due to a network error.', // message
            onConfirmRetry, // callback to invoke with index of button pressed
            'Stream error', // title
            'Retry,OK'      // buttonLabels


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.