Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
New Contributor
Posts: 4
Registered: ‎02-26-2012
My Device: Blackberry Playbook 16G, BB 9780
My Carrier: Rogers

MediaPlayerEvent.PREPARE_COMPLETE gets stuck for invalid URL

hello, 

Whenever i have an invalid URL for the media player it gets stuck on MediaPlayerEvent.PREPARE_COMPLETE event and the whole app becomes unstable. App wont work without restarting the device. 


is the any way to handle the error for invalid URL;s ?

 

Code : 

 

try
{
_myPlayer.url = "http://91.121.60.128:80";
_myPlayer.prepare();
_myPlayer.addEventListener(MediaPlayerEvent.PREPARE_COMPLETE, CompleteEvent);
lable.text = "Connecting Media";

}
catch (e:Error)
{
lable.text = "Catch Error"+ e.toString() ;
_myPlayer.removeEventListener(MediaPlayerEvent.PREPARE_COMPLETE, CompleteEvent);
}

Retired
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook
My Carrier: Bell

Re: MediaPlayerEvent.PREPARE_COMPLETE gets stuck for invalid URL

Have a look at INFO_CHANGE.

 

"Dispatched to communicate some information and/or a warning about the media or its playback."

 

For samples on how to use it have a look at the API documentation here - https://developer.blackberry.com/air/apis/qnx/media/MediaPlayer.html#event:infoChange

 

 

If that doesn't work I was thinking maybe checking to see if the file exists before trying to load it might solve the issue. I googled it and came across this - http://www.kirupa.com/forum/showthread.php?328651-Checking-to-see-if-a-file-exists-before-loading

 

Cheers,

Dustin

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/