mirror of https://github.com/axmolengine/axmol.git
Fixed VideoPlayer can't play when passing the full path of video resource
This commit is contained in:
parent
e2c7743db1
commit
57cd4cd3c6
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue