From 57cd4cd3c69a24995ec23a50dfa998c5cc78600a Mon Sep 17 00:00:00 2001 From: WenhaiLin Date: Fri, 9 Jan 2015 19:14:19 +0800 Subject: [PATCH] Fixed VideoPlayer can't play when passing the full path of video resource --- .../android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java index e55f80ec31..e2881c232b 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java @@ -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);