Cannot videos with webView

Dear all, 
 
I’d like to play some remote videos in my application, and they work from a simple lua scene. But when I call  media.playVideo  or  native.newVideo from a  native.newWebView object, it doesn’t work.
 
Specifically, I get the medica controls, and almost immediately the media player closes. With one or two videos, on the other hand, I get a black screen, without any possibility to interact with the app, and after  playing the movie  I gain controls again with the native webview.
 
In my local HTML view I intercept the URL  movie: in my listener:
 

local function txthandler(event) if event.url then log.log("You are visiting: " .. event.url) if event.url == "corona:cancel" then log.log("DELETE SCENE!") composer.gotoScene("menu", vars.fade) end if string.find(event.url, "movie:") ~= nil then local s = string.sub(event.url, 7) log.log("PLAY MOVIE " .. s) if true then media.playVideo(s, media.RemoteSource, true) else local video = native.newVideo(vars.cx, vars.cy, vars.w, vars.h) video:load(s, media.RemoteSource) video:addEventListener( "video", function (event) log.log("Video event phase: " .. event.phase) if event.errorCode then native.showAlert("Error", event.errorMessage, { "OK" }) end end) video:play() --video:pause() --video:removeSelf() --video = nil end return true end end

 
These are the logs from the device:
 

Dec 17 16:29:54 Senseis-MacBook-Pro ostia[41947]: \>\>\> You are visiting: movie:http://www.ingegneria.uniroma3.it/wp-content/uploads/2015/12/NECROPOLI\_DI\_ROMANA\_A.mp4 Dec 17 16:29:54 Senseis-MacBook-Pro ostia[41947]: \>\>\> PLAY MOVIE http://www.ingegneria.uniroma3.it/wp-content/uploads/2015/12/NECROPOLI\_DI\_ROMANA\_A.mp4 Dec 17 16:29:54 Senseis-MacBook-Pro ostia[41947]: \>\>\> MEDIA.PLAYVIDEO Dec 17 16:29:54 Senseis-MacBook-Pro ostia[41947]: \>\>\> Dec 17 16:29:54 --- last message repeated 3 times --- Dec 17 16:29:54 Senseis-MacBook-Pro ostia[41947]: \>\>\> You are visiting: movie:http://www.ingegneria.uniroma3.it/wp-content/uploads/2015/12/NECROPOLI\_DI\_ROMANA\_A.mp4 Dec 17 16:29:54 Senseis-MacBook-Pro ostia[41947]: \>\>\> PLAY MOVIE http://www.ingegneria.uniroma3.it/wp-content/uploads/2015/12/NECROPOLI\_DI\_ROMANA\_A.mp4 Dec 17 16:29:54 Senseis-MacBook-Pro ostia[41947]: \>\>\> MEDIA.PLAYVIDEO Dec 17 16:29:54 Senseis-MacBook-Pro ostia[41947]: CGImageCreate: invalid image size: 0 x 0. Dec 17 16:29:54 Senseis-MacBook-Pro assertiond[41871]: assertion failed: 15C50 13C75: assertiond + 13207 [792516D1-991E-36EE-8454-16F8220758D6]: 0x1 Dec 17 16:29:54 Senseis-MacBook-Pro ostia[41947]: \>\>\> Dec 17 16:29:55 --- last message repeated 1 time --- Dec 17 16:29:55 Senseis-MacBook-Pro assertiond[41871]: assertion failed: 15C50 13C75: assertiond + 13207 [792516D1-991E-36EE-8454-16F8220758D6]: 0x1 Dec 17 16:29:57 Senseis-MacBook-Pro ostia[41947]: CGImageCreate: invalid image size: 0 x 0. Dec 17 16:29:57 Senseis-MacBook-Pro assertiond[41871]: assertion failed: 15C50 13C75: assertiond + 13207 [792516D1-991E-36EE-8454-16F8220758D6]: 0x1 Dec 17 16:30:28 --- last message repeated 3 times ---

 
What am I missing here?
 
Thanks!

So, I’ve made some progress: using

NSAppTransportSecurity = { NSAllowsArbitraryLoads = true },

in the  builds.settings file makes the video from remote sources load  if I remove my handler and just insert a link to a remote video.

In this case I believe I’m getting a native video object, however  there is no way to close it , and I just stare at the video controls.

When using my handler with  media.playVideo the media controls show up and then  all the controls with a completely black screen , but it is playing the video , and after it finishes it gets back to the browser with my HTML page.

The last behavior is weird to me.

Any hints?

Thank you!

Can anyone spot an error? :frowning:

So, I’ve made some progress: using

NSAppTransportSecurity = { NSAllowsArbitraryLoads = true },

in the  builds.settings file makes the video from remote sources load  if I remove my handler and just insert a link to a remote video.

In this case I believe I’m getting a native video object, however  there is no way to close it , and I just stare at the video controls.

When using my handler with  media.playVideo the media controls show up and then  all the controls with a completely black screen , but it is playing the video , and after it finishes it gets back to the browser with my HTML page.

The last behavior is weird to me.

Any hints?

Thank you!

Can anyone spot an error? :frowning: