Copy link to clipboard
Copied
Hello,
I am struggling on displaying H264 .mp4 videos through ipad2 and Xoom tablet for a while.
Parameters under FDT4:
- AIR3 SDK (latest)
- Flex SDK (latest)
- swf-version = 13
- targetplayer=11
Stagevideo is successfuly instanciated, but nothing...
I tried several HD formats, through several containers (f4v, h264) and still nothing.
I know that some people got result but so many people have trouble with this new feature which should be great.
My question is simple:
is there any tutorial that clears the usage of the StageVideo on Mobile ?
thanx.
Arthy
Copy link to clipboard
Copied
If you hear audio but video is not visible and you are using Flex application then you need to change the backgroundAlpha to 0 in your main component.
Have you kept renderMode as direct ?
Can you paste in your code here ?
Thanks,
Meet
Copy link to clipboard
Copied
I confirm that putting backgroundAlpha to 0 for the main component works fine, i have now a beautiful h264 video in my app on Android device, Xoom, and iPad 1; with rendermode to "direct".
Copy link to clipboard
Copied
You can get a full tutorial about StageVideo here. It also contains sample code to hep you out. I hope this helps you out.
Copy link to clipboard
Copied
Sorry for late answer,
@meetshah4288: i will try to put some code to show you (ipad2 app just crash when playing mp4)
A friend managed to play a mp4 video on iphone with osmf player.
I used his video and included the osmf player, but ipad2 app still crashes.
@Vincent35: unfortunately, i created an as3 project (not flex)
@Varun Bhatia: yes these tutorial are ok for web development, but mobile environment is quite different through AIR3.
Thanks for your help, i will get back on this soon.
Cheers.
Copy link to clipboard
Copied
I can't get this tutorial code to work on my iPad,http://www.adobe.com/devnet/flashplayer/articles/stage_video.html
has anyone been able to get this to work?
Copy link to clipboard
Copied
How does one pass a parameter to the video.html?
It seems to get jumbled up enroute.
eg: stage_video.html?vid=somevideo.mp4
Copy link to clipboard
Copied
I have been having the same issue. only thing that has worked is StageWebView but once the video is launched there is no way to get back to the app unless you quit the app. How can a video be opened using the native IOS player on flash 5.5 ?
var webView = new StageWebView();
webView.stage = this.stage;
webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight);
var path:String = new File(new File("app:/video/vide_name.mp4").nativePath).url;
webView.loadURL(path);
Copy link to clipboard
Copied
I recommend using StageVideo rather than StageWebView for video playback. I can help you out if you post your code ? Does it crash for you too or is it just not playing ?
Whats the renderMode, swf-version ?
Copy link to clipboard
Copied
Hello,
I finally did it !!! what a relilef !!!!!
In fact everything went ok since you respect the following point :
AS3:
- use any stagevideo creation workflow (wait stage event, create stagevideo instance...)
- compile for "-target-player=11.0" (dont know if this one is really necessary)
- compile for "-swf-version=13"
AIR descriptor (app.xml) :
- set wmode to "direct"
I was preparing a zip example for this issue by playing a mp4 on my server on iPad2, but it worked at first try ......
But once included in my project, it crashed again.....
In fact i found out that the NetStream could not play my .mp4 since i try to play a MP4 video stored in the File.applicationStorageDirectory
!
So I tested the following mp4 locations :
- distant video :
protocol : HTTP://
example: http://www.mysite.com/video.mp4
verdict : works fine
- local file in File.applicationDirectory
(embeded in .apk or .ipa file)
protocol : app://
example: app:
//video.mp4
verdict : works fine
- local file in File.
applicationStorageDirectory
(not embeded in .apk or .ipa file)
protocol : app-storage://
example: app-storage:
//video.mp4
verdict : NOT WORKING AND CRASHS APPLICATION
Finally i used the stagewebview trick to change the file url from "app-storage://" to "file:///" url format, and that was a success
The trick is :
var videoFile : File = File.applicationDirectory.resolvePath("myvideo.mp4");
var videoPath : String = new File(new File(_videoFile.url).nativePath).url; // get a file:/// video path to mp4
myNetStream.play(videoPath);
I don't really know if we may call it a bug since playing a video in app:// directory works fine, but not in storage-app:// (maybe sandbox restriction or something else).
Hope this will help
Copy link to clipboard
Copied
Hi,
Nice to hear that it works for you now !!!
Yes app-storage:/ URI doesn't work. Thats a bug. It should get fixed in the coming AIR versions.
By that time new File(vidFile.nativePath).url can be used to play the video from ApplicationStorageDirectory.
Thanks for your reply.
Regards,
Meet
Copy link to clipboard
Copied
Even if I use app-storage:/, it doesnt crash for me. Can you post the code that crashes the application or mail me at meetshah at adobe.com ?
Thanks
Copy link to clipboard
Copied
ok. i'll try to put an example as soon as i can.
Copy link to clipboard
Copied
I would like to see a sample code if possible, ty.