Fixed VideoPlayer can't play when passing the full path of video resource

This commit is contained in:
WenhaiLin 2015-01-09 19:14:19 +08:00
parent e2c7743db1
commit 57cd4cd3c6
1 changed files with 4 additions and 1 deletions

View File

@ -210,13 +210,16 @@ public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl
private boolean isAssetRouse = false;
private String fileName = null;
private String assetResourceRoot = "assets/";
public void setVideoFileName(String path) {
if (path.startsWith("/")) {
isAssetRouse = false;
setVideoURI(Uri.parse(path),null);
}
else {
if (path.startsWith(assetResourceRoot)) {
path = path.substring(assetResourceRoot.length());
}
fileName = path;
isAssetRouse = true;
setVideoURI(Uri.parse(path),null);