mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-11-27 01:00:50 +00:00
!5282 MediaPlayer使用前增加判空处理
Merge pull request !5282 from wangjincheng/master
This commit is contained in:
commit
6e2d5158b0
@ -52,6 +52,10 @@ bool BootVideoPlayer::PlayVideo()
|
||||
if (mediaPlayer_ == nullptr) {
|
||||
mediaPlayer_ = Media::PlayerFactory::CreatePlayer();
|
||||
}
|
||||
if (mediaPlayer_ == nullptr) {
|
||||
LOGE("PlayVideo SetPlayerCallback fail, mediaPlayer_ is nullptr");
|
||||
return false;
|
||||
}
|
||||
std::shared_ptr<VideoPlayerCallback> cb = std::make_shared<VideoPlayerCallback>(shared_from_this());
|
||||
int32_t ret = mediaPlayer_->SetPlayerCallback(cb);
|
||||
if (ret != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user