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]