{"id":2256,"date":"2022-08-30T15:23:21","date_gmt":"2022-08-30T15:23:21","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/05\/air-for-android-video-loaded-inside-stagewebview-crashes-on-fullscreen-after-device-orientation-changes-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:23:21","modified_gmt":"2022-08-30T15:23:21","slug":"air-for-android-video-loaded-inside-stagewebview-crashes-on-fullscreen-after-device-orientation-changes-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/air-for-android-video-loaded-inside-stagewebview-crashes-on-fullscreen-after-device-orientation-changes-collection-of-common-programming-errors\/","title":{"rendered":"Air for Android: video loaded inside StageWebView crashes on fullscreen after device orientation changes-Collection of common programming errors"},"content":{"rendered":"<p>I have a simple application, which tries to load an mp4 video inside a StageWebView, and display it inside an AIR application for Android. For the sake of examples, I simplified everything down to this:<\/p>\n<p>AIR code<\/p>\n<pre><code>public function videoTest() {\n  addEventListener(Event.ADDED_TO_STAGE, onAdded);\n}\npublic function onAdded(ev:Event):void {    \n  webView = new StageWebView();\n  webView.stage = stage;\n  webView.viewPort = new Rectangle(0, 0, stage.fullScreenWidth, stage.fullScreenHeight);\n  webView.loadURL(\"http:\/\/jsfiddle.net\/at386\/show\/\");\n}\n<\/code><\/pre>\n<p>and the fiddle code is this<\/p>\n<pre><code>\n \n\n<\/code><\/pre>\n<p>After starting the application on my phone, (Galaxy s2), in portrait mode, the StageWebView loads fine, the video player is displayed, I can start the video, I can even go on fullscreen mode. If I turn the phone on landscape, i get the following behavior:<\/p>\n<ol>\n<li>fullscreen mode exits<\/li>\n<li>video displayed inside StageWebView is paused<\/li>\n<\/ol>\n<p>clicking play and fullscreen again in landscape causes the application to crash after about 1-2 seconds (the sound from the video runs in the background), with an error message of<\/p>\n<pre><code>\"Unfortunately,  has crashed\"\n<\/code><\/pre>\n<p>Any idea how to fix it?<\/p>\n<p id=\"rop\"><small>Originally posted 2014-01-05 09:33:06. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I have a simple application, which tries to load an mp4 video inside a StageWebView, and display it inside an AIR application for Android. For the sake of examples, I simplified everything down to this: AIR code public function videoTest() { addEventListener(Event.ADDED_TO_STAGE, onAdded); } public function onAdded(ev:Event):void { webView = new StageWebView(); webView.stage = stage; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2256","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2256","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2256"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2256\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2256"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}