V
V
Vladimir Kozhin2015-05-20 13:17:22
JavaScript
Vladimir Kozhin, 2015-05-20 13:17:22

How to make cordova-plugin-media (THREAD WARNING) work?

I use the cordova-plugin-media plugin (version 1.0.0), I try to play the file as As a result, it does not play and the following is written to the console:
new Media('..src..').play()

Playing audio sample '/private/var/mobile/Containers/Bundle/Application/85D971B8-4DE8-4BE8-99C1-E567880111F5/HelpOnClick.app/www/resources/sounds/new_msg.mp3'
2015-05-19 12:00: 36.390 HelpOnClick[1667:995075] THREAD WARNING: ['Media'] took '206.766113' ms. Plugin should use a background thread.
2015-05-19 12:00:36.789 HelpOnClick[1667:995075] Finished playing audio sample '/private/var/mobile/Containers/Bundle/Application/85D971B8-4DE8-4BE8-99C1-E567880111F5/HelpOnClick.app/www/ resources/sounds/new_msg.mp3'

The strangest thing is that I do not try to play this file in the background.
I tried to do this. I tried to use the fork from here https://github.com/apache/cordova-plugin-media/pull/12 nothing helps, always this error. I run the application on ios8, I build on the latest xcode.
play({playAudioWhenScreenIsLocked: false}).

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question