We are downloading a video from sever & playing it using “native.newVideo” code shown in API (as it is).
But app is getting crashed, error: “Unfortunately app is stopped”
We’ve tried many many solutions entire day but couldn’t fix it.
We’ve ensured video file is there. When same downloaded video is played using media.play it is getting played.
When we keep the video directly into Resource directory it is getting played with native.newVideo code.
No error in ADB logcat. (Android only App)
I’ve attached entire code in zip file please it.
local function playVideo()
local video = native.newVideo( display.contentCenterX, display.contentCenterY, 320, 480 )
video:load( “Latin.mp4”,system.DocumentsDirectory )
video:play()
end
local function networkListener( event )
if ( event.isError ) then
print( “Network error - download failed” )
elseif ( event.phase == “ended” ) then
print( “Progress Phase: ready” )
playVideo()
end
end
local params = {}
params.progress = true
network.download(“http://sirma.no/Latin.mp4”, “GET”, networkListener, params, “Latin.mp4”, system.DocumentsDirectory )