<< "(" << static_cast<void*>(this) << ") " << __func__
<< ",current_time:" << GetCurrentTime().InSecondsF();
+ if (IsPlayerSuspended()) {
+ is_play_pending_ = true;
+ LOG_ID(INFO, GetPlayerId()) << "Player is suspended";
+ delayed_player_state_ = PLAYER_STATE_DELAYED_PLAY;
+ if (playback_time_ != base::Milliseconds(0)) {
+ LOG_ID(INFO, GetPlayerId()) << "Player should seek to " << playback_time_;
+ delayed_player_state_ = PLAYER_STATE_DELAYED_SEEK;
+ pending_seek_duration_ = playback_time_;
+ }
+ Resume();
+ return false;
+ }
+ if (is_resuming_) {
+ LOG_ID(INFO, GetPlayerId()) << "Player is still resuming, delay play";
+ DelayPlayExecution();
+ return false;
+ }
+
// HBBTV runs in preloading and preplay mode. If not prepread do prepare
// in PlayerPrePlay(), otherwise do normal Play.
if (blink::IsHbbTV()) {
if (is_preloading_) {
LOG_ID(INFO, GetPlayerId()) << "Player is still preloading, delay play";
- if (delayed_player_state_ == PLAYER_STATE_DELAYED_SEEK ||
- delayed_player_state_ == PLAYER_STATE_DELAYED_SEEK_THEN_PLAY) {
- delayed_player_state_ = PLAYER_STATE_DELAYED_SEEK_THEN_PLAY;
- } else {
- delayed_player_state_ = PLAYER_STATE_DELAYED_PLAY;
- }
-
+ DelayPlayExecution();
return true;
}
if (is_preparing_) {
LOG_ID(INFO, GetPlayerId())
<< "Player is still being prepared, delay play";
- if (delayed_player_state_ == PLAYER_STATE_DELAYED_SEEK ||
- delayed_player_state_ == PLAYER_STATE_DELAYED_SEEK_THEN_PLAY) {
- delayed_player_state_ = PLAYER_STATE_DELAYED_SEEK_THEN_PLAY;
- } else {
- delayed_player_state_ = PLAYER_STATE_DELAYED_PLAY;
- }
+ DelayPlayExecution();
return true;
}
if (!player_prepared_) {
if (blink::IsHbbTV() && !parental_rating_pass_) {
LOG_ID(INFO, GetPlayerId())
<< "parental rating authenticatoin is not pass yet,waiting...";
- if (delayed_player_state_ == PLAYER_STATE_DELAYED_SEEK ||
- delayed_player_state_ == PLAYER_STATE_DELAYED_SEEK_THEN_PLAY) {
- delayed_player_state_ = PLAYER_STATE_DELAYED_SEEK_THEN_PLAY;
- } else {
- delayed_player_state_ = PLAYER_STATE_DELAYED_PLAY;
- }
+ DelayPlayExecution();
MediaPlayerBridgeCapi::ExecuteDelayedPlayerState();
return false;
}
void MediaPlayerBridgeCapiTV::PlayerPreloaded() {
LOG_ID(INFO, GetPlayerId()) << "PlayerPreloaded,this: " << this
<< ",player_prepared_:" << player_prepared_;
-
// If the encrypted_listener_or_cdm_has_changed_ flag is true, then the
// CDM has changed or been set since we started to preload, so we'll
// restart the preload/prepare to use the new CDM.
}
#endif // TIZEN_MULTIMEDIA_DRMMANAGER_SUPPORT
+void MediaPlayerBridgeCapiTV::DelayPlayExecution() {
+ switch(delayed_player_state_) {
+ case PLAYER_STATE_DELAYED_SEEK:
+ case PLAYER_STATE_DELAYED_SEEK_THEN_PLAY:
+ delayed_player_state_ = PLAYER_STATE_DELAYED_SEEK_THEN_PLAY;
+ break;
+ default:
+ delayed_player_state_ = PLAYER_STATE_DELAYED_PLAY;
+ }
+}
+
bool MediaPlayerBridgeCapiTV::CompleteDrmInit(int& drmhandle) {
base::AutoLock auto_lock(drm_lock_);