MediaPlayer - play a MP3?

IM using the code the following:

https://developer.BlackBerry.com/Cascades/reference/bb__multimedia__mediaplayer.html

 MediaPlayer mp(this);
        mp.setSourceUrl(QUrl("/assets/audio/magichour.mp3"));
        mp.play();

But the mp3 won't play, ideas?

I activated the correct permissions.

See you soon

Hello Jeff,.

The MediaPlayer API does the absolute path to read at the moment (I know, it's a very annoying limitation at the moment; I already present in-house and hopefully it will be fixed soon).

If you are linking the file in the application, you will need to do something like the following:

MediaPlayer mp(this);mp.setSourceUrl(QDir::currentPath() + "/app/native/assets/sounds/magichour.mp3");mp.play();

You can also play the ' folders ' media files (with the permissions of 'access_shared' in the file of the bar - descriptor.xml). In this case, the code could be something like the following:

MediaPlayer mp(this);
mp.setSourceUrl("/accounts/1000/shared/music/magichour.mp3");
mp.play();

Note also that the Simulator has limited support on the codecs (only a few audio codecs and not video) for reasons of industrial property. Hope that help and please let us know if you have any other questions. Cheers, Rashid

Tags: BlackBerry Developers

Similar Questions

  • Firefox plays after clicking on links for her instead of display the dialog box for play/download mp3/wav

    Firefox when trying to play wavs/mp3s after clicking on link to it instead of display the dialog to open/download. In preferences on the applications tab, I always chose "ask" in the types of wav and mp3 files, but it does not solve this problem.

    This has happened

    Each time Firefox opened

    == I'm not sure

    Firefox will play the file if you have a drive installed that supports the mime type that the server sends to this file.

    See "File handling in Firefox 3 and SeaMonkey 2": http://kb.mozillazine.org/File_types_and_download_actions

  • Download, record, play the MP3 on the iphone 6

    For my work, I need to record and play back mp3s on my iphone 6 s. How can I do that with iOS 9.2.1 (13D 15)? I have the URL and they play well on the Internet but I need to read files on the ground away from any connection. So far this community seems to favor a complex of software patches third-party mix. Apple has a recommended method?

    Daveyeamans wrote:

    For my work, I need to record and play back mp3s on my iphone 6 s. How can I do that with iOS 9.2.1 (13D 15)? I have the URL and they play well on the Internet but I need to read files on the ground away from any connection. So far this community seems to favor a complex of software patches third-party mix. Apple has a recommended method?

    Save you the mp3 in your iTunes library and then you sync your phone.

  • Satellite 1690cdt: his problem - cannot play any mp3

    Hello

    I have an old 1690cdt that works just right. the only problem I want to solve, is that the sound does not work.

    If I run the windows media player, it says "no audio hardware available. I can't play any mp3 either.

    If I put an audio cd in the cdrom drive, it plays.

    If I look at the configuration of the system, there is an audio WDM crystal soundfusion cs4281 installed. According to the specifications, this should be the sound card.

    I tried updating the driver, but it does not work

    I can do, or is it just broken?

    Sincerely,

    Gerard

    Hello

    In my opinion, the sound card is ok. You need only a MP3 for Windows Media Player codec. I use the Winamp application to play the Mp3 files. This very nice program, I m very happy. Try to install it and check if it of possible to read mp3.

  • Windows Media Player 11 won't play CD, MP3, WMA etc. error C00D11B1.

    Windows Media Player 11 won't play CD, MP3, WMA etc. error C00D11B1. I tried MS solve this problem, uninstalling, reinstalling, etc. Same problem on 2 computers. Winamp and Itunes play fine, its not hardware or drivers. Windows XP SP3 & Media Player 11 is perfectly up-to-date.

    Hello

    · Which Microsoft difficulty he makes you run?

    You can check the link below which holds information about the error: C00D11B1: http://www.microsoft.com/windows/windowsmedia/player/webhelp/default.aspx?&mpver=11.0.5358.4827&id=C00D11B1&contextid=71&originalid=C00D0BB8

  • How can I make the tΓches play a mp3 file at some point please?

    I would like to that task scheduler to open windows media player and play an MP3 for me at a given time. I followed the instructions here, but nothing helps. The windows media player window does not open, but it does not play mp3.

    http://www.Vistax64.com/tutorials/132903-Task-Scheduler-create-task.html

    In the program/script box, I put in "C:\Program Files\Windows Media Player\wmplayer.exe '.

    In the Add arguments box, I put in: Wildlife.mp3

    At the beginning of area (optional), I put in: C:\Reminders

    which is a folder that I created in the C drive.

    Wildlife.MP3 file is of course in the C\Reminders folder.

    I have Windows 7.

    How can I make the tΓches play a mp3 file at some point please?

    In the arguments to the full path of the file in quotes, "c:\reminders\wildlife.mp3."

    http://Windows.Microsoft.com/en-us/Windows7/schedule-a-task

  • Firefox will not play SermonConnect mp3 files that have been uploaded to Amazon S3 server using S3 Organizer after 2014 7. Already downloaded the files OK.

    Files uploaded to the Amazon S3 server are accessible via our Web site at littlecountrychurch.org. All multimedia files downloaded before January 7, 2014, be played properly on our media page. Files uploaded after January 7 refuses to play on the Firefox browser. To add to the confusion, other browsers Chrome, Safari, Internet Explorer on Windows and Mac-play these files correctly. In addition, an older version of Firefox on an XP laptop plays files correctly. We even ran a test by downloading a working of the S3 server, re-uploaded the file file and Firefox would not read the freshly downloaded file, but he continued to play the same file previously downloaded without problem.

    The problem is the content-type header sent to S3. The old MP3s are designated "audio/mpeg", which is perfect. Newcomers are designated "application/download", which does not work in Firefox native HTML5 audio player. (The inset on the screenshots is pasted from a screenshot of the Fiddler proxy).

    On a normal web server, all .mp3 files usually served in the same folder have the same content type. Something seems different about Amazon storage, perhaps based on a difference in their environment "backstage."

  • When I installed the version 22.0 automatically play my mp3 downloads rather than save. How can I fix it?

    When I download mp3 files, they play automatically instead of giving me the option to save them. I don't want them to play.

    Hello, firefox version 21 and above makes now use codecs included in your operating system that allow him to directly read mp3 and mpeg (also for html5 videos). in order to disable that, enter about: config in the address bar of firefox (confirmed the message information where it appears) and search for the preference named media.windows - media - foundation.enabled. Double-click it and change its value to false.

    Another way to download files without tweaking the above-mentioned preference would be to click right on the link that leads to an mp3 file or right click on the drive in firefox and choose to download the file like that...

  • Media Player play the MP3 files but not others

    My OS is XP and I'm using Media Player 11.

    In my WM library, I downloaded several music files.  Most are MP3 files.  Some will play, but others do not.  When I look at those who don't in properties, I see the length of play is 0:00.  As far as I know, I have all codecs updated but cannot be sure 100% bee.

    Can someone please tell me in words of one syllable preference (I'm technophile worse of the world) if they know of a cure.

    Steve

    Looks like the files are corrupted. Do you know how they were created originally?

    You will probably need to re - download or re - extract the files. If this isn't an option, you can search the Web for MP3 repair tool, but there is no guarantee that the repair will work. Tim Baets
    http://www.BM-productions.TK

  • Windows Media Player 12 will not play mp4, mp3, wmv files through IIS hosted local site when the PC is disconnected from the Internet

    I have an IIS Web site 6.1 on local 32-bit Windows 7 machine that serves HTML and MP4 videos via Internet Explorer on the local computer.  An internet connection is not necessary because it is all local storage and local accommodations through IIS.  IIS is configured to serve the MP4 videos in the form of downloadable files, don't not streaming somehow.  I have the right MIME type ".mp4" with the installation of "video/mp4" in the IIS server, so I don't think that's the problem.

    When the machine is connected to the internet, by clicking on a video link MP4 in any HTML page served by the local IIS server results in Windows Media Player opening and playing the video in its own window.  However, when the Ethernet cable is unplugged, by clicking on the same results of video link MP4 in Windows Media Player by opening its own window, and then display this error message:

    Windows Media Player cannot play the file.  If the file is on the Internet, connect to the Internet.  If the file is on a removable storage card, insert the storage card.

    It's almost as if Windows Media Player has a bug and since it accesses this media file via a URL, but the machine is not connected to a network, he thinks that this file is unplayable.

    When the Ethernet cable is disconnected, the local IIS server is still all the HTML code and ActiveX content except for media files.  I also tried to access MP3 and WMV files via the IIS server to see if Windows Media Player will open those when the computer is disconnected from the Internet.  These caused also Windows Media Player files display the same error message.

    I tried the VLC (VideoLAN) Player after changing the property file in VLC of WMP for .mp4 files extension.  With VLC installed and the extension changed to VLS property, I can download/open the MP4 video using the link in the web page served by IIS all when they are disconnected from the internet.  The only thing I can't do is get VLC player to open and play the video simply by clicking on the link in Internet Explore web pages served by the local IIS server.

    I would like to make use of Internet Explorer and Windows Media Player with this IIS server that serves the MP4 videos rather than using VLC player.

    Thank you

    Michael Rayman

    I finally found the answer to my problem:

    When they are disconnected from the internet, mysteriously, Windows Media Player 12 requires that you check a checkbox in tools > Options... > zone settings tab player called "Internet connection (ignore the other commands).  Once this box is checked and the settings saved on APPLY, then Windows Media Player 12 will play videos served by the local IIS server on the same machine, while disconnected from the Internet.

  • I am not able to play any mp3 file in my computer running windows 7.

    Hey

    as I said it as a topic, I can't seem to run mp3 files in windows 7 and it stops the program, I am trying to launch that my music file on tried on itunes, limewire..., win media player but I can play through browser. How can I solve this problem?

    Hi Sara,.

    You did it changes on your computer before this problem?

    You can use your favorite search engine to download and install the latest codec for Windows Media Player. Later, try to play mp3 files.

    Note: This response contains a reference to third party World Wide Web site. Microsoft provides this information as a convenience to you. Microsoft does not control these sites and no has not tested any software or information found on these sites; Therefore, Microsoft cannot make any approach to quality, security or the ability of a software or information that are there.


    Reference:
    Codecs: frequently asked questions

    Play an audio or video file: frequently asked questions

    Hope the helps of information.

    Please post back and we do know.

  • Plugin Media freezes ios screen when playing a mp3 audio remote

    I use the iPhone iOS 9.2.1 and by using following code:

    Duration of this media is 30 seconds.

    Whenever I run the above code, the screen of my iphone is disable / blocks until this and audio begins to play. I'm not able to touch anything. Screen becomes normal when audio starts playing. This question is not acceptable, because it is a very serious matter.

    Please someone help if possible.

    Thank you

    What version of the plugin media do you use? If you use < 2.2.0,="" please="" upgrade="" and="" try="" again.="" see=""> https://github.com/apache/cordova-plugin-media/blob/679d4a410c63738b8dc62cc138ae6e5351f88d 5f/RELEASENOTES.md #220 - Feb - 09 - 2016

  • Play an MP3 sound using its ByteArray

    With AS3 we can do to load an MP3 file and play:

    var sound: Sound = new Sound (new URLRequest ("sound.mp3"));

    Sound.play();

    It is very easy, but what happens if I already have all the ByteArray of this loaded MP3 and I just want to play?

    Why cant AS3 have a simple method to simply pass the ByteArray works exactly as it works now passing a URLRequest?

    In my case, I need it because I'm loading a ZIP file containing a bunch of MP3s and when decompressing them I can read the bytearray of each MP3 but I can't play them.

    Have you tried loadCompressedDataFromByteArray in the Sound class?

    Assuming you have the ByteArray already instantiated, try:

    var sound: Sound = new Sound();

    sound.loadCompressedDataFromByteArray (mp3Bytes, mp3Bytes.length);

    Sound.play();

  • I need to play an mp3 file using netStream.play

    I have a "film actor" who plays flv files using the code below (videoToPlay is the name of the file to play and is just a string).  I want to use the same configuration for read an MP3 also.  I tried to use mySound = new Sound(); and then mySound.attachNetStream (ns); but it gives me this error: 1061: call to an attachNetStream method maybe not defined through a reference with static type flash.media:Sound.

    I think that you can play MP3s with NetStream, unless you use FMS.

    If you mean, by timestamp, position position of the read head, use the SoundChannel position property and read it periodically (timer or event ENTER_FRAME):

    http://livedocs.Adobe.com/Flash/9.0/ActionScriptLangRefV3/Flash/Media/SoundChannel.html

  • play an mp3 from external source

    Hello

    I read the clues that I could find on files external, streaming, etc.,

    I have some mp3s on the hard drive and a flash drive.
    I have them in a list in my film (via BuddyAPI). My jargon points directly to them.

    I can't play just by their SEO.
    They will play by baOpenFile() in Windows Media.

    Help?

    Thank you
    BigDaddy

    Hello

    Thank you!

    playFile channel, this file is the answer.

    A go to the framework script had my code all tied up.

    Thank you
    BigDaddy

Maybe you are looking for

  • How can I get Firefox to launch Thunderbird, using Tbird biff?

    I used Biff for years, but now it does not start Tbird. I omitted the Tbird address in Ffox Biff client Options, but after that I added it Tbird has still not started. What's wrong? What Miss me?

  • I have a Photosmart 3210 - Can I use the front USB port instead of port back? (back is broken).

    Hello!  Trying to help a friend.  Rear USB port no longer his plug slips outside, no electrical connection.  Tearing in the unit for her brief submeter (out of warranty, nothing to lose).  Can I use an adapter with a standard USB plug on each end to

  • YouCam 5 Deluxe BSOD

    OK so I have a Pavilion G6, product number C5U60UA #ABA, with 8 64-bit windows and I just installed the new version of Youcam software pre-installed. This new software v.3 Youcam Deluxe 5-4 then I install this and as soon as I run it for the first ti

  • should I install win - xp in laptop corei-5

    Dear Sir/mamI had to buy dell-corei-5 it is possibel to install windows xp on that laptop!Thank you best regards &...Imran Shaikh

  • Imprecise date

    When my computer once wrote, it gives the figures for the year, day and time but still only the letters "mm" for the month...  My system is Windows Vista.  How can I solve this problem?  Thank you in advance.