cordova-music-controls-plugin
cordova-music-controls-plugin copied to clipboard
Windows 10 Type mismatch exception
I am getting this exception
Exception calling native with command :: MusicControls :: create ::exception=TypeError: Type mismatch
Any help ?
Thank you
Can you show us some of your code? What version of the plugin are you using?
Hi, I am using 2.0.0
In config.xml
<plugin name="cordova-plugin-music-controls" spec="~2.0.0" />
In index.js
function onDeviceReady() {
document.addEventListener( 'pause', onPause.bind( this ), false );
document.addEventListener( 'resume', onResume.bind( this ), false );
var parentElement = document.getElementById('deviceready');
var listeningElement = parentElement.querySelector('.listening');
var receivedElement = parentElement.querySelector('.received');
listeningElement.setAttribute('style', 'display:none;');
MusicControls.create({
track: 'Track', // optional, default : ''
artist: 'Artist', // optional, default : ''
isPlaying: true, // optional, default : true
dismissable: false, // optional, default : false
hasPrev : true, // show previous button, optional, default: true
hasNext : true, // show next button, optional, default: true
hasClose: false, // show close button, optional, default: false
}, function () {
//Success CB
receivedElement.setAttribute('style', 'display:block;');
console.log("SUCCESS");
}, function () {
//Error CB
console.log("ERROR");
});
};
I am getting the following console messages
adding proxy for MusicControls
cordova.js (1015,9)
Exception calling native with command :: MusicControls :: create ::exception=TypeError: Type mismatch
cordova.js (993,13)
Thank you
Hi, any update on this issue ?
Sorry, I've been on vacation and haven't had time. What version of ionic native are you using? There was a short period of time where Music Controls were updated but Ionic Native's typescript definitions were not. Music Controls updated with Ionic Native version 3.12.2. Are you using that version also?
I unfortunately don't have a windows 10 device to do any testing. If you have more details on the error, please share them. Sorry for the delay!
I am using Cordova 6.3.1 and for windows platform cordova-windows 4.4.2
I am getting only this message when I build the project.
Exception calling native with command :: MusicControls :: create ::exception=TypeError: Type mismatch cordova.js (993,13)
@Virendrabaskar Can you supply more of the console log output? I assume it's failing exactly at the MusicControls.create
line?
@filfat @homerours Do either of you have a windows device to test with?
Yes , It is failing at the MusicControls.create line.
I am getting only the following console messages
adding proxy for MusicControls
cordova.js (1015,9)
Exception calling native with command :: MusicControls :: create ::exception=TypeError: Type mismatch
cordova.js (993,13)
Please refer the screenshot here https://drive.google.com/open?id=0BzMaNY4OqxdqemR0ZjRUcG02RUU
for the same.
Thank you
@BuddyLReno I have no windows device :( Sorry...