From c7bb418aad9b86e50a6321ed21343cb9bd19a5bc Mon Sep 17 00:00:00 2001 From: dujingcheng Date: Thu, 29 Jul 2021 19:03:52 +0800 Subject: [PATCH] hanfeng6@huawei.com Signed-off-by: dujingcheng --- frameworks/core/components/video/video_element.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frameworks/core/components/video/video_element.cpp b/frameworks/core/components/video/video_element.cpp index 2c03a5b8..42cf0b97 100644 --- a/frameworks/core/components/video/video_element.cpp +++ b/frameworks/core/components/video/video_element.cpp @@ -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");