mirror of https://github.com/axmolengine/axmol.git
* Fix bug: can't play video in obbfile. * Change check order.
This commit is contained in:
parent
4bb958fe29
commit
86a9e0c1b8
|
@ -297,6 +297,9 @@ public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl
|
|||
mCurrentBufferPercentage = 0;
|
||||
if (mIsAssetRouse) {
|
||||
AssetFileDescriptor afd = mCocos2dxActivity.getAssets().openFd(mVideoFilePath);
|
||||
if (afd == null && Cocos2dxHelper.getObbFile() != null) {
|
||||
afd = Cocos2dxHelper.getObbFile() .getAssetFileDescriptor(mVideoFilePath);
|
||||
}
|
||||
mMediaPlayer.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength());
|
||||
} else {
|
||||
mMediaPlayer.setDataSource(mCocos2dxActivity, mVideoUri);
|
||||
|
|
Loading…
Reference in New Issue