From bb4a54b042993161f1c6f22f3200d1fb5bfed5fc Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 26 Apr 2016 15:59:30 +0800 Subject: [PATCH] use fullpath to play background music --- cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp b/cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp index ddc27202c4..03125a9520 100644 --- a/cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp +++ b/cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp @@ -75,12 +75,12 @@ AndroidJavaEngine::~AndroidJavaEngine() void AndroidJavaEngine::preloadBackgroundMusic(const char* filePath) { std::string fullPath = CocosDenshion::android::getFullPathWithoutAssetsPrefix(filePath); - JniHelper::callStaticVoidMethod(helperClassName, "preloadBackgroundMusic", filePath); + JniHelper::callStaticVoidMethod(helperClassName, "preloadBackgroundMusic", fullPath); } void AndroidJavaEngine::playBackgroundMusic(const char* filePath, bool loop) { std::string fullPath = CocosDenshion::android::getFullPathWithoutAssetsPrefix(filePath); - JniHelper::callStaticVoidMethod(helperClassName, "playBackgroundMusic", filePath, loop); + JniHelper::callStaticVoidMethod(helperClassName, "playBackgroundMusic", fullPath, loop); } void AndroidJavaEngine::stopBackgroundMusic(bool releaseData) {