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

69 Views Asked by At

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);
0

There are 0 best solutions below