Merge pull request #9906 from Dhilan007/v3-video-android-fix

Fixed VideoPlayer can't play when passing the full path of video resource
This commit is contained in:
minggo 2015-01-09 19:24:17 +08:00
commit a6e6dc2605
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);