You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by sam991 <sa...@firmwisegroup.com> on 2014/04/03 06:40:19 UTC

Not able to play video in my iPad

Hi every one,

I am developing a flex mobile application which runs video in call out. This
is running perfectly in android tabs, but when i compile my code for my iPad
i only see video player, but their is no sound and video playing. I have
tried many things to resolve my problem, but nothing helped me till now. If
any one knows about it please let me know about it, so that i can finish my
project ASAP.

I am using Flash Builder 4.7, AIR 3.9 and SDK 'Apache Flex 4.11.0 FP 11.9
AIR 3.9 en_US'


Till now i have tried in built video player, video bridge, stage web view,
and few others but, none of them were helpful in playing video in my iPad.


Thanks.



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

Re: Not able to play video in my iPad

Posted by sam991 <sa...@firmwisegroup.com>.
Hi everyone,

Finally i have resolved my problem of playing video in my iPad. This link
below helped me solving it. We have to change the compilier settings as well
as render mode also. And, i have used StageWebView to play videos.

Thank you everyone for your replies.

http://www.unfetteredthoughts.net/2012/01/12/embedded-h-264-video-on-ios-with-a-flex-mobile-project/
<http://www.unfetteredthoughts.net/2012/01/12/embedded-h-264-video-on-ios-with-a-flex-mobile-project/>  



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

Re: Not able to play video in my iPad

Posted by sam991 <sa...@firmwisegroup.com>.
videoDisplay.as
<http://apache-flex-users.2333346.n4.nabble.com/file/n6021/videoDisplay.as>  

Hi, i have done a line by line debugging for both android tab and for iPad.

I am attaching a videoDisplay.as file with this reply. This file is
responsible for playing videos for in-built videoPlayer in flex.
At few line number's i have marked break points.

Following are the line numbers:
to check the values of bytesTotal, currentTime, and duration

Values after debugging on android tab:
1st complete cycle: bytesTotal = 0, currentTime = 0, duration = 0
2nd complete cycle: bytesTotal = 0, currentTime = 0, duration = 0
3rd complete cycle: bytesTotal = 31611901, currentTime = 0, duration = 0

Then, after 4-5 complete cycle values are bytesTotal = 31611901, currentTime
= 0, duration = 0
Then, at 6th complete cycle: bytesTotal = 31611901, currentTime = 1.402,
duration = 433.17333333333335
And, from here onwards currentTime keeps on increasing till the video
buffering is finished.

And, the video begins to display in my callout of the application.


Now, after debugging my application for iPad, i found these values:

1st complete cycle: bytesTotal = 0, currentTime = 0, duration = 0
2nd complete cycle: bytesTotal = 0, currentTime = 0, duration = 0
3rd complete cycle: bytesTotal = 31611901, currentTime = 0, duration = 0

Then, after 4-5 complete cycle values are bytesTotal = 31611901, currentTime
= 0, duration = 0
Then, at 6th complete cycle: bytesTotal = 31611901, currentTime = Nan,
duration = NaN

Values of currentTime and duration don't change from here onwards. And
debugging stops after 11th or 12th complete cycle, leaving a blank
videoPlayer display in callout.


Now, what can i do to get the currentTime and duration of my mp4 file, which
allows my video to play in iPad



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

Re: Not able to play video in my iPad

Posted by OmPrakash Muppirala <bi...@gmail.com>.
Sorry no ideas.  Other than running it through the debugger one line at a
time and see if you can catch where things fail.  You already know that an
error is being thrown.  See if you can find out more info about that
error.

Thanks,
Om


On Fri, Apr 4, 2014 at 1:50 AM, sam991 <sa...@firmwisegroup.com>wrote:

> I have tested my video files by directly playing on my iPad, they are
> playing
> fine. What can i assume from it is that their might not be any encoding
> issues.
>
> Any ideas now.
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Not-able-to-play-video-in-my-iPad-tp5932p5994.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Not able to play video in my iPad

Posted by sam991 <sa...@firmwisegroup.com>.
I have tested my video files by directly playing on my iPad, they are playing
fine. What can i assume from it is that their might not be any encoding
issues.

Any ideas now.



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

Re: Not able to play video in my iPad

Posted by sam991 <sa...@firmwisegroup.com>.
I have just downloaded a video from youtube, and tried playing it. But, that
video is not playing as well.



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

Re: Not able to play video in my iPad

Posted by OmPrakash Muppirala <bi...@gmail.com>.
On Apr 3, 2014 10:58 PM, "sam991" <sa...@firmwisegroup.com> wrote:
>
> I have checked my ipa file. Opening it with winzip i found the assets
folder
> and my mp4 files are there.
>
> From this link:
>
http://www.overdigital.com/2012/01/14/720p-video-on-ipad-and-android-tablets-with-adobe-air/
> <
http://www.overdigital.com/2012/01/14/720p-video-on-ipad-and-android-tablets-with-adobe-air/
>
>
> I have used 'Video Player based on OSMF' and tried to play video on my
iPad,
> but results were the same.
>
>

Perhaps the encoding is not done properly.  Can you play any other mp4
files that you did not create?

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

Re: Not able to play video in my iPad

Posted by sam991 <sa...@firmwisegroup.com>.
I have checked my ipa file. Opening it with winzip i found the assets folder
and my mp4 files are there.

>From this link:
http://www.overdigital.com/2012/01/14/720p-video-on-ipad-and-android-tablets-with-adobe-air/
<http://www.overdigital.com/2012/01/14/720p-video-on-ipad-and-android-tablets-with-adobe-air/>  

I have used 'Video Player based on OSMF' and tried to play video on my iPad,
but results were the same.





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

Re: Not able to play video in my iPad

Posted by OmPrakash Muppirala <bi...@gmail.com>.
I don't see an [Embed] directive in the code you posted.  So, you should
have included the resources when you packaged the ipa.

The ipa file is actually a zipped file.  Open it in Winzip or 7-zip, open
the Payload > [your.app.id]  directory inside it.

In your case, you should see the "assets" directory with the mp4 files
inside it.

Thanks,
Om


On Thu, Apr 3, 2014 at 5:31 AM, jude <fl...@gmail.com> wrote:

> You can check the file size of the IPA. For testing purposes check the IPA
> size now, then add another mp4 that is very huge and check the size again.
>
>
> On Thu, Apr 3, 2014 at 4:44 AM, sam991 <samarth.gupta@firmwisegroup.com
> >wrote:
>
> > Hey,
> >
> > i just wanted to know that how will i check that my files embedded in my
> > iOS
> > application. I was thinking that i will some some way to figure it out,
> but
> > i couldn't.
> >
> >
> >
> > --
> > View this message in context:
> >
> http://apache-flex-users.2333346.n4.nabble.com/Not-able-to-play-video-in-my-iPad-tp5932p5956.html
> > Sent from the Apache Flex Users mailing list archive at Nabble.com.
> >
>

Re: Not able to play video in my iPad

Posted by jude <fl...@gmail.com>.
You can check the file size of the IPA. For testing purposes check the IPA
size now, then add another mp4 that is very huge and check the size again.


On Thu, Apr 3, 2014 at 4:44 AM, sam991 <sa...@firmwisegroup.com>wrote:

> Hey,
>
> i just wanted to know that how will i check that my files embedded in my
> iOS
> application. I was thinking that i will some some way to figure it out, but
> i couldn't.
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Not-able-to-play-video-in-my-iPad-tp5932p5956.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

RE: Not able to play video in my iPad

Posted by sam991 <sa...@firmwisegroup.com>.
I have included my file with my application while packing it for iOS. Then, i
think their might be some other issue from within which is not letting the
video to play



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

RE: Not able to play video in my iPad

