Resetting the slider value to 0 at EOF:N_SE-35231
authorrahul varna <rahul.varna@samsung.com>
Fri, 19 Apr 2013 05:09:39 +0000 (14:09 +0900)
committerrahul varna <rahul.varna@samsung.com>
Fri, 19 Apr 2013 05:09:39 +0000 (14:09 +0900)
Signed-off-by: rahul varna <rahul.varna@samsung.com>
project/src/Player/PlayerForm.cpp
project/src/Player/PlayerForm.h

index 796cf3e..ed73463 100644 (file)
@@ -866,7 +866,6 @@ PlayerForm::OnPlayerOpened(result r)
 void
 PlayerForm::OnPlayerEndOfClip(void)
 {
-       //Insert your code to operate after the player reached end of clip.
        UpdateInfo();
        OnMaxPercentComplete();
        if (__isUrlContent == true)
@@ -875,6 +874,9 @@ PlayerForm::OnPlayerEndOfClip(void)
                GetFilePathFromConfig();
        }
        RefreshButtonTexts();
+       //slider reset to 0 is called as an event to
+       //avoid displaying the last value of the slider
+       SendUserEvent(SLIDER_RESET, null);
 }
 
 void
@@ -1124,6 +1126,27 @@ PlayerForm::UpdateProgressBar(int percent)
 }
 
 void
+PlayerForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
+{
+       AppLog("PlayerForm::OnUserEventReceivedN : request id = %d", requestId);
+       switch (requestId)
+       {
+       case SLIDER_RESET:
+       {
+               if (__pSliderPos != null)
+               {
+                       __pSliderPos->SetEnabled(false);
+                       __pSliderPos->SetValue(0);
+                       __pSliderPos->Invalidate(true);
+               }
+       }
+       break;
+       default:
+               break;
+       }
+}
+
+void
 PlayerForm::OnTimerExpired(Timer& timer)
 {
        TryReturn(__pPlayer != null, , "Player is NULL!!");
index 7cbf5b8..3f85e82 100644 (file)
@@ -78,6 +78,8 @@ protected:
        virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
        //Adjustment listener
        virtual void OnAdjustmentValueChanged(const Tizen::Ui::Control& source, int adjustment);
+
+       virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
        //Player callbacks
        void OnPlayerOpened(result r);
        void OnPlayerEndOfClip(void);
@@ -119,6 +121,7 @@ protected:
        static const int ID_PREV = FOOTER_ITEM_BASE;
        static const int ID_NEXT = FOOTER_ITEM_BASE + 1;
        static const int ID_PLAY = FOOTER_ITEM_BASE + 2;
+       static const int SLIDER_RESET =101;
        CONST_INT(ID_STOP);
        CONST_INT(ID_BACK);
        CONST_INT(ID_BUTTON_CLOSE_POPUP_MESSAGE);