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 boolean isAssetRouse = false;
|
||||||
private String fileName = null;
|
private String fileName = null;
|
||||||
|
private String assetResourceRoot = "assets/";
|
||||||
public void setVideoFileName(String path) {
|
public void setVideoFileName(String path) {
|
||||||
if (path.startsWith("/")) {
|
if (path.startsWith("/")) {
|
||||||
isAssetRouse = false;
|
isAssetRouse = false;
|
||||||
setVideoURI(Uri.parse(path),null);
|
setVideoURI(Uri.parse(path),null);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (path.startsWith(assetResourceRoot)) {
|
||||||
|
path = path.substring(assetResourceRoot.length());
|
||||||
|
}
|
||||||
fileName = path;
|
fileName = path;
|
||||||
isAssetRouse = true;
|
isAssetRouse = true;
|
||||||
setVideoURI(Uri.parse(path),null);
|
setVideoURI(Uri.parse(path),null);
|
||||||
|
|
Loading…
Reference in New Issue