mirror of https://github.com/axmolengine/axmol.git
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:
commit
a6e6dc2605
|
@ -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