Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Did anyone have any luck getting cordoba-plugin-nativeaudio working on a real device running iOS 9.2?

$
0
0

@chicheongweng wrote:

I am using Ionic with this plugin.

The below code works on an iPhone 6 emulator running iOS 9.2 and an actual android device.

But when I run it on a real iPhone 5 running iOS 9.2 there is no audio. Any clue??

Here is my code snippet:

.run(function($ionicPlatform, PushNotificationsService, $rootScope, $ionicConfig, $timeout) {
console.log('app.run');
$ionicPlatform.on("deviceready", function(){
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}

if( window.plugins && window.plugins.NativeAudio ) {

window.plugins.NativeAudio.preloadSimple( 'click', 'audio/driver.mp3',        function(msg){
    console.log('Playig click ...');
    window.plugins.NativeAudio.play('click');
    },
    function(msg){
    console.log( 'error: ' + msg );
    }
    );
}
PushNotificationsService.register();

});

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>