Posted by sam991 <sa...@firmwisegroup.com>.
I have included my video files while packing my application for iOS. Then, i
think their might be some other thing which is creating some issue from
within and letting the video play.



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

RE: Not able to play video in my iPad

Posted by Maurice Amsellem <ma...@systar.com>.
If you use [Embed], then you need to change the video.source statement to point to your embedded asset

-----Message d'origine-----
De : Maurice Amsellem [mailto:maurice.amsellem@systar.com] 
Envoyé : jeudi 3 avril 2014 12:16
À : users@flex.apache.org
Objet : RE: Not able to play video in my iPad

It's embedded because you have embedded it ;-)

Either:
- using @Embed  or [Embed]
- or by including it in the iOS packaging files (check your FlashBuilder Project Props > Flex Build Packaging > iOS) 



-----Message d'origine-----
De : sam991 [mailto:samarth.gupta@firmwisegroup.com] 
Envoyé : jeudi 3 avril 2014 11:44
À : users@flex.apache.org
Objet : Re: Not able to play video in my iPad

Hey,

i just wanted to know that how will i check that my files embedded in my iOS application. I was thinking that i will some some way to figure it out, but i couldn't.



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

RE: Not able to play video in my iPad

Posted by Maurice Amsellem <ma...@systar.com>.
It's embedded because you have embedded it ;-)

Either:
- using @Embed  or [Embed]
- or by including it in the iOS packaging files (check your FlashBuilder Project Props > Flex Build Packaging > iOS) 



-----Message d'origine-----
De : sam991 [mailto:samarth.gupta@firmwisegroup.com] 
Envoyé : jeudi 3 avril 2014 11:44
À : users@flex.apache.org
Objet : Re: Not able to play video in my iPad

Hey,

i just wanted to know that how will i check that my files embedded in my iOS application. I was thinking that i will some some way to figure it out, but i couldn't.



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

Re: Not able to play video in my iPad

Posted by sam991 <sa...@firmwisegroup.com>.
Hey,

i just wanted to know that how will i check that my files embedded in my iOS
application. I was thinking that i will some some way to figure it out, but
i couldn't.



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

Re: Not able to play video in my iPad

Posted by sam991 <sa...@firmwisegroup.com>.
I will recheck for the files again.

When i try to play video via inbuilt video player of flex then i have given
path to ups3.mp4
and when i try to play video via stagevideo i have given path to part1.mp4




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

Re: Not able to play video in my iPad

Posted by OmPrakash Muppirala <bi...@gmail.com>.
Are you sure that the these mp4 files are copied over with the iOS app?
Can you verify if they are available?

Also, in the code snippet you posted first, you had

assets/Part1.mp4

In the debug screenshot, you have ../assets/ups3.mp4

Check your file paths to make sure they are correct.



On Thu, Apr 3, 2014 at 2:09 AM, sam991 <sa...@firmwisegroup.com>wrote:

> In this line of code i get the path to my video file. I have tab navigator
> view in which when selecting the first tab plays different videos, on
> selecting second it plays different video and so on.
>
> This is result on debugging
>
> <http://apache-flex-users.2333346.n4.nabble.com/file/n5952/1.png>
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Not-able-to-play-video-in-my-iPad-tp5932p5952.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Not able to play video in my iPad

Posted by sam991 <sa...@firmwisegroup.com>.
In this line of code i get the path to my video file. I have tab navigator
view in which when selecting the first tab plays different videos, on
selecting second it plays different video and so on.

This is result on debugging

<http://apache-flex-users.2333346.n4.nabble.com/file/n5952/1.png> 



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

Re: Not able to play video in my iPad

Posted by OmPrakash Muppirala <bi...@gmail.com>.
When you debug, what does the line:

vp.source="../assets/"+Global.selectedVideo;

resolve to?


On Thu, Apr 3, 2014 at 1:57 AM, sam991 <sa...@firmwisegroup.com>wrote:

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

Re: Not able to play video in my iPad

Posted by sam991 <sa...@firmwisegroup.com>.
I am using the same code.



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

Re: Not able to play video in my iPad

Posted by OmPrakash Muppirala <bi...@gmail.com>.
See if the example code here [1] works for you

http://www.overdigital.com/2012/01/14/720p-video-on-ipad-and-android-tablets-with-adobe-air/


On Thu, Apr 3, 2014 at 1:48 AM, sam991 <sa...@firmwisegroup.com>wrote:

> If i use this:
> var sv:StageVideo = stage.stageVideos[0];
> instead of
> var sv:StageVideo = new StageVideo();
>
> then i don't get the error, as i showed in previous reply.
>
> But, with this little modification in code, result is still the same. video
> is not playing
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Not-able-to-play-video-in-my-iPad-tp5932p5946.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Not able to play video in my iPad

Posted by sam991 <sa...@firmwisegroup.com>.
If i use this:
var sv:StageVideo = stage.stageVideos[0];
instead of
var sv:StageVideo = new StageVideo();

then i don't get the error, as i showed in previous reply.

But, with this little modification in code, result is still the same. video
is not playing



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

Re: Not able to play video in my iPad

Posted by OmPrakash Muppirala <bi...@gmail.com>.
Yes, this again points to the possibility of the video not getting packaged
into the app.  Try creating a breakpoint in the error handler and see if
you can find more info.

When creating a release package, see if the mp4 file is getting added.

Om


On Wed, Apr 2, 2014 at 11:43 PM, sam991 <sa...@firmwisegroup.com>wrote:

> <http://apache-flex-users.2333346.n4.nabble.com/file/n5940/1.png>
>
> I got this error in catch function i just added as you said in ns.
>
>
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Not-able-to-play-video-in-my-iPad-tp5932p5940.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Not able to play video in my iPad

Posted by sam991 <sa...@firmwisegroup.com>.
<http://apache-flex-users.2333346.n4.nabble.com/file/n5940/1.png> 

I got this error in catch function i just added as you said in ns.





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

Re: Not able to play video in my iPad

Posted by OmPrakash Muppirala <bi...@gmail.com>.
It is possible that the mp4 file did not get embedded with the iOS app.
Attach a fault handler to ns and see if something shows up.

Thanks,
Om


On Wed, Apr 2, 2014 at 11:20 PM, sam991 <sa...@firmwisegroup.com>wrote:

> 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.
>

Re: Not able to play video in my iPad

Posted by sam991 <sa...@firmwisegroup.com>.
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.

Re: Not able to play video in my iPad

Posted by OmPrakash Muppirala <bi...@gmail.com>.
There are some limitations when it comes to video on iOS with Adobe AIR.

Perhaps this doc might help?
http://www.overdigital.com/2012/01/09/the-ultimate-guide-to-understanding-advanced-video-delivery-with-air-for-mobile/

Here is another technical doc about encoding video for iOS
http://download.macromedia.com/flashmediaserver/mobile-encoding-ios-v2.pdf

Thanks,
Om


On Wed, Apr 2, 2014 at 9:40 PM, sam991 <sa...@firmwisegroup.com>wrote:

> Hi every one,
>
> I am developing a flex mobile application which runs video in call out.
> This
> is running perfectly in android tabs, but when i compile my code for my
> iPad
> i only see video player, but their is no sound and video playing. I have
> tried many things to resolve my problem, but nothing helped me till now. If
> any one knows about it please let me know about it, so that i can finish my
> project ASAP.
>
> I am using Flash Builder 4.7, AIR 3.9 and SDK 'Apache Flex 4.11.0 FP 11.9
> AIR 3.9 en_US'
>
>
> Till now i have tried in built video player, video bridge, stage web view,
> and few others but, none of them were helpful in playing video in my iPad.
>
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Not-able-to-play-video-in-my-iPad-tp5932.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>