audio error:
when i m trying to play song online i got this error
2.factory is not a function
when i m using this
// IonicAudioModule.forRoot({ provide: AudioProvider, useFactory:
myCustomAudioProviderFactory }),
Following steps I followed -
1.i m import these on my app module.ts file
import { IonicAudioModule, AudioProvider, WebAudioProvider, defaultAudioProviderFactory, CordovaMediaProvider } from 'ionic-audio';
2. after that i m adding this
export function myCustomAudioProviderFactory() {
return new WebAudioProvider();
tried this also
return (window.hasOwnProperty('cordova')) ? new CordovaMediaProvider() : new WebAudioProvider();
}
3. and i m adding this in provider
i m trying this two type but i m not getting some error that i include
IonicAudioModule.forRoot(defaultAudioProviderFactory)
tried this also
IonicAudioModule.forRoot({ provide: AudioProvider, useFactory:
myCustomAudioProviderFactory }),
i getting two type of errors
2.factory is not a function when i m using this // IonicAudioModule.forRoot({ provide: AudioProvider, useFactory: myCustomAudioProviderFactory }),
Following steps I followed -
1.i m import these on my app module.ts file import { IonicAudioModule, AudioProvider, WebAudioProvider, defaultAudioProviderFactory, CordovaMediaProvider } from 'ionic-audio';
2. after that i m adding this export function myCustomAudioProviderFactory() { return new WebAudioProvider(); tried this also return (window.hasOwnProperty('cordova')) ? new CordovaMediaProvider() : new WebAudioProvider(); } 3. and i m adding this in provider