flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam991 <samarth.gu...@firmwisegroup.com>
Subject Re: Not able to play video in my iPad
Date Thu, 03 Apr 2014 06:20:09 GMT
Hi,

I have used code to play video both in android tab and my iPad, with code
video plays very well in android tab and in iPad only video player is
displayed and nothing happens.

protected function init():void
{
	try
	{					
		vp.source="../assets/"+Global.selectedVideo;
	} 
	catch(error:Error) 
	{
		Alert.show(error.message);
	}
}

<s:VideoPlayer width="100%" height="85%" autoPlay="true" loop="true"
id="vp"/>


And, even used this code run video, with code video plays very well in
android tab and in iPad nothing happens.

videoURL = new
File(File.applicationDirectory.resolvePath("assets/Part1.mp4").nativePath).url;
stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY,
onStageVideo);

protected function onStageVideo(event:StageVideoAvailabilityEvent):void
{
	if(event.availability == StageVideoAvailability.AVAILABLE)
	{
		var nc:NetConnection = new NetConnection();
		nc.connect(null);

		var ns:NetStream = new NetStream(nc);
		var obj:Object = new Object();
					
		ns.client = obj;
		obj.onMetaData = onMetaData;
					
		var sv:StageVideo = new StageVideo();
		sv.viewPort = new Rectangle(145, 220, 730, 335);
		sv.attachNetStream(ns);
		ns.play(videoURL);
	}
}
			
protected function onMetaData(info:Object):void
{
	trace(info.width, info.height, info.duration);
}

Now, can i get to know what i am doing wrong



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Not-able-to-play-video-in-my-iPad-tp5932p5936.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Mime
View raw message