![](/img/trans.png)
[英]Can you tell me what's wrong with “ videoView.setVideoURI(uri);”, “ videoView.start();”?
[英]What is the difference between VideoView's setVideoPath and setVideoURI
VideoView有两种不同的方式来指定要播放的视频:
这两者之间有什么区别?何时应该使用其中一种?
查看源代码,除了您传递的类型之外没有什么不同。
/**
* 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
路径使用您想要的任何内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.