Media API not working on Windows Phone 8 (WP8)

1,105 views
Skip to first unread message

karimlsl

unread,
Mar 21, 2013, 8:19:01 PM3/21/13
to phon...@googlegroups.com
I am doing an app using Phonegap or Cordova 2.5.0 for Windows Phone 7 & 8. I am able to play sounds using the Media API on WP7 but for some reason this is not working on WP8. Has anyone tested this on WP8? Is there any special setups?
Thanks for your help,
Karim

karimlsl

unread,
Mar 22, 2013, 12:38:14 AM3/22/13
to phon...@googlegroups.com
Adding more information, I see the following errors when a sound is triggered in the app:
 

- The thread 0xb04 has exited with code 259 (0x103).

- A first chance exception of type 'System.NullReferenceException' occurred in TestApp WP8.DLL

- An exception of type 'System.NullReferenceException' occurred in TestApp WP8.DLL and wasn't handled before a managed/native boundary

 
 
Thanks for your help
 
Karim

Jesse

unread,
May 24, 2013, 6:56:18 PM5/24/13
to phon...@googlegroups.com
1. Make sure you are including the audio file as a resource to the VS project.
2. If you are running on WP7 ( and Windows 7 ) on the device, the Zune software causes an issue when connected.

If neither of these is the issue, please post a brief example that demonstrates the issue, and I will have a look.

Also, you can ignore debug output like this [1] 
The first line just shows that a thread was created and exitted.  Every API gets a new thread, so there are many of these.
The next 2 lines just mean that an exception was thrown, ( and caught, otherwise the app would crash ) 

[1]

- The thread 0xb04 has exited with code 259 (0x103).

- A first chance exception of type 'System.NullReferenceException' occurred in TestApp WP8.DLL

- An exception of type 'System.NullReferenceException' occurred in TestApp WP8.DLL and wasn't handled before a managed/native boundary


Cheers,
  Jesse

@purplecabbage


On Fri, May 24, 2013 at 8:39 AM, Nesim Sisa <nesim.e...@gmail.com> wrote:

I am having a similar issue. I can get Android to play sound using the Cordova 2.5 media object. However Windows Phone 7 and 8 is not playing sound. And I am not getting error messages.
Anyone have any progress on this issue?


On Thursday, March 21, 2013 5:19:01 PM UTC-7, karimlsl wrote:
--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Tim

unread,
Jun 11, 2013, 3:30:37 PM6/11/13
to phon...@googlegroups.com
I am also having the same problem with version 2.7.  Here is the output, this is from the point I first load the code, I then hit my button the first time and get nothing, hit it a second time and it plays the sound, but in all cases there seems to be errors and more going on than should be.  like i appears the success fires more than the one success..  Out put and my code below...

OutPut

'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: DefaultDomain): Loaded 'C:\windows\system32\mscorlib.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Windows.RuntimeHost.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Windows.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Net.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Xml.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\Data\Programs\{13B7EC4F-D4CF-422B-90EF-CD9C48AF66AB}\Install\PaintnPlay.DLL'. Symbols loaded.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\Microsoft.Phone.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\Microsoft.Phone.Interop.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Xml.Linq.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Core.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
plugin Device
plugin Logger
plugin Camera
plugin NetworkStatus
plugin DebugConsole
plugin Echo
plugin Notification
plugin Media
plugin Capture
plugin SplashScreen
plugin Globalization
plugin SaveImagePhotoRoll
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Runtime.Serialization.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Updating IsolatedStorage for APP:DeviceID :: d7c53c83-1b28-4fab-89d9-a7dd6ce4e6ea
CordovaBrowser_Navigated :: www/index.html
CordovaBrowser_Navigated :: //www/index.html
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\en-US\mscorlib.debug.resources.dll'. Module was built without symbols.
An exception of type 'System.NotSupportedException' occurred in Microsoft.Phone.ni.dll and wasn't handled before a managed/native boundary
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.ServiceModel.Web.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread 0x3ec has exited with code 259 (0x103).
The thread 0x17dc has exited with code 259 (0x103).
Log:"in phone"
The thread 0x1128 has exited with code 259 (0x103).
Log:"in myplay"
The thread 0x248 has exited with code 259 (0x103).
Log:"currnent canvas x-wmapp0://www/Appimages/colorbook/landing.png"
The thread 0x15e8 has exited with code 259 (0x103).
Log:"sound = resources/landing.mp3"
The thread 0xf48 has exited with code 259 (0x103).
Log:"src in playaudio = resources/landing.mp3"
The thread 0xe4c has exited with code 259 (0x103).
The thread 0x948 has exited with code 259 (0x103).
A first chance exception of type 'System.ArgumentException' occurred in mscorlib.ni.dll
An exception of type 'System.ArgumentException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
The thread 0x334 has exited with code 259 (0x103).
Log:"in myplay"
The thread 0xd80 has exited with code 259 (0x103).
Log:"currnent canvas x-wmapp0://www/Appimages/colorbook/landing.png"
The thread 0x14f4 has exited with code 259 (0x103).
Log:"sound = resources/landing.mp3"
The thread 0x14b0 has exited with code 259 (0x103).
Log:"src in playaudio = resources/landing.mp3"
The thread 0xb84 has exited with code 259 (0x103).
The thread 0x24 has exited with code 259 (0x103).
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\Microsoft.Xna.Framework.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Log:"Audio Success"
Log:"Audio Success"
The thread 0x121c has exited with code 259 (0x103).
The thread 0x814 has exited with code 259 (0x103).
Log:"Audio Success"
The thread 0xaf4 has exited with code 259 (0x103).



code


// Audio player
//
var my_media = null;
var mediaTimer = null;

// Play audio
//
function playAudio(src) {
    console.log("src in playaudio = " + src);
    if (my_media == null)
    {
        // Create Media object from src
        my_media = new Media(src, onplaySuccess, onplayError);
    } // else play current audio
    // Play audio
    
    my_media.play();

  
}



// onSuccess Callback
//
function onplaySuccess() {
    console.log("Audio Success");
 
    
}

// onError Callback 
//
function onplayError(error) {
    console.log('code: ' + error.code + '\n' + 'message: ' + error.message + '\n');
}

purplecabbage

unread,
Jun 12, 2013, 8:14:28 PM6/12/13
to phon...@googlegroups.com
Thanks for the detailed log.
I have created an issue in JIRA, you can follow it here: https://issues.apache.org/jira/browse/CB-3783

Cheers,
  Jesse


On Thursday, March 21, 2013 5:19:01 PM UTC-7, karimlsl wrote:
Reply all
Reply to author
Forward
0 new messages