as3 Video not displayed on PC in debug mode - actionscript-3

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.

Related

swfobject not working on iOS

I'm trying to embed Twitch player using Javascript API - here is documentation how to embed a player using swfobject - https://github.com/justintv/Twitch-API/blob/master/player.md. My Problem is that the code works great on desktop, but on mobile browsers - iOS (I haven't had a chance to check Android yet) script simply doesn't embed a video. It works when I use iframe method though. Is there any fix for iOS to make this works using JS API and swfobject?
swfobject is the flash player (swf = ShockWave Flash). Flash does not, and never will, work on iOS. The iframe method runs coder that detects the OS, and loads the native iOS player on iOS, and flash for everything else. You need to duplicate that functionality.

SecurityError: Error #2152: Full screen mode is not allowed.

I have one flash player , which have full-screen functionality . which is not working in FF and MAC Chrome . and throws an error as below.
SecurityError: Error #2152: Full screen mode is not allowed.
at flash.display::Stage/set displayState()
at com.IQMediaCorp.core::IQMediaCorpPlayer/ToggleFullScreen()
I have googled about the issue and already verified some points below
my player have allowfullscreen = true in html object / encode
element.
the methid ToggleFullScreen is an mouse click event
below is code for ToggleFullScreen method
public function ToggleFullScreen(e:MouseEvent)
{
if (stage.displayState == StageDisplayState.FULL_SCREEN_INTERACTIVE)
{
bKnob.alpha=0;
bigScreen=true;
stage.displayState=StageDisplayState.NORMAL;
}
else
{
bigScreen=false;
stage.displayState=StageDisplayState.FULL_SCREEN_INTERACTIVE;
bKnob.alpha=0;
}
}
i don't get the reason why it is not working. can anybody help??
Thanks
Yes the reason this is happening is you cannot have StageDisplayState.FULL_SCREEN_INTERACTIVE in Flash less than version 11.3
Try StageDisplayState.FULL_SCREEN instead!
So check which version of flash you are building for here is an exerpt from the Adobe docs on displayState
Runtime Versions: Flash Player 11.3, AIR 1.0, Flash Lite 4
Specifies that the Stage is in full-screen mode with keyboard interactivity enabled. As of Flash Player 11.3, this capability is supported in both AIR applications and browser-based applications.

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

Flash exit fullscreen mode on PrintJob

I am using a flash image viewer developed with actionscript 2.0 and used only with IE. It uses flash PrintJob to print images.
var printJob:PrintJob = new PrintJob();
printJob.start()
printJob.addPage(printMc)
printJob.send();
delete printJob;
But when PrintJob is invoked at fullscreen mode, print dialog appears and flash player exits fullscreen mode. Is this a security limitation in Flash ? or Is there any workaround to stop exiting fullscreen mode?
Tested environment
Browser: IE9
OS : Windows 7 64 bit
Flash Player: 11.1.102.63
I would imagine that it's down to the Operating System rather than a unique Flash issue. You can't keep a window in fullscreen mode if it's not the active window; and when you open the Print dialog, that becomes the active window - thus bumping your Flash out of fullscreen mode.
No workarounds that I can think of, because it's not Flash that's controlling this - it's the OS.

Netstream video not playing on iPad

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