}
void MediaPlayerBridgeCapiAdapter::Initialize(VideoRendererSink* /*sink*/) {
- media_player_->Initialize();
+ is_initialized_ = true;
}
bool MediaPlayerBridgeCapiAdapter::IsInitialized() {
void MediaPlayerBridgeCapiAdapter::Prepare() {
// Prepare function is called internally.
- is_prepared_ = true;
+ media_player_->Initialize();
}
bool MediaPlayerBridgeCapiAdapter::IsPrepared() {
}
void MediaPlayerBridgeCapiAdapter::Play() {
- media_player_->Play();
+ if (IsPrepared())
+ media_player_->Play();
}
void MediaPlayerBridgeCapiAdapter::Pause(bool is_media_related_action) {
- media_player_->Pause(is_media_related_action);
+ if (IsPrepared())
+ media_player_->Pause(is_media_related_action);
}
void MediaPlayerBridgeCapiAdapter::SetRate(double rate) {
- media_player_->SetRate(rate);
+ if (IsPrepared())
+ media_player_->SetRate(rate);
}
void MediaPlayerBridgeCapiAdapter::Seek(base::TimeDelta time) {
- media_player_->Seek(time.InSecondsF());
+ if (IsPrepared())
+ media_player_->Seek(time.InSecondsF());
}
void MediaPlayerBridgeCapiAdapter::Flush(base::OnceClosure flush_cb) {
}
void MediaPlayerBridgeCapiAdapter::SetVolume(double volume) {
- media_player_->SetVolume(volume);
+ if (IsPrepared())
+ media_player_->SetVolume(volume);
}
base::TimeDelta MediaPlayerBridgeCapiAdapter::GetCurrentTime() {
#endif
void MediaPlayerBridgeCapiAdapter::OnInitComplete(int player_id, bool success) {
- is_initialized_ = success;
+ is_prepared_ = success;
}
void MediaPlayerBridgeCapiAdapter::OnResumeComplete(int player_id) {