- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone. I want to ask how to play media *.mp3 offline in Intel XDK?
My code:
var src = "sounds/music.mp3"; var my_media = new Media(src, // success callback function () { alert("playAudio():Audio Success"); }, // error callback function (err) { alert("playAudio():Audio Error: " + err.code); }); my_media.play({playAudioWhenScreenIsLocked : true });
And i already put the mp3 file to www path.
And when i run project, i got error number "1". But when i change source file to streaming radio, its working, but for the offline music its not working. Im using Media plugins version 2.4.0 and Cordova CLI version 5.4.1.
Thank for your help. :)
- Tags:
- HTML5
- Intel® XDK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Check the "hello cordova" sample app to see how it plays back a local media file. Locating the media file will vary depending on the platform. And don't use alerts to debug your apps, they tend to interfere with your program logic, use console.log messages, instead, they are much less intrusive on the runtime thread of execution.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Check the "hello cordova" sample app to see how it plays back a local media file. Locating the media file will vary depending on the platform. And don't use alerts to debug your apps, they tend to interfere with your program logic, use console.log messages, instead, they are much less intrusive on the runtime thread of execution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Paul F. (Intel) wrote:
Check the "hello cordova" sample app to see how it plays back a local media file. Locating the media file will vary depending on the platform. And don't use alerts to debug your apps, they tend to interfere with your program logic, use console.log messages, instead, they are much less intrusive on the runtime thread of execution.
Thank you Paul :)

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page