E
E
Evgeny Kuznetsov2014-08-27 13:24:21
phonegap
Evgeny Kuznetsov, 2014-08-27 13:24:21

How to properly connect plugins in phonegap?

Everything was done according to the instructions,
Create a project:
phonegap create test3
Enter it:
cd test3/
Add a platform:
cordova platform add ios
Add a plugin:
cordova plugin add org.apache.cordova.media
The plugin is included in the config.xml file : Collected
the project:
phonegap build ios
In the code we tried to reproduce the file:

var my_media = new Media('http://site.ru/file.mp3',
        // success callback
        function () {
            alert("playAudio():Audio Success");
        },
        // error callback
        function (err) {
            alert("playAudio():Audio Error: " + err);
        }
    );
    // Play audio
    my_media.play();

What we get is this:
ReferenceError: Can't find variable: Media (16:08:09:495 | error, javascript)
As I understand it, the plugin is not connected ...
I tried to run the application in the emulator, and debug it on the iPhone through Safari (in NetBeans has such a feature)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Kuznetsov, 2014-08-27
@evgentus

Everything was decided by deleting the project and creating a zero. All plugins were picked up without problems. I didn't understand what the problem was...

S
Sergey, 2014-08-27
Protko @Fesor

Is it really that hard to open a project in xcode or android studio and see if plugins have been added to the project?
ps I myself prefer to put planins through plugman.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question