Skip to main content
Known Participant
January 14, 2014
Answered

html 5 video not working

  • January 14, 2014
  • 1 reply
  • 1159 views

I have a very simple air project. It places a stagewebview an loads a page (the code it below if needed). The page has a button which tests if html 5 video is supported by your browser. If I run the code in the debugger I can see that I have video support. If I publish to iPad I have video support. The problem is when I publish to desktop, mac or pc, it does not have support. Not sure why it works in debugger but no in a published app. How do I get html 5 video to work on an air for desktop application?

import flash.media.StageWebView;

import flash.geom.Rectangle;

var webView:StageWebView = new StageWebView();

webView.viewPort = new Rectangle(0,0,stage.stageWidth, stage.stageHeight);

webView.stage = this.stage;

webView.loadURL("http://www.w3schools.com/html/html5_video.asp");

This topic has been closed for replies.
Correct answer User Unknow

Adobe Air support native and non-native StageWebView appearance. In non-native you can't use modern html5 tags. For solving this issue you need to switch your Air app to Native StageWebView mode (desktop only, mobile always use native).

var webView:StageWebView = new StageWebView(true);

Just add true and your StageWebView will use Safari / IE component / activeX for html rendering. This solve your problem.

If your Air sdk don't have this option - try to update your Air sdk.

P.S. it's not a bug.

1 reply

User Unknow
User UnknowCorrect answer
Legend
January 14, 2014

Adobe Air support native and non-native StageWebView appearance. In non-native you can't use modern html5 tags. For solving this issue you need to switch your Air app to Native StageWebView mode (desktop only, mobile always use native).

var webView:StageWebView = new StageWebView(true);

Just add true and your StageWebView will use Safari / IE component / activeX for html rendering. This solve your problem.

If your Air sdk don't have this option - try to update your Air sdk.

P.S. it's not a bug.

Known Participant
January 14, 2014

Turning on a native browser seem like just what I need. But I can't. I was on 3.8 and tried 3.9 and now 4.0 and none of them let me put a boolean in the constructor. I keep getting an error stating that no more than 0 params expected. Is this a feature that was removed? Am I missing something? my output app xml shows that 4.0 was in fact used.

User Unknow
Legend
January 14, 2014

Do you get latest beta 4.0.0.1390?