Getting the media plugin to work in the Evothings workbench
Posted: 01:08, 19 Feb 2015
Hello! I'm working on an Evothings app on iOS using Arduino/BLE and would like to play sounds through my Evothings project (without/before building the Cordova project, since the refresh function seems to work less well than just using Evothings by itself, and I won't have to be physically connected to the iPad).
I create a folder in my Evothings "code" project folder called "sounds", put a file inside it called "beep.mp3", and then put the following into my app.js folder inside a function:
var media = new Media("sounds/beep.mp3");
media.play();
When I try to connect to the Arduino and get to the part where that function is called (intially, as the Arduino is getting set up), I now get "initializing services..." until I comment out those two lines. However, when I create a Cordova project from my Evothings project in the usual way (putting all my Evothings project in the www folder, adding the "media" plugin to my Cordova app, and then building), those two lines work just fine and the whole app functions normally, including playing the sounds.
I think that some of the Cordova plugins are built into Evothings, based on the Cordova-Basic example, which seems to use some of the compass functions that are part of a Cordova plugin. However, the "media" plugin doesn't seem to be added to the Evothings Workbench Cordova project. Please let me know if you can think of a way to address this issue. Thank you!
I create a folder in my Evothings "code" project folder called "sounds", put a file inside it called "beep.mp3", and then put the following into my app.js folder inside a function:
var media = new Media("sounds/beep.mp3");
media.play();
When I try to connect to the Arduino and get to the part where that function is called (intially, as the Arduino is getting set up), I now get "initializing services..." until I comment out those two lines. However, when I create a Cordova project from my Evothings project in the usual way (putting all my Evothings project in the www folder, adding the "media" plugin to my Cordova app, and then building), those two lines work just fine and the whole app functions normally, including playing the sounds.
I think that some of the Cordova plugins are built into Evothings, based on the Cordova-Basic example, which seems to use some of the compass functions that are part of a Cordova plugin. However, the "media" plugin doesn't seem to be added to the Evothings Workbench Cordova project. Please let me know if you can think of a way to address this issue. Thank you!