Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8596759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:45:21+00:00 2026-06-12T00:45:21+00:00

My problem: I use the Media Class from Cordova. The MP3 file is only

  • 0

My problem:

I use the Media Class from Cordova.
The MP3 file is only played once (the first time).

Code:

Add this code to the Cordova Starter project to reproduce my problem:

    var playCounter = 0;
    function playMP3(){
      console.log("playMP3() counter " + playCounter);
      var my_media = new Media("app/www/test.mp3");//ressource buildAction == content
      my_media.play();
      playCounter++;
    }
    [...]
    <p onclick="playMP3();">Click to Play MP3</p>

VS output:

[...]
GapBrowser_Navigated :: /app/www/index.html
'UI Task' (Managed): Loaded 'System.ServiceModel.Web.dll'
'UI Task' (Managed): Loaded 'System.ServiceModel.dll'
Log:"onDeviceReady. You should see this message in Visual Studio's output window."
'UI Task' (Managed): Loaded 'Microsoft.Xna.Framework.dll'
Log:"playMP3() counter 0"
'UI Task' (Managed): Loaded 'System.SR.dll'
Log:"media on status :: {\"id\": \"fa123123-bc55-a266-f447-8881bd32e2aa\", \"msg\": 1, \"value\": 1}"
A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dll
Log:"media on status :: {\"id\": \"fa123123-bc55-a266-f447-8881bd32e2aa\", \"msg\": 1, \"value\": 2}"
Log:"media on status :: {\"id\": \"fa123123-bc55-a266-f447-8881bd32e2aa\", \"msg\": 2, \"value\": 2.141}"
Log:"media on status :: {\"id\": \"fa123123-bc55-a266-f447-8881bd32e2aa\", \"msg\": 1, \"value\": 4}"
Log:"playMP3() counter 1"
A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.IOException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.dll
Log:"media on status :: {\"id\": \"2de3388c-bbb6-d896-9e27-660f1402bc2a\", \"msg\": 9, \"value\": 5}"

My Config:

  • cordova-1.6.1.js
  • Lumia 800
  • WP 7.5 (7.10.7740.16)

WorkAround (kind of):

  • Desactivate the app (turn off the screen)
  • reactivate the app (turn on the screen)
  • -> you get one more shot.

Any help is welcome as I am blocked on this since may days and I found no usefull information anywhere.

Also, Can you tell me if this code work on your config ?

.

.

.

Update: add a demo code, Cordova 1.8.0rc1

using a global var. Keeping the instance alive.

result

  • The test2.mp3 is played and can replay fine.
  • the test.mp3 is not played at all.
  • It is the first file you play that will work.

Code

  function onDeviceReady()
  {
  document.getElementById("welcomeMsg").innerHTML += "Cordova is ready! version=" + window.device.cordova;
  console.log("onDeviceReady. You should see this message in Visual Studio's output window.");
  my_media = new Media("app/www/test.mp3");//ressource buildAction == content
  my_media2 = new Media("app/www/test2.mp3");//ressource buildAction == content
  }

  var playCounter = 0;
  var my_media = null;
  function playMP3(){
    console.log("playMP3() counter " + playCounter);
    my_media.play();
    playCounter++;
  }

  var my_media2 = null;
  function playMP32(){
    console.log("playMP32() counter " + playCounter);
    my_media2.play();
    playCounter++;
  }

</script>
[...]

<p onclick="playMP3();">Click to Play MP3</p>
<p onclick="playMP32();">Click to Play MP3 2</p>

VS output:

Log:"onDeviceReady. You should see this message in Visual Studio's output window."
INFO: startPlayingAudio could not find mediaPlayer for 71888b14-86fe-4769-95c9-a9bb05d5555b
Log:"playMP32() counter 0"
INFO: startPlayingAudio could not find mediaPlayer for 71888b14-86fe-4769-95c9-a9bb05d5555b
Log:"playMP32() counter 1"
Log:"playMP3() counter 2"
INFO: startPlayingAudio could not find mediaPlayer for b60fa266-d105-a295-a5be-fa2c6b824bc1
A first chance exception of type 'System.ArgumentException' occurred in System.Windows.dll
Error: El parámetro es incorrecto. 
Log:"playMP32() counter 3"
INFO: startPlayingAudio could not find mediaPlayer for 71888b14-86fe-4769-95c9-a9bb05d5555b

.

.

.

Update: Cordova 2.0.0

I upated the Apache bug report with a test case for 2.0.0.

Can anybody reproduce this ?

link to bug report:
https://issues.apache.org/jira/browse/CB-941

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:45:23+00:00Added an answer on June 12, 2026 at 12:45 am

    was a Cordova bug
    https://issues.apache.org/jira/browse/CB-941

    solved by purpulecabbage in his repo of gitHub. see comment on bug report.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

well this is my problem i use 2 source first query (select * from
I have build an app that use mp3-files. In the first version the files
I am developing a program that use DirectShow to grab audio data from media
i have problem use link_to_remote link_to_remote document example say link_to_remote Delete this post, :update
I had a Problem to use DotNet 4.0 DLL in a DotNet 2.0 Application,
I'm new in codeigniter I have problem I use my OS X Lion, and
I have assignment to work on producer and consumer problem by use thread and
Okay, so here's my problem: We use FOP for creating pretty report output. We
I have quite a problem concerning the use of relational database concepts in Delphi
I am having a problem trying to use the prependTo() function in jQuery... for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.