Home > Cannot Use > Cordova Media Plugin

Cordova Media Plugin


But on the iOS system, he declares the path would be:"". keep getting QMediaPlayer::FormatError , "Failed to load media" for the qrc sources. so var media = new Media('sounds/recording.wav', ...); would also work if the wav is in a sounds folder? –epeleg Nov 25 '14 at 11:41 actually looking at the docs You are now able to play wav, mp3, and caf formats on iOS using this "relative path" method: var media = new Media('beep.wav', ...); Note that the above code requires the

javascript cordova mp3 share|improve this question asked Feb 23 '14 at 11:50 Idan Shechter 3,0391353119 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote accepted I asked 4 years ago viewed 10334 times active 2 months ago Upcoming Events 2016 Community Moderator Election ends Nov 22 Get the weekly newsletter! The android path is correct. –ThinkingStiff Nov 15 '12 at 6:02 window.location.pathname just gives "/index.html" for me, which does not help –curtis Jun 24 at 0:57 add a comment| Operator ASCII art If an image is rotated losslessly, why does the file size change? http://stackoverflow.com/questions/11175489/ios-phonegap-media-object-how-do-i-access-a-resource-in-the-www-folder

Cordova Media Plugin

javascript ios xcode cordova share|improve this question edited Jul 12 '12 at 7:53 ThinkingStiff 49.7k17110207 asked Jun 24 '12 at 6:44 Braydon Batungbacal 46211736 try Sounds/sound.mp3 it should work Chuck Reply Quote 0 jkosonen last edited by [quote author="Chuck Gao" date="1310954575"]What's the error? I needed to use "steroids.app.absolutePath": new Media(steroids.app.absolutePath + "audio/songs/bad.mp3”, Marcos Borges Tue, 27 Jan 2015 17:25:17 GMT Mads, you're not using supersonic are you?

Probably could write the resource file into /tmp file and play from there but that would be quite silly. nicraboy 2015-01-22 16:10:06 UTC #2 What do the error logs say? Only users with topic management privileges can see it. Consider: document.addEventListener('deviceready', onDeviceReady, false); function onDeviceReady() { document.querySelector("#playMp3").addEventListener("touchend", playMP3, false); }; function playMP3() { var mp3URL = getMediaURL("sounds/button-1.mp3"); var media = new Media(mp3URL, null, mediaError); media.play(); } function getMediaURL(s) { if(device.platform.toLowerCase()

Are there continuous functions for which the epsilon-delta property doesn't hold? Cdvfile more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed I just started my first real job, and have been asked to organize the office party. Mads Konradsen Tue, 07 Oct 2014 13:46:38 GMT The file is placed in "www/audio/songs/bad.mp3" if that helps?

If an image is rotated losslessly, why does the file size change? What should I do? Specifically it requires this in front of the path: /android_asset/www/ So what I did was write a simple utility function that makes use of the Device API. Duovili 2016-09-05 13:16:01 UTC #8 do you guys have a working solution?


Thanks man! –Gowiem Nov 11 '12 at 17:53 On iOS, I get "Unknown resource 'file://var/mobile/Applications/{GUID}/{appname}/www/audio/b‌ounce.mp3'"On android, it works, but it returns the path "file:///android_asset/www/ –Ben X Tan Nov 14 we can not play .mp3's on iOS anymore? Cordova Media Plugin sound.play(); This returns an error on Developer app: 'Cannot use audio file from source var/mobile/Containers/data/Application/{GUID}/Library/NoCloud/phonegapdevapp/www/assets/sounds/sound.mp3' but works if built from the console. Cordova File Compare elements iteratively Is there any known limit for how many dice RPG players are comfortable adding up?

Btw:This page simonmacdonald.blogspot.tw/2012/01/… also illustrates the almost the same thing as yours. I'm using cordova-plugin-media 2.3.0 "Media". Operator ASCII art Query for highest version Why is looping over find's output bad practice? Browse other questions tagged javascript ios xcode cordova or ask your own question.

I had planned to add to it regularly but - life - as you know - gets in the way. As a result, your viewing experience will be diminished, and you have been placed in read-only mode. The Media plugin worked as intended using $ phonegap run android $ phonegap run ios with this js code: function getPhoneGapPath() { var path = window.location.pathname; var phoneGapPath = path.substring(0, path.lastIndexOf('/') I have tried putting the sound file to resource and to use it from file path...

What is the temperature of the brakes after a typical landing? For example, this also works now: var media = new Media('sounds/beep.wav', ...); for the sound file at www/sounds/beep.wav. I am on cordova version 3.7 for IOS, To g… Finally after lot of struggle I mananged to get it working with the solution posted here.

Is privacy compromised when sharing SHA-1 hashed URLs?

Thank you. –Kevin Choppin Jan 10 '14 at 10:53 This will not work if you are using the HTML5 History API in your program to add in history entries I'm just getting playAudio():Audio Error: {"code":1} where code 1 is MediaError.MEDIA_ERR_ABORTED = 1 Petrus Repo Wed, 28 Jan 2015 09:24:26 GMT Your media file must be accessed using the `steroids.app.absolutePath` (= share|improve this answer answered Feb 9 '15 at 1:47 slypete 2,39583257 add a comment| up vote 0 down vote Better try this to take into account any HTML5 History API code My cat sat down on my laptop, now the right side of my keyboard types the wrong characters Is it ethical for a journal to cancel an accepted review request when

Not the answer you're looking for? What movie is this? Pasinetti 2015-11-20 09:08:46 UTC #7 could be guilty of the type of file ?There are problems on ios with mp3?it is better to use the wav file or another type? Thanks Home Categories FAQ/Guidelines Terms of Service Privacy Policy Powered by Discourse, best viewed with JavaScript enabled Navigation Qt Forum Login Search Search Categories Recent Tags Popular Groups Search Your browser

Here's something to get you started: Demo: http://jsfiddle.net/ThinkingStiff/chNVY/ Code: function getPhoneGapPath() { var path = window.location.pathname; path = path.substr( 0, path.length - 10 ); return 'file://' + path; }; var resource Reverse a hexadecimal number in bash Do humans have an obligation to prevent animal on animal violence? Join them; it only takes a minute: Sign up Cordova Media plugin error 'Cannot use audio file from resourse' when recording to non-existing file up vote 2 down vote favorite When How to interpret torque spec ranges?

Details can be found here: https://forums.adobe.com/thread/2135718 share|improve this answer answered Aug 16 at 8:10 Manuel Mumenthaler 1 add a comment| Your Answer draft saved draft discarded Sign up or log On Symbian^3 and Harmattan if i embed the qml in the resource, sounds (using SoundEffect) don't hear! Reply Quote 0 Chuck Gao last edited by What's the error? Would we find alien music meaningful?

If my qml file is not in resource, the sound plays just fine. Reply Quote 0 nokiadev last edited by Yes I have played sound from resource file but with some limitations e.g. more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed asked 5 months ago viewed 101 times Upcoming Events 2016 Community Moderator Election ends Nov 22 Related 4Phonegap/Cordova - media api - when play audio from URL, UI freeze a few

Should I allow my child to make an alternate meal if they do not like anything served at mealtime? Or do I need to copy the sound file out of my www directory and into my Resources folder and access it there? current community chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list. It crashed the app.

Reply Quote 0 Chuck Gao last edited by I think it's a problem with path, there is no error(Output to the console) about this ?

Back to Top