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!
Getting the media plugin to work in the Evothings workbench
-
- Posts: 1
- Joined: 00:25, 19 Feb 2015
Re: Getting the media plugin to work in the Evothings workbe
Hi,
You are right that the media plugin is not included into Evothings Client. Here is a list of included plugins: http://evothings.com/doc/raw/studio/mob ... tedPlugins
What kind of problems are you experiencing when using your custom Cordova project with Evothings Workbench? You mention the refresh function seems to work less well. Are there any specific situations/use cases that don't work?
What you can do to make it easy to connect from your Cordova app to the Workbench is to make an HTML file (connect.html) with a text field where you can enter the IP-address of the Workbench. Then set that HTML file to be the main file used by the Cordova project during development. When testing the app and finally when shipping set the main file to index.html as usual. Will put together an example of this for you.
Here are some useful reading on the subject of using a custom Cordova app (instead of Evothings Client) with Evothings Workbench (I guess you have seen this already but others reading the thread might not):
http://evothings.com/doc/raw/build/cord ... rEvothings
http://evothings.com/cordova-starter-kit/
http://evothings.com/hybrid-app-development-made-fast/
Best regards, Mikael
You are right that the media plugin is not included into Evothings Client. Here is a list of included plugins: http://evothings.com/doc/raw/studio/mob ... tedPlugins
What kind of problems are you experiencing when using your custom Cordova project with Evothings Workbench? You mention the refresh function seems to work less well. Are there any specific situations/use cases that don't work?
What you can do to make it easy to connect from your Cordova app to the Workbench is to make an HTML file (connect.html) with a text field where you can enter the IP-address of the Workbench. Then set that HTML file to be the main file used by the Cordova project during development. When testing the app and finally when shipping set the main file to index.html as usual. Will put together an example of this for you.
Here are some useful reading on the subject of using a custom Cordova app (instead of Evothings Client) with Evothings Workbench (I guess you have seen this already but others reading the thread might not):
http://evothings.com/doc/raw/build/cord ... rEvothings
http://evothings.com/cordova-starter-kit/
http://evothings.com/hybrid-app-development-made-fast/
Best regards, Mikael
Re: Getting the media plugin to work in the Evothings workbe
Hi again, here is an example project I put together:
https://github.com/divineprog/evo-demos ... ive-reload
It is a Cordova app configured to connect to Evothings Workbench. The text field remembers the recently used connect URL, so it becomes easier to connect, and you don't have to rebuild the app every time you switch network address.
It is like a lightweight version of Evothings Client.
Is this of helpful for you? Let me know how it goes.
Best regards, Mikael
https://github.com/divineprog/evo-demos ... ive-reload
It is a Cordova app configured to connect to Evothings Workbench. The text field remembers the recently used connect URL, so it becomes easier to connect, and you don't have to rebuild the app every time you switch network address.
It is like a lightweight version of Evothings Client.
Is this of helpful for you? Let me know how it goes.
Best regards, Mikael
Return to “Questions and answers”
Who is online
Users browsing this forum: No registered users and 42 guests