• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Youtube video in AIR iOS app isn't displayed anymore with AIR 23

Explorer ,
Oct 19, 2016 Oct 19, 2016

Copy link to clipboard

Copied

Hello everyone:

I'm updating my iOS AIR app, and when I compile my IPA file using AIR 23, Youtube videos refuse to show up within my app.

When I compile with AIR 20, everything goes back to normal, and youtube videos run normally on an iPhone.

I'm using the "StageWebView + iframe" method to display the video within the AIR app.

The code I use is written below, is there anything I need to change to make it compatible with AIR V23?    Thanks a lot!!!!

              webViewYoutube = new StageWebView();

               webViewYoutube.stage=stage;

              

               var htmlString:String = "<!DOCTYPE HTML>" +

                        "<html><body bgcolor="+ "Black" + "><script>" +

                        "var tag = document.createElement('script');"+

                        "tag.src = \"http://www.youtube.com/player_api\";"+

                        "var firstScriptTag = document.getElementsByTagName('script')[0];"+

                        "firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);"+

                        "var player;"+           

                        "function onYouTubeIframeAPIReady() {"+

                            "player = new YT.Player('player', {"+            

                              "events: {"+

                                "'onReady': onPlayerReady,"+

                              "}"+

                            "});"+

                        "}"+

                        "function onPlayerReady(event) {"+

                            "event.target.playVideo();"+

                        "}"+

                        "</script>"+

                        "<iframe id=\"player\" type=\"text/html\" width=\"100%\" height=\"100%\" src=\"http://www.youtube.com/embed/XXXXXXXXXX?autohide=1&controls=1&modestbranding=0&rel=0&showinfo=0\" frameborder=\"0\"></iframe>" +

                        "</body></html>";

               webViewYoutube.loadString(htmlString);

               swvHeight = stage.stageHeight;

               webViewYoutube.viewPort = new Rectangle(0, 0, this.stage.stageWidth, swvHeight);

TOPICS
Development

Views

395

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Oct 20, 2016 Oct 20, 2016

Hi Wedrer,

I tried running your sample code at my end and it works fine with our latest AIR 23 Beta release build. Please find the download link below:

Download Adobe AIR 23 Beta - Adobe Labs

And Please specify exceptions to the default behavior by adding keys to InfoAdditions tag of application descriptor of your app.

URLRequest - Adobe ActionScript® 3 (AS3 ) API Reference

Let us know if it works for you.

Thanks,

Adobe AIR Team

Votes

Translate

Translate
Adobe Employee ,
Oct 20, 2016 Oct 20, 2016

Copy link to clipboard

Copied

Hi Wedrer,

I tried running your sample code at my end and it works fine with our latest AIR 23 Beta release build. Please find the download link below:

Download Adobe AIR 23 Beta - Adobe Labs

And Please specify exceptions to the default behavior by adding keys to InfoAdditions tag of application descriptor of your app.

URLRequest - Adobe ActionScript® 3 (AS3 ) API Reference

Let us know if it works for you.

Thanks,

Adobe AIR Team

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 20, 2016 Oct 20, 2016

Copy link to clipboard

Copied

LATEST

I found this chapter on the URLRequest API Reference page:

“App Transport Security is being introduced from Apple in iOS9, which doesn’t allow unsecure connections between App and Web services. Due to this change all the connections which are made to Unsecure web sites via Loader, URLLoader will discontinue and not work due to App Transport Security. Please specify exceptions to the default behaviour by adding keys to Info.plist in your app.”

Therefore, by simply changing my links from http:// to https://, everything worked like a charm!

Thanks a lot deesharm!!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines