我喜欢在Android Wear中播放我的视频文件,但我发现Android Wear不支持videoview
。
有替代方案吗?
InputStream ins = MainActivityBackup.this.getResources().openRawResource (R.raw.hyperlapse2);
File tmpFile = null;
OutputStream output;
try {
tmpFile = File.createTempFile("video","mov");
output = new FileOutputStream(tmpFile);
final byte[] buffer = new byte[102400];
int read;
while ((read = ins.read(buffer)) != -1) {
output.write(buffer, 0, read);
}
output.flush();
output.close();
ins.close();
}
catch (IOException e)
{
e.printStackTrace();
}