WS를 사용하여 내 앱에서 비디오를 다운로드합니다. 다운로드 한 비디오를 열고 싶습니다.내부 저장소에서 비디오 열기
나는이 오류가 비디오를 열고 자 할 때 문제가 :
:MyRestClient.get("/diapos/1", null, new BinaryHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, byte[] binaryData) {
InputStream input = new ByteArrayInputStream(binaryData);
try {
OutputStream output = new FileOutputStream("/diapos/1.mp4");
byte data[] = new byte[4096];
int count;
while ((count = input.read(data)) != -1) {
output.write(data, 0, count);
}
} catch (IOException e) { e.printStackTrace(); }
}
이 내가 비디오를 재생하는 방법입니다
VideoView: Unable to open content: /data/user/0/code.package/files/diapos/1.mp4
java.io.IOException: setDataSource failed.
이 다운로드 기능입니다
final VideoView video = (VideoView) getActivity().findViewById(R.id.video);
String path = getActivity().getFilesDir().getAbsolutePath() + "/diapos/1.mp4";
video.setVideoURI(Uri.parse(path));
video.start();
어쩌면 좋은 길이 아니겠습니까? 아니면 비디오를 저장하는 방법? 비디오를 내부 저장소에 다운로드해야한다고 지정합니다. 외부 저장 장치가 없습니다.
내가 그 3 시간을 기다려야 : 나는 동영상을 재생 곳
이것은 :
이 내가 WS 내 전화를 할 수있는 곳입니다. 죄송합니다. –
확인. 나는 그 사실을 몰랐다. 죄송합니다. –