最佳答案
查看源代码,除了你传递的类型之外没有什么不同。
/**
* Sets video path.
*
* @param path the path of the video.
*/
public void setVideoPath(String path) {
setVideoURI(Uri.parse(path));
}
/**
* Sets video URI.
*
* @param uri the URI of the video.
*/
public void setVideoURI(Uri uri) {
setVideoURI(uri, null);
}
如果您使用 setVideoPath
,它会为您创建 Uri
,因此请使用您想要的任何一个 - 取决于您是否有 Uri
或 String
路径。
关于java - VideoView的setVideoPath和setVideoURI有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30428438/