java - Streaming video from server using VideoView, error (1, -2147483648) with larger files (Sorry, this video cannot be played) -


as title says, i'm trying stream video app using videoview. works fine smaller videos, larger ones, refuses play ("sorry, video cannot played" popup, , server receives clientabortexception).

i assume way works downloads whole file memory or , attempts load @ once (which perhaps device handle?). i've implemented chunked streaming functionality on server (parsing range headers, etc) imagine need implement same functionality client side well. can done videoview?

here's server code (it works fine ios video player, requests in chunks default):

fileinputstream in = new fileinputstream(file); servletoutputstream out = response.getoutputstream();  long begin = 0; long length, end = file.length();  list<integer> range = parserange(request); if (range.size() > 0) {     begin = range.get(0); }            if (range.size() > 1) {     end = range.get(1); } int datalength = (int)(end - begin) + 1;  response.setheader("accept-ranges", "bytes"); response.setheader("content-range", contentrangeheaderstring(begin, end, length)); response.setcontentlength(datalength); response.setcontenttype("video/mp4");  ioutils.copylarge(in, out, begin, datalength); 


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -