!69 adapter vidoe src

Merge pull request !69 from hanfeng/master
This commit is contained in:
openharmony_ci 2021-07-29 12:06:33 +00:00 committed by Gitee
commit cb4cdcbf74

View File

@ -239,7 +239,10 @@ void VideoElement::PreparePlayer()
LOGE("Player Reset failed");
return;
}
const std::string filePath = AceEngine::Get().GetAssetAbsolutePath(src_);
std::string filePath = src_;
if (!StringUtils::StartWith(filePath, "file://")) {
filePath = AceEngine::Get().GetAssetAbsolutePath(src_);
}
LOGI("filePath : %{private}s", filePath.c_str());
if (mediaPlayer_->SetSource(filePath) != 0) {
LOGE("Player SetSource failed");