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

Reply
Developer
Deepu_George_Jacob
Posts: 235
Registered: ‎12-13-2011
My Device: Curve 9380

Media Player not working

Hi, 

 

I am trying to play a media by using the following code in my bb10 dev alpha device. But  it shows a error result Error during -(inputAttach)" . what is wrong in my code?

 

Thanks

Deepu George Jacob

 

var _myVD:VideoDisplay = new VideoDisplay();
_myVD.setPosition(1024/2 - 800/2, 600/2 - 480/2);
_myVD.setActualSize(800, 480);
_myVD.backgroundColor = 0x000000;
addChild(_myVD);
var _myPlayer:MediaPlayer = new MediaPlayer();
//_myPlayer.addEventListener(MediaPlayerEvent.INFO_CHANGE, infoChange);
_myPlayer.url = "http://www.ndjnfdnfkjdn.com/acbXXXXXXXXXX.mp4"
_myPlayer.videoDisplay = _myVD;

Developer
Innovatology
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course

Re: Media Player not working

Have you added permissions to your bar-descriptor.xml?

 

 <permission>play_audio</permission> 
 <permission>set_audio_volume</permission> 

 Also, try:

 

_myVD = new VideoDisplay(true, IowWindow.getAirWindow().group);

 

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Developer
Deepu_George_Jacob
Posts: 235
Registered: ‎12-13-2011
My Device: Curve 9380

Re: Media Player not working

It is not workings it shows error as

 

Error : [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="MediaPlayer: Error during -(inputAttach)" errorID=5]