local videos on android not playing when device resolution is lower -


i'm working on android app needs display videos. client gave me mp4 videos (that have 1 of accepted android formats) , play on nexus 5.

but when tried devices have lower resolutions, don't have image anymore (they're black) , sound playing. pop says "cannot play video". videos work if lower resolution (it seems cannot above device resolution)

what best strategy make sure videos play @ least devices have resolution ~480x800 ? make different versions of them , place them in dpi folders ? or convince client stream them online ?

i'm using videoview display them , place them in raw folder of resources. code looks this:

setcontentview(r.layout.videoactivity); videoview videoview = (videoview) findviewbyid(r.id.videoview); mediacontroller mc = new mediacontroller(this); videoview.setmediacontroller(mc);  videoview.setvideopath("android.resource://" + getpackagename() + "/" + r.raw.asset1); videoview.requestfocus(); videoview.start(); 

as general rule, unless absolutely need them work offline instance, 'nicer' stream videos 'build' them app. realise not technical term, , needs different solutions vary, keeping video on server side reduces application size , allows video updated without having upgrade app.

common streaming techniques support multiple resolutions , bit rates also.

as aside, sure mp4 videos not using 'mainline profile' - older , lower powered android devices can support 'baseline profile'? can check on mist platforms looking @ properties or getting info on video file.


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -