I have been trying to implement the OSMF player using several different methods to play local mp4 files, and while using the standard AIR SDK that ships with Flash Builder 4.6, I could never get the video to display on an iPad 2. I could hear the video's audio, but never see the video itself. Now that I have overlayed the beta AIR SDK, I get no audio either for the same video on the iPad. Is anyone else sucessfully doing this uing OSMF or another method?
I've set up an own player-enviroment with full IAB - Support (VAST1.0, VAST2.0 and VAST3.0) and everything works fine in all Adobe AIR - Versions since 3.0 except for this bug which seems to be fixed in Adobe AIR 3.3 Beta 4:
I think there is a timing issue here. Just move your initVideo() call into onStageVideoAvailability handler. Your code was causing a small timing problem. It was taking the Video code path instead of the StageVideo code path because of which video was not getting played. Moving initVideo after _stageVideoAv gets set correctly ensures that if StageVideo is available that path will be taken correctly.
Ok, that does seem to get me further along. I now hear the video, but don't see it. I imagine it is getting drawn behind something somehow, but don't know what. I have the view's background alpha set to 0, so not sure what else is going on.
Since StageVideo was not getting initialized, shouldn't it have played the using the normal Video class anyways, or is that not supported on IOS?
That's the question. I've never tried that.
StageVideo will be drawn behind every DisplayObject laying on stage BUT every MovieClip and Sprite has its own stage. So it would be worth trying it. Works perfectly with StageWebView. But SWV OVERLAYS everything ... I've never tried with StageVideo because I hadn't to.
Ok, I tried it, but it made no difference.
The Flex skin is somehow blocking it I guess, but I've not run across a solution. This thread indicates that the skin can be altered, but it does not work for me... apparently there is some small detail that I'm missing: http://forums.adobe.com/message/4128521
I've run a few more tests, and setting the background color of the ViewNavigatorApplication tag to red, still shows red even though the background alpha is 0. This is all very confusing in Flex, and Adobe really needs to post an example on how to use this in Flex. In theory it should work. Any other ideas?
Normal video in this case will not work on iOS. H.264 cannot be played by the cpu on iOS. Incase you want to show a video using the Video class you would need to use some other format like on2 or sorenson.
@Keith... have you tried setting the background.visible = false; ? ... Even it's better practise to do so instead of zeroing out the alpha-value. As long as a DisplayObject has its visibile-parameter at "true" it still get rendered even the alpha-parameter is set to 0. With Flex I realy can't help you. I never used Flex. In my opinion pure ActionScript is much more controlable and customizable. But that's just my opinion.
The ViewNavigatorApplication tag for the mobile Flex app does not support that property, so as a test I changed the tags to just Application, which does support that property, and set it to 0. Got the same issue; hear sound, but see no video. Here is the code for the application:
<?xml version="1.0" encoding="utf-8"?>
<!-- Place non-visual elements (e.g., services, value objects) here -->
private var mediaPlayer:CatVideoPlayer;
private function init():void
var videoFile:File = File.applicationDirectory.resolvePath("auger_1.mp4");
var videoPath:String = new File(new File(videoFile.url).nativePath).url;
mediaPlayer = new CatVideoPlayer();
mediaPlayer.width = 640;
mediaPlayer.height = 360;
mediaPlayer.source = videoPath;
Europe, Middle East and Africa