WebpopUp and Local html file

I am trying to work with the webpopup api, doing a simple popup to open a local html file. In the html file, I have code to embed a youtube video. I have created 2 buttons, one to open and one to close the popup. When open the file local html loads, the youtube video thumbnail is shown. When tumbnail is “touched” on, video tries to load, as in tries to play as expected. Youtube activity indicator shows it is loading, but no video or audio, also no buffer. When “touched” again, video indicates paused. I have tried the iframe embed and object embed in html file but nothing happens. Also tried, “&autoplay=1” parameter from youtube but nothing plays. Can anyone shed some light on this?

[code]local button = display.newImage( “button.png” )
button.x = display.contentWidth / 3
button.y = display.contentHeight -50
local button2 = display.newImage( “button.png” )
button2.x = display.contentWidth *2/ 3
button2.y = display.contentHeight -50

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

local options = { hasBackground=false, baseUrl=system.ResourceDirectory, urlRequest=listener }

function button:tap( event )
native.showWebPopup( 0, 0, 300, 300, “test.html”, options)
end
function button2:tap( event )
native.cancelWebPopup()
end
button:addEventListener( “tap”, button )
button2:addEventListener( “tap”, button2 )
[/code] [import]uid: 71201 topic_id: 14477 reply_id: 314477[/import]

this is just for debugging, if you double click and open the html file on your machine, not he mobile device, can you see the audio/video?

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 14477 reply_id: 53568[/import]

Opening the test.html file on computer works. Both iframe and object video plays. Also tried opening file from phone’s browser, both iframe and object video plays. [import]uid: 71201 topic_id: 14477 reply_id: 53572[/import]

Have you found a solution yet? [import]uid: 46482 topic_id: 14477 reply_id: 66722[/import]

What device are you testing this on and which build are you using? Is this in the Mac simulator? [import]uid: 7559 topic_id: 14477 reply_id: 66733[/import]

Android 2.3 on a htc sensation, on the device, with corona 2011.591 (2011.8.2) [import]uid: 46482 topic_id: 14477 reply_id: 66744[/import]

Ok, I found that this is not an error in the Corona framework, I’ve made a test with an Webview in java and build a native application and I got the same… it’s a bug in webview, I’ll let you know if I find a workaround.
[import]uid: 46482 topic_id: 14477 reply_id: 66770[/import]

Ok guys, I’ve managed to make it work in java/native using this code:
[lua]WebView webview = (WebView)findViewById(R.id.webview);
WebSettings webSettings = webview.getSettings();
webSettings.setPluginsEnabled(true);
webSettings.setJavaScriptEnabled(true);
webSettings.setAllowFileAccess(true);
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
//a test url
webview.loadUrl(“http://www.addsite.ro/videotest.htm”);[/lua]

And inside the html i have a code for auto-play a video:

[html]

[/html] [import]uid: 46482 topic_id: 14477 reply_id: 66774[/import]

Can you provide a sample source files on how this is actually works? I understand the code for inside the html file but where does the first portion go? [import]uid: 71201 topic_id: 14477 reply_id: 66799[/import]

It is in java for @Tom from Ansca Stuff, so they can include this fix in Corona. I hope it helps them… [import]uid: 46482 topic_id: 14477 reply_id: 66802[/import]