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
Contributor
Posts: 19
Registered: ‎03-08-2011
My Device: Bold 9700

Playing Multimedia, video files

I'm trying to play a video file in my application but no luck, anything i'm doing wrong?? here is my code below.

 

 

package
{
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	
	import qnx.media.MediaPlayer;
	import qnx.media.VideoDisplay;
	
	[SWF(height="600", width="1024", frameRate="30", backgroundColor="#cccccc")]
	public class MyMedia extends Sprite
	{	
		public function MyMedia()
		{
			var playerDisplay:VideoDisplay = new VideoDisplay();
			
			playerDisplay.width = 640;
			playerDisplay.height = 480;
			
			var player:MediaPlayer = new MediaPlayer("assets/video.mp4", playerDisplay);
			player.prepare();
			player.play();
			addChild(playerDisplay);
			
			//player.url = "video.flv";
			
			
			super();
			
			// support autoOrients
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
		}
	}
}

 

 

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Playing Multimedia, video files

Assuming you're testing this in the 0.9.3 simulator (and as you provided zero information about that, who knows), it's a well-known issued that's been discussed many times in this forum.  Search a bit and you'll probably see that 0.9.3 broke sound and video.  We're expecting 0.9.4 some time in, maybe, the next month, and expect it to fix at least some of the issues.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Contributor
Posts: 19
Registered: ‎03-08-2011
My Device: Bold 9700

Re: Playing Multimedia, video files

Tx Peter, I'm running it on the latest SDK 0.9.3, when i used the flash library it works fine but doesn't work when I used the qnx library as you can see from the code above. I guess i'll go with the flah until there is a fix to it.

Developer
Posts: 137
Registered: ‎12-22-2010
My Device: Curve 8520

Re: Playing Multimedia, video files

Could you please post your example with the flash libs?

 

I also have problems to get video playbook working :smileysad: