native.cancelWebPopup() does not kill WebViewCoreThread? b508

Aloha! I just noticed that on Android
[lua]native.cancelWebPopup()[/lua]

does not kill the WebViewCoreThread. It is still there and I suppose it’s doing EVIL stuff. (performance wise it it doing something - as far as I can see that in ddms - it is keeping my CoronaPortal.nativeRender from rendering :wink: )

[import]uid: 11772 topic_id: 10168 reply_id: 310168[/import]

Similar thing occurs on iPhone as well. Can we please have an ETA on this fix from someone at Corona. Have been requesting one for weeks now and just get ignored by Corona staff…very disappointing…how hard is it to give some indication on when it will be fixed???

On iPhone WebPopup is unusable as if you cancel a webpopup before it’s fully loaded then try to load a new webpopup you just get a blank screen :frowning: Makes it impossible to release an app which integrates the webPopup at all!! [import]uid: 61273 topic_id: 10168 reply_id: 40725[/import]

This is case 6319. Did you try adding a Webpopup event listener? That seemed to improve the ability to cancel web request. [import]uid: 7559 topic_id: 10168 reply_id: 44687[/import]

Hi Tom,

This makes absolutely no difference. I’ve spoken at length to Carlos about this. This was promised to be a priority fix and was finally given to engineers a couple of weeks back.

If you want a compiled ready for release app which makes it VERY easy to see why this is such a terrible bug send me your phone id!

I cannot release this app because of this major bug. I cannot actually see how anyone could use the webpopup in a released app!!

Please send me your phone ID and get engineers working on this right away.
Thanks,

  • Will [import]uid: 61273 topic_id: 10168 reply_id: 44704[/import]

The fix for iOS is now in build 568. We will look and see if Android is doing the same (continue loading after the WebPopup was canceled).

Two notes about the using webPopup

  1. Need to make sure the showWebPopup is only called once.
  2. A event listener should be added to handle error conditions:
local function listener( event )  
 local shouldLoad = true  
  
 if event.errorCode then  
 shouldLoad = false   
 --print( "errorCode, errorMessage: " .. tostring( event.errorCode ), tostring( event.errorMessage ) )  
 end  
  
 return shouldLoad  
end  

We also fixed the “flicker” problem (on iOS) when loading pages that contain lots of graphics. [import]uid: 7559 topic_id: 10168 reply_id: 45010[/import]

Is the “flicker” problem the gray block flashing when you open a webpopup view? [import]uid: 9158 topic_id: 10168 reply_id: 45141[/import]

The flicker occurs as the webpopup loads. The flicker is caused by an animation affect that occurred for each stage of the URL loading. now we only do it for the first load. Graphics load after the text which generated the extra animations. [import]uid: 7559 topic_id: 10168 reply_id: 45156[/import]

I’m gonna have to try the new build. I saw a webpage in my app was flickering so it’d be awesome if this is fixed, along with no longer letting web stuff happen when the app is exited or the popup canceled! This was one of my requests too! :slight_smile: [import]uid: 10389 topic_id: 10168 reply_id: 45309[/import]

The flickering is gone but it still plays audio and video if canceled. [import]uid: 10389 topic_id: 10168 reply_id: 45386[/import]

@waulok, do you have some code you can publish that shows the problem?

Does the audio/video play if you cancel the Webpopup before it finishes loading the page or are you canceling the Webpopup after it starts playing?

Does the audio/video stop by itself once cancelled? [import]uid: 7559 topic_id: 10168 reply_id: 45439[/import]

[code]
– Delay to let webpopup close
local function toMenu( event )
director:changeScene( “mainmenu”, “moveFromLeft” )
end

– If HOME button pressed, head back to menu
local bt01t = function ( event )
if event.phase == “ended” then
native.cancelWebPopup()
timer.performWithDelay(500, toMenu )
end
end
NavbarImage:addEventListener(“touch”,bt01t)
– If network exists, pop up page
if testNetworkConnection() == true then
native.showWebPopup( 0, 48, 320, 432,
http://m.youtube.com/brad20071”,{urlRequest=listener} )
else native.showAlert( “Tech Webcast”, “No network detected. Please connect to 3G or Wifi.”, { “OK”, }, toMenu )
end
[/code] [import]uid: 10389 topic_id: 10168 reply_id: 45518[/import]

I hit play. I’m watching a YouTube video. I hit the button on the screen. It kills the webpopup (I put in a delay just in case that helps and I see the webpopup disappear) and it goes back to my main menu, but the audio from the YouTube is still playing.
I built it for Android as well and when you go back to the main menu, then exit the app all together, the audio is still playing until you kill the app.
I have another webpopup which embeds a podcast player. I got the code from html5rocks.com by Google. It plays mp3s from my podcast. When I exit the page and kill the webpopup, it keeps playing. On an Android the audio keeps playing when I press the HOME button on the phone. (HTC Desire S). [import]uid: 10389 topic_id: 10168 reply_id: 45520[/import]

Yesterday I got this code from the anscamobile sample code to see if it’d help, but it didn’t:

[code]
– Webpopup listener
local function listener( event )
local shouldLoad = true

local url = event.url
if 1 == string.find( url, “corona:close” ) then
– Close the web popup
shouldLoad = false
end

if event.errorCode then
– Error loading page
print( "Error: " … tostring( event.errorMessage ))
shouldLoad = false
end

return shouldLoad
end

– If network exists, pop up page
if testNetworkConnection() == true then
local options = { hasBackground=false, baseUrl=system.ResourceDirectory, urlRequest=listener }
native.showWebPopup( 0, 48, 320, 432, “podcastplayer.html”, options )
else native.showAlert( “Tech Webcast”, “No network detected. Please connect to 3G or Wifi.”, { “OK”, }, toMenu )
end
[/code] [import]uid: 10389 topic_id: 10168 reply_id: 45521[/import]

I embedded the FORM fields with a submit button which does the corona:close (copied from the corona sample source page).
Hitting the submit button does close the webpopup but the audio keeps going. [import]uid: 10389 topic_id: 10168 reply_id: 45523[/import]

Okay, this is a different bug. Our previous bug fix was to stop the webpage loading when native.cancelWebPopup was called.

To save time, can you email your html file so I can verify what you are seeing? tom at anscamobile.com

Thanks,
Tom [import]uid: 7559 topic_id: 10168 reply_id: 45526[/import]

Sure.
You can use the above code to embed a YouTube mobile page and start playing, too. It does the same thing. [import]uid: 10389 topic_id: 10168 reply_id: 45529[/import]

Got the file and verified the problem. I’ll file a bug against it. Thanks.

-Tom [import]uid: 7559 topic_id: 10168 reply_id: 45792[/import]

Thanks Tom! :slight_smile: [import]uid: 10389 topic_id: 10168 reply_id: 45968[/import]