From: Abhismita Ghosh Date: Fri, 2 Aug 2013 10:58:45 +0000 (+0900) Subject: Fix N_SE-48032 N_SE-48035 X-Git-Tag: 2.2_release^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen;p=apps%2Fosp%2FVideoPlayer.git Fix N_SE-48032 N_SE-48035 Change-Id: I297500dc3451ba20f13d7e1f94b2e0902acb011a --- diff --git a/inc/VpVideoPlayerForm.h b/inc/VpVideoPlayerForm.h index f7a8272..53aca9c 100755 --- a/inc/VpVideoPlayerForm.h +++ b/inc/VpVideoPlayerForm.h @@ -42,6 +42,7 @@ class VideoPlayerForm , public Tizen::Ui::Controls::ISliderEventListener , public Tizen::Ui::IActionEventListener , public Tizen::Ui::IAdjustmentEventListener + , public Tizen::Ui::IFocusEventListener , public Tizen::Ui::IKeyEventListener , public Tizen::Ui::IOrientationEventListener , public Tizen::Ui::ITouchEventListener @@ -84,6 +85,9 @@ public: virtual void OnAdjustmentValueChanged(const Tizen::Ui::Control& source, int adjustment); + virtual void OnFocusGained(const Tizen::Ui::Control& source){} + virtual void OnFocusLost(const Tizen::Ui::Control& source); + virtual void OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode); virtual void OnKeyReleased(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode); virtual void OnKeyLongPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode); diff --git a/src/VpVideoPlayerForm.cpp b/src/VpVideoPlayerForm.cpp index 19a82bd..ee9d828 100644 --- a/src/VpVideoPlayerForm.cpp +++ b/src/VpVideoPlayerForm.cpp @@ -497,6 +497,7 @@ VideoPlayerForm::InitializeController(void) __pFastRewindButton ->AddActionEventListener(*this); __pFastRewindButton->AddTouchEventListener(*this); __pFastRewindButton->AddKeyEventListener(*this); + __pFastRewindButton->AddFocusEventListener(*this); __pFastForwardButton = static_cast(__pControllerPanel->GetControl(IDC_BUTTON_FASTFORWARD)); TryCatch(__pFastForwardButton != null, r = E_SYSTEM, "__pFastForwardButton is null"); @@ -504,6 +505,7 @@ VideoPlayerForm::InitializeController(void) __pFastForwardButton->AddActionEventListener(*this); __pFastForwardButton->AddTouchEventListener(*this); __pFastForwardButton->AddKeyEventListener(*this); + __pFastForwardButton->AddFocusEventListener(*this); SetFormBackEventListener(this); @@ -1339,6 +1341,19 @@ VideoPlayerForm::OnAdjustmentValueChanged(const Control& source, int adjustment) } void +VideoPlayerForm::OnFocusLost(const Tizen::Ui::Control& source) +{ + AppLogDebug("OnFocusLost Control : %ls, KeyCode : %d", source.GetName().GetPointer()); + + if ((&source == __pFastForwardButton + || &source == __pFastRewindButton) + && __actionTouchLongPressed == true) + { + __pVideoPlayerPresentationModel->StopFastForwardRewind(); + } +} + +void VideoPlayerForm::OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode) { __pUiControlTimer->Cancel(); diff --git a/src/VpVideoPlayerPresentationModel.cpp b/src/VpVideoPlayerPresentationModel.cpp index 480604a..cdc0c8e 100644 --- a/src/VpVideoPlayerPresentationModel.cpp +++ b/src/VpVideoPlayerPresentationModel.cpp @@ -473,7 +473,7 @@ CATCH: result VideoPlayerPresentationModel::PausePlay(void) { - result r = E_FAILURE; + result r = E_SUCCESS; PlayerState playState = GetState(); AppLogDebug("PausePlay : %d", playState);