Netstream video not playing on iPad - actionscript-3

I am building an iPad app using Flash CS6 to compile to AIR 3.3 on a PC.
One of the app requirements is a video player which can be overlaid with other display element - primarily for subtitles.
I am using Netstream to play MP4 video (have also tried FLVPlayer with same results).
Everything works fine when compiled to run in the emulator, but the video doesn't play once installed on my test device - iPad 3.
(I did a simple test a few months ago and got video playing correctly with audio, but that was CS5.5, AIR 3.1, iPad 2. I will return to this setup, but I obviously do also need to support iPad3...)
So, a couple of quick questions first...
Anyone with the same problems?
Do you know if anything has changed recently on iOS that blocks AIR playing video?
I do the usual netstream / netconnection stuff then pass a File.url to netstream.play().
Here are the guts of the code:
var nc:NetConnection = new NetConnection();
var ns:NetStream;
var vid:Video = new Video();
var videoFile:File;
videoFile = File.applicationDirectory;
videoFile = videoFile.resolvePath(Config.VIDEO_DIRECTORY + 'myVideo.mp4');
nc.connect(null);
ns = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus, false, 0, true);
ns.client = this; // To handle onMetaData & onXMPData
vid.attachNetStream(ns);
vid.smoothing = true;
addChild(vid);
ns.play(videoFile.url);
Publish settings are:
Hardware acceleration :: Level 2 - GPU (have also tried Direct)
Render Mode :: GPU (have also tried Direct)
Device :: iPad
Resolution :: High (have also tried Standard)
Included files :: app.swf, app.xml, assets directory with video / images (images load fine) (tried including .mp4 directly rather than in directory, no difference)
Can any of you help?

I am experiencing the same issue when I started using AIR 3.3. When I attempt to play a video, the app would crash.
When I went back to AIR 3.1, the problem went away and was again able to play the h.264 MP4 video with no problem.
According to the following link, there appears to be a bug in AIR 3.3, which supposedly will be fixed when 3.4 comes out. #See https://bugbase.adobe.com/index.cfm?event=bug&id=3210031

Ok, fixed.
The above code is all correct (works perfectly), but the video file was wrong.
I still don't understand why, and would welcome some response, but I have switched to .flv formatted video and it works fine.
The file I was testing was encoded for iPad and ran fine when played in AIR on the desktop, and when imported to the iPad and played natively.
Any insight to encoding presets (I am running Adobe Media Encoder) for mp4 would be interesting.

i had the same solution, it works with videos included in the build. But if I stream the flv from my server (http) nothing happens...

Related

HTML5 Video element does not a resume live streaming when a stream is interrupted then restarts

I'm using JW Player to live stream content onto a web page. The player is backed by an open-source library called cine.io.
My issue is that the player falls back to an HTML 5 video element for all mobile web, both on iPhone and Android. There are some differences between the flash solution of JW Player and HTML5 - notably that if a live stream starts, then stops, then restarts, the video element will not pick up the restarted stream.
This is a problem since streams often drop in and out - and the flash solution does pick up the restarted stream.
I tested a bunch of listener methods on the video and the only one that signalled that the stream had ended was a "time update" listener:
$video.on('timeupdate', function(){
//Do something
});
However none of my attempts to re-open the stream have been effective.
Is this even possible? Can anyone provide pointers?
Would an example like this work?
http://support.jwplayer.com/customer/portal/articles/1442607-example-a-custom-error-message

AIR: playing vH264 on IOS. How to do it using StageWebView or StageVideo?

I have found that post:
Adobe Air video player blank video on iPad
That tells that H264 video could be played on IOS using StageWebView and StageVideo
Is there any existing sample for that ?
You can check info here
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageVideo.html
try to use this example http://01am.co.uk/blog/stagevideo-ios-air
I think this is the key code you need. This is how you do h.264 on stageVideo in air for ios. You set a rectangle to show it - viewPort.
ncMain = new NetConnection();
ncMain.connect(null);
nsMain = new NetStream(ncMain);
nsMain.client = this;
svMain = stage.stageVideos[0];
svMain.attachNetStream(nsMain);
svMain.viewPort = new Rectangle(0,0,1024,768);
After this code it should be regular netStream commands like:
nsMain.play("myVideo.mp4");
gotoandlearn.com has a tutorial with some code for stageVideo.

as3 Video not displayed on PC in debug mode

I am developing an app in as3+AIR for iPad with Flashdevelop.
I stream a flv with StageVideo and everything is working fine deployed on iPad.
But on the PC in Flashdevelop Debug mode no video is shown, although it gets played (NET_STATUS events are dispatched).
Any idea whats happening?
According to Adobe's Flash Roadmap, StageVideo won't be supported on PCs until 2013.
Try adding some code which checks for StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY:
function onStageVideoState(e:StageVideoAvailabilityEvent):void
{
var available:Boolean = (e.availability == StageVideoAvailability.AVAILABLE);
trace("Got StageVideo?", available);
}
stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoState);
When StageVideo is not available, you'll have to use a regular Video object as a fallback.

SWFObject embedded Flash fullscreen doesn't work on PC

I created a fullscreen flash app on
http://dominggus.nl/school/afstuderen/expo/
I used the SWFObject generator to create the embedding code.
Furthermore, I need to put the screen.width/screen.height (with JavaScript) as flashVars to the SWF...
This all works perfectly on MAC on Chrome/FF but, on windows it only works in IE...chrome and Firefox refuse to go fullscreen...
how can that be?
edit: I already tried static/dynamic publishing with SWFObject, same results
(see http://dominggus.nl/school/afstuderen/expo/index2.html for dynamic)
Ah looks like you're running into a flash run-time error but not seeing it in Chrome or FF cause of no Debug player installed, this is easy for FF just install the netscape compatible debug player to see the error (for Chrome the install is more complicated, due to it managing Flash player updates internally).
In FF I get this error:
SecurityError: Error #2152: Full screen mode is not allowed.
at flash.display::Stage/set displayState()
at nl.dominggus.infographic.ui::NoFullScreenPage/startButtonClickHandler()[/Users/dominggus/Documents/dpdk/eclipse_workspace/cmd_afstuderen_infographic/src/as/nl/dominggus/infographic/ui/NoFullScreenPage.as:54]
I believe this means the allowFullscreen parameter for the plugin isn't being set correctly.
Verify Flash player version here (bottom of page shows debug Yes/No):
http://helpx.adobe.com/flash-player/kb/find-version-flash-player.html
Get the appropriate Debug player for a given platform:
http://www.adobe.com/support/flashplayer/downloads.html
Edit pasted from the docs
FULL_SCREEN_INTERACTIVE Constant
public static const FULL_SCREEN_INTERACTIVE:String = "fullScreenInteractive"
Language Version: ActionScript 3.0
Runtime Versions: Flash Player 11.3, AIR 1.0, Flash Lite 4

Video loaded using NetStream hangs in 10.0.2.54, but plays in 10.1.x.x Flash Player

Good day!
I'm loading flv file using Video and Netstream (trivial example from docs). On Flash player 10.1 everything works fine. On 10.0.2.54 everything stops on NetStream.Play.Start. May be this is some well known bug?
Thanks in advance!
The real cause was (I suppose) garbage collection. My NetStream instance was declared as local variable inside custom class' method. I've moved it to be class variable and it works.
Here what I found here: http://www.adobe.com/support/documentation/en/flashplayer/10/Flash_Player_10_Release_Notes.pdf Flash Player 10.0.2.54 is included with initial release of Flash CS4 Professional. This build was not deployed publicly to the Web. Users should update to the newest version of Flash Player 10 for content development and testing. Updated versions of the content debugger and other players are posted on the Flash Player Support Center Downloads page.