Apply repeat & share function and Fix nabi issue(N_SE-292630)
authorTaeHo Choi <thanks.choi@samsung.com>
Fri, 22 Mar 2013 08:52:25 +0000 (17:52 +0900)
committerTaeHo Choi <thanks.choi@samsung.com>
Fri, 22 Mar 2013 08:52:25 +0000 (17:52 +0900)
Change-Id: I17e59b7145f5e0cc243e3c973c16e9e5f6ba7c59

inc/VpIVideoPlayerEventListener.h
inc/VpTypes.h
inc/VpVideoPlayerForm.h
inc/VpVideoPlayerPresentationModel.h
manifest.xml
res/screen-size-normal/IDL_MAIN_FORM.xml
src/VpTypes.cpp
src/VpVideoPlayerForm.cpp
src/VpVideoPlayerPresentationModel.cpp

index b30099f..41002d3 100644 (file)
@@ -28,7 +28,7 @@ public:
        virtual ~IVideoPlayerEventListener(void){}
 
        virtual void OnPlayOpened(result r) = 0;
-       virtual void OnPlayEndOfClip(bool playNextContent) = 0;
+       virtual void OnPlayEndOfClip(bool playNextContent, int repeatMode) = 0;
        virtual void OnPlayBuffering(int percent) = 0;
        virtual void OnPlayErrorOccurred(Tizen::Media::PlayerErrorReason r) = 0;
        virtual void OnPlayInterrupted(void) = 0;
index 2721f32..ac86f84 100644 (file)
 #ifndef _VP_TYPES_H_
 #define _VP_TYPES_H_
 
+enum RepeatType
+{
+       REPEAT_TYPE_OFF = 0,
+       REPEAT_TYPE_ONE,
+       REPEAT_TYPE_ALL
+};
+
 enum ActionId
 {
        IDA_BUTTON_CHECK1ST_CHECKED = 101,
@@ -35,19 +42,28 @@ enum ActionId
        IDA_BUTTON_FASTREWIND = 204,
        IDA_BUTTON_FASTFORWARD = 205,
        IDA_BUTTON_SOUNDPATH = 206,
-       IDA_BUTTON_BACK = 207,
+       IDA_BUTTON_SHARE = 207,
+       IDA_BUTTON_REPEATMODE = 208,
+       IDA_CONTEXTMENU_MESSAGE = 209,
+       IDA_CONTEXTMENU_EMAIL = 210,
+       IDA_BUTTON_BACK = 211,
 };
 
 extern const wchar_t* IDSCN_VIDEO_PLAYER;
 
 extern const wchar_t* IDC_VIDEO_PLAYER_FORM;
 
+extern const wchar_t* APPCONTROL_PROVIDER_ID_MESSAGE;
+extern const wchar_t* APPCONTROL_PROVIDER_ID_EMAIL;
+
 extern const wchar_t* APPCONTROL_OPERATION_ID_PLAY;
 extern const wchar_t* APPCONTROL_OPERATION_ID_VIEW;
 extern const wchar_t* APPCONTROL_OPERATION_ID_CONFIGURE;
 extern const wchar_t* APPCONTROL_OPERATION_ID_MAIN;
+extern const wchar_t* APPCONTROL_OPERATION_ID_COMPOSE;
 
 extern const wchar_t* APPCONTROL_KEY_PATH;
+extern const wchar_t* APPCONTROL_KEY_ATTACHMENTS;
 extern const wchar_t* APPCONTROL_KEY_LEGACY_RESULT;
 
 extern const wchar_t* IDS_COM_HEADER_AUDIO_DEVICE_ABB;
@@ -60,10 +76,12 @@ extern const wchar_t* IDS_VPL_POP_UNABLE_TO_PLAY_VIDEO_ERROR_OCCURRED;
 extern const wchar_t* IDC_PANEL_HEADER;
 extern const wchar_t* IDC_PANEL_FUNCTION;
 extern const wchar_t* IDC_PANEL_CONTROLLER;
+extern const wchar_t* IDC_BUTTON_REPEATMODE;
 extern const wchar_t* IDC_BUTTON_PLAY;
 extern const wchar_t* IDC_BUTTON_FASTREWIND;
 extern const wchar_t* IDC_BUTTON_FASTFORWARD;
 extern const wchar_t* IDC_BUTTON_BACK;
+extern const wchar_t* IDC_BUTTON_SHARE;
 extern const wchar_t* IDC_BUTTON_SCREENMODE;
 extern const wchar_t* IDC_LABEL_CURRENTTIME;
 extern const wchar_t* IDC_LABEL_FULLTIME;
index 3208aa2..3d6244b 100644 (file)
@@ -35,6 +35,7 @@ class VideoPlayerPresentationModel;
 
 class VideoPlayerForm
        : public Tizen::Ui::Controls::Form
+       , public Tizen::App::IAppControlResponseListener
        , public Tizen::Base::Runtime::ITimerEventListener
        , public Tizen::Media::IAudioRouteEventListener
        , public Tizen::Ui::IActionEventListener
@@ -60,6 +61,10 @@ public:
        virtual result OnInitializing(void);
        virtual result OnTerminating(void);
 
+       virtual void OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId,
+                               const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult,
+                               const Tizen::Base::Collection::IMap* pExtraData);
+
        virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
 
        virtual void OnActiveAudioRouteChanged(const Tizen::Media::AudioRouteInfo& route);
@@ -98,7 +103,7 @@ public:
                        const Tizen::Ui::Scenes::SceneId& nextSceneId);
 
        virtual void OnPlayOpened(result r);
-       virtual void OnPlayEndOfClip(bool playNextContent);
+       virtual void OnPlayEndOfClip(bool playNextContent, int repeatMode);
        virtual void OnPlayBuffering(int percent);
        virtual void OnPlayErrorOccurred(Tizen::Media::PlayerErrorReason r);
        virtual void OnPlayInterrupted(void);
@@ -147,6 +152,7 @@ private:
        void GetTotalTime(Tizen::Base::String& totalTime);
        void PlayerSoundPathPopupInit(void);
        result SetPlayPauseButtonImage(Tizen::Media::PlayerState playState);
+       void SetRepeatButtonImage(int repeatValue);
        void CreateMessageBox(const Tizen::Base::String& title, const Tizen::Base::String& message,
                        Tizen::Ui::Controls::MessageBoxStyle style = Tizen::Ui::Controls::MSGBOX_STYLE_OK,
                        unsigned long timeout = 0);
@@ -168,11 +174,14 @@ private:
        Tizen::Ui::Controls::Button* __pFastForwardButton;
        Tizen::Ui::Controls::Button* __pFastRewindButton;
        Tizen::Ui::Controls::Button* __pBackButton;
+       Tizen::Ui::Controls::Button* __pShareButton;
        Tizen::Ui::Controls::Button* __pScreenModeButton;
+       Tizen::Ui::Controls::Button* __pRepeatModeButton;
        Tizen::Ui::Controls::Label* __pHeaderTitle;
        Tizen::Ui::Controls::Label* __pCurrenTimeLabel;
        Tizen::Ui::Controls::Label* __pTotalTimeLabel;
        Tizen::Ui::Controls::Slider* __pSlider;
+       Tizen::Ui::Controls::ContextMenu* __pContextMenuShare;
        bool __actionTouchLongPressed;
        bool __setPauseState;
        bool __isControlVisibleState;
index 0bb8141..67c5028 100644 (file)
@@ -53,6 +53,9 @@ public:
        long GetDuration(void) const;
        long GetPosition(void) const;
        result SeekTo(long msTime);
+       int GetRepeatMode(void);
+       void SetRepeatMode(int repeatMode);
+       void ChangeCurrentMediaIndex(void);
 
        void SetVideoPlayerEventListener(IVideoPlayerEventListener* pPlayerListener);
        void SetOverlayPanel(Tizen::Ui::Controls::OverlayPanel* pOverlay);
@@ -116,6 +119,7 @@ private:
        int __currentMediaIndex;
        int __nextMediaIndex;
        int __previousMediaIndex;
+       int __repeatMode;
 };
 
 #endif // _VP_VIDEO_PLAYER_PRESENTATION_MODEL_H_
\ No newline at end of file
index 66eeafb..d2a6e81 100644 (file)
@@ -9,6 +9,7 @@
         <Secret/>
         <Privileges>
             <Privilege>http://tizen.org/privilege/alarm</Privilege>
+            <Privilege>http://tizen.org/privilege/application.launch</Privilege>
             <Privilege>http://tizen.org/privilege/power</Privilege>
             <Privilege>http://tizen.org/privilege/setting</Privilege>
             <Privilege>http://tizen.org/privilege/audiomanager.route</Privilege>
index afceb07..27586a0 100644 (file)
         <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="30" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0" marginLeft="0" marginRight="34" marginTop="30" mode="Landscape" rightRelation="IDC_PANEL_CONTROLLER" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDC_PANEL_CONTROLLER" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="130" x="1116" y="30"/>\r
     </Label>\r
     <Slider id="IDC_SLIDER" parent="IDC_PANEL_CONTROLLER">\r
-        <property backgroundColor="" backgroundStyle="BACKGROUND_STYLE_NONE" barColor="" color="" colorOfTitleText="" colorOpacity="100" disabledThumbBitmap="" disabledThumbTextColor="" groupStyle="GROUP_STYLE_NONE" highlightedThumbBitmap="" highlightedThumbTextColor="" leftIconBitmapPath="" max="999" min="0" normalThumbBitmap="" normalThumbTextColor="" pressedThumbBitmap="" pressedThumbTextColor="" rightIconBitmapPath="" showTitleText="false" titleText="" value="500"/>\r
+        <property backgroundColor="" backgroundStyle="BACKGROUND_STYLE_NONE" barColor="" color="#292929" colorOfTitleText="" colorOpacity="100" disabledThumbBitmap="" disabledThumbTextColor="" highlightedThumbBitmap="" highlightedThumbTextColor="" leftIconBitmapPath="" max="100" min="0" normalThumbBitmap="" normalThumbTextColor="" pressedThumbBitmap="" pressedThumbTextColor="" rightIconBitmapPath="" showTitleText="false" sliderStyleBubble="false" sliderStyleTitle="false" titleText="" value="0"/>\r
         <layout bottomRelation="IDC_LABEL_CURRENTTIME" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_TOP" centerHorizontal="false" centerVertical="false" height="90" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDC_PANEL_CONTROLLER" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0" marginLeft="26" marginRight="26" marginTop="0" mode="Portrait" rightRelation="IDC_PANEL_CONTROLLER" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="668" x="26" y="80"/>\r
         <layout bottomRelation="IDC_BUTTON_PLAY" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_TOP" centerHorizontal="false" centerVertical="false" height="92" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDC_LABEL_CURRENTTIME" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_RIGHT" marginBottom="0" marginLeft="22" marginRight="22" marginTop="0" mode="Landscape" rightRelation="IDC_LABEL_FULLTIME" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_LEFT" topRelation="IDC_PANEL_CONTROLLER" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="908" x="186" y="0"/>\r
     </Slider>\r
-    <Button id="IDC_BUTTON_MULTIWINDOW" parent="IDC_PANEL_CONTROLLER">\r
+    <Button id="IDC_BUTTON_REPEATMODE" parent="IDC_PANEL_CONTROLLER">\r
         <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBGBitmapPath="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedBitmapPath="" highlightedBitmapX="0" highlightedBitmapY="0" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="T01-2_control_circle_button_03.png" normalBitmapPath="T01-2_function_icon_repeat.png" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="T01-2_control_circle_button_03_press.png" pressedBitmapPath="T01-2_function_icon_repeat_press.png" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="" textSize="32" verticalAlign="ALIGN_MIDDLE"/>\r
         <layout bottomRelation="IDC_SLIDER" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_TOP" centerHorizontal="false" centerVertical="false" height="70" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0" marginLeft="0" marginRight="26" marginTop="10" mode="Portrait" rightRelation="IDC_PANEL_CONTROLLER" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDC_PANEL_CONTROLLER" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="70" x="624" y="10"/>\r
         <layout bottomRelation="IDC_PANEL_CONTROLLER" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="70" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_RIGHT" marginBottom="31" marginLeft="42" marginRight="0" marginTop="0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="70" x="1009" y="129"/>\r
     </Panel>\r
     <Button id="IDC_BUTTON_SHARE" parent="IDC_PANEL_FUNCTION">\r
         <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBGBitmapPath="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedBitmapPath="" highlightedBitmapX="0" highlightedBitmapY="0" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="T01-2_control_circle_button_03.png" normalBitmapPath="T01-2_function_icon_share.png" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="T01-2_control_circle_button_03_press.png" pressedBitmapPath="T01-2_function_icon_share_press.png" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="" textSize="32" verticalAlign="ALIGN_MIDDLE"/>\r
-        <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="70" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0" marginLeft="0" marginRight="0" marginTop="0" mode="Portrait" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="70" x="26" y="0"/>\r
+        <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="70" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDC_PANEL_FUNCTION" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0" marginLeft="0" marginRight="0" marginTop="0" mode="Portrait" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="70" x="0" y="0"/>\r
         <layout bottomRelation="IDC_PANEL_FUNCTION" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="70" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDC_PANEL_FUNCTION" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0" marginLeft="0" marginRight="0" marginTop="0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="IDC_PANEL_FUNCTION" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="70" x="0" y="0"/>\r
     </Button>\r
     <Button id="IDC_BUTTON_SCREENMODE" parent="IDC_PANEL_FUNCTION">\r
         <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBGBitmapPath="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedBitmapPath="" highlightedBitmapX="0" highlightedBitmapY="0" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="T01-2_control_circle_button_03.png" normalBitmapPath="T01-2_function_icon_screenmode.png" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="T01-2_control_circle_button_03_press.png" pressedBitmapPath="T01-2_Function_icon_screenmode_press.png" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="" textSize="32" verticalAlign="ALIGN_MIDDLE"/>\r
-        <layout bottomRelation="IDC_PANEL_FUNCTION" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="70" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0" marginLeft="0" marginRight="26" marginTop="0" mode="Portrait" rightRelation="IDC_PANEL_FUNCTION" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="70" x="572" y="0"/>\r
+        <layout bottomRelation="IDC_PANEL_FUNCTION" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="70" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0" marginLeft="0" marginRight="0" marginTop="0" mode="Portrait" rightRelation="IDC_PANEL_FUNCTION" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="70" x="598" y="0"/>\r
         <layout bottomRelation="IDC_PANEL_FUNCTION" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="70" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0" marginLeft="0" marginRight="0" marginTop="0" mode="Landscape" rightRelation="IDC_PANEL_FUNCTION" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDC_PANEL_FUNCTION" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="70" x="1158" y="0"/>\r
     </Button>\r
 </Scene>\r
index 14d4d7b..11026e2 100644 (file)
 const wchar_t* IDSCN_VIDEO_PLAYER = L"VideoPlayer";
 const wchar_t* IDC_VIDEO_PLAYER_FORM = L"VideoPlayerForm";
 
+const wchar_t* APPCONTROL_PROVIDER_ID_MESSAGE = L"tizen.messages";
+const wchar_t* APPCONTROL_PROVIDER_ID_EMAIL = L"tizen.email";
+
 const wchar_t* APPCONTROL_OPERATION_ID_PLAY = L"http://tizen.org/appcontrol/operation/play";
 const wchar_t* APPCONTROL_OPERATION_ID_VIEW = L"http://tizen.org/appcontrol/operation/view";
 const wchar_t* APPCONTROL_OPERATION_ID_CONFIGURE = L"http://tizen.org/appcontrol/operation/configure";
 const wchar_t* APPCONTROL_OPERATION_ID_MAIN = L"http://tizen.org/appcontrol/operation/main";
+const wchar_t* APPCONTROL_OPERATION_ID_COMPOSE = L"http://tizen.org/appcontrol/operation/compose";
 
 const wchar_t* APPCONTROL_KEY_PATH = L"path";
+const wchar_t* APPCONTROL_KEY_ATTACHMENTS = L"attachments";
 const wchar_t* APPCONTROL_KEY_LEGACY_RESULT = L"http://tizen.org/appcontrol/data/legacyresult";
 
 const wchar_t* IDS_COM_HEADER_AUDIO_DEVICE_ABB = L"IDS_COM_HEADER_AUDIO_DEVICE_ABB";
@@ -42,10 +47,12 @@ const wchar_t* IDS_VPL_POP_UNABLE_TO_PLAY_VIDEO_ERROR_OCCURRED = L"IDS_VPL_POP_U
 const wchar_t* IDC_PANEL_HEADER = L"IDC_PANEL_HEADER";
 const wchar_t* IDC_PANEL_FUNCTION = L"IDC_PANEL_FUNCTION";
 const wchar_t* IDC_PANEL_CONTROLLER = L"IDC_PANEL_CONTROLLER";
+const wchar_t* IDC_BUTTON_REPEATMODE = L"IDC_BUTTON_REPEATMODE";
 const wchar_t* IDC_BUTTON_PLAY = L"IDC_BUTTON_PLAY";
 const wchar_t* IDC_BUTTON_FASTREWIND = L"IDC_BUTTON_FASTREWIND";
 const wchar_t* IDC_BUTTON_FASTFORWARD = L"IDC_BUTTON_FASTFORWARD";
 const wchar_t* IDC_BUTTON_BACK = L"IDC_BUTTON_BACK";
+const wchar_t* IDC_BUTTON_SHARE = L"IDC_BUTTON_SHARE";
 const wchar_t* IDC_BUTTON_SCREENMODE = L"IDC_BUTTON_SCREENMODE";
 const wchar_t* IDC_LABEL_CURRENTTIME = L"IDC_LABEL_CURRENTTIME";
 const wchar_t* IDC_LABEL_FULLTIME = L"IDC_LABEL_FULLTIME";
index 2ed4c15..eb9c74d 100644 (file)
@@ -90,11 +90,14 @@ VideoPlayerForm::VideoPlayerForm(void)
        , __pFastForwardButton(null)
        , __pFastRewindButton(null)
        , __pBackButton(null)
+       , __pShareButton(null)
        , __pScreenModeButton(null)
+       , __pRepeatModeButton(null)
        , __pHeaderTitle(null)
        , __pCurrenTimeLabel(null)
        , __pTotalTimeLabel(null)
        , __pSlider(null)
+       , __pContextMenuShare(null)
        , __actionTouchLongPressed(false)
        , __setPauseState(false)
        , __isControlVisibleState(true)
@@ -370,6 +373,12 @@ VideoPlayerForm::InitializeFuncPanel(void)
        __pScreenModeButton->AddActionEventListener(*this);
        __pScreenModeButton->AddTouchEventListener(*this);
 
+       __pShareButton = static_cast<Button*>(__pFunctionPanel->GetControl(IDC_BUTTON_SHARE));
+       TryCatch(__pShareButton != null, r = E_SYSTEM, "__pShareButton is null");
+       __pShareButton->SetActionId(IDA_BUTTON_SHARE);
+       __pShareButton->AddActionEventListener(*this);
+       __pShareButton->AddTouchEventListener(*this);
+
        return E_SUCCESS;
 
 CATCH:
@@ -392,6 +401,12 @@ VideoPlayerForm::InitializeController(void)
        __pControllerPanel = static_cast<Panel*>(GetControl(IDC_PANEL_CONTROLLER));
        TryCatch(__pControllerPanel != null, r = E_SYSTEM, "__pControllerPanel is null");
 
+       __pRepeatModeButton = static_cast<Button*>(__pControllerPanel->GetControl(IDC_BUTTON_REPEATMODE));
+       TryCatch(__pRepeatModeButton != null, r = E_SYSTEM, "__pRepeatModeButton is null");
+       __pRepeatModeButton->SetActionId(IDA_BUTTON_REPEATMODE);
+       __pRepeatModeButton->AddActionEventListener(*this);
+       __pRepeatModeButton->AddTouchEventListener(*this);
+
        __pPlayPauseButton = static_cast<Button*>(__pControllerPanel->GetControl(IDC_BUTTON_PLAY));
        TryCatch(__pPlayPauseButton != null, r = E_SYSTEM, "__pPlayPauseButton is null");
        __pPlayPauseButton->SetActionId(IDA_BUTTON_PLAY);
@@ -472,6 +487,9 @@ VideoPlayerForm::OnTerminating(void)
        delete __pSoundPathPopup;
        __pSoundPathPopup = null;
 
+       delete __pContextMenuShare;
+       __pContextMenuShare = null;
+
        return E_SUCCESS;
 }
 
@@ -539,12 +557,14 @@ VideoPlayerForm::OnPlayOpened(result r)
 }
 
 void
-VideoPlayerForm::OnPlayEndOfClip(bool playNextContent)
+VideoPlayerForm::OnPlayEndOfClip(bool playNextContent, int repeatMode)
 {
        result r = E_FAILURE;
 
+       Rectangle rect;
        Point point(X_BASE, Y_BASE);
        Bitmap* pPlayBitmap = null;
+       Bitmap* pBitmapScreenMode = null;
 
        AppLogDebug("OnPlayEndOfClip : %d", playNextContent);
 
@@ -579,34 +599,160 @@ VideoPlayerForm::OnPlayEndOfClip(bool playNextContent)
                __pScreenModeButton->SetShowState(false);
        }
 
-       if (playNextContent == true)
+       switch (repeatMode)
        {
-               SetScreenMode(SCREEN_MODE_NORMAL, true);
-               __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
-               __pVideoPlayerPresentationModel->InitializePlayer();
+       case REPEAT_TYPE_OFF:
+               {
+                       if (playNextContent == true)
+                       {
+                               SetScreenMode(SCREEN_MODE_NORMAL, true);
+                               __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
 
-               if (__pScreenModeButton->GetShowState() == false)
+                               r = __pVideoPlayerPresentationModel->StartPlay();
+                               TryCatch(r == E_SUCCESS, , "__pVideoPlayerPresentationModel->StartPlay() Failed:%s", GetErrorMessage(r));
+
+                               String mediaPathName = __pVideoPlayerPresentationModel->GetMediaPathName();
+                               rect = __pVideoPlayerPresentationModel->GetVideoInfoN(mediaPathName);
+
+                               if (rect.width > W_NORMAL || rect.height > W_NORMAL)
+                               {
+                                       pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_function_icon_screenmode03.png");
+                                       __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+                                       pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_function_icon_screenmode03_press.png");
+                                       __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+                               }
+                               else
+                               {
+                                       pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_Function_icon_screenmode_press.png");
+                                       __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+                                       pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_Function_icon_screenmode_press.png");
+                                       __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+                               }
+
+                               __pSlider->SetEnabled(true);
+
+                               if (__pScreenModeButton->GetShowState() == false)
+                               {
+                                       __pScreenModeButton->SetShowState(true);
+                               }
+
+                               r = PowerManager::KeepScreenOnState(true, false);
+                               TryCatch(r == E_SUCCESS, , "PowerManager::KeepScreenOnState() failed:%s", GetErrorMessage(r));
+                       }
+                       else
+                       {
+                               r = PowerManager::KeepScreenOnState(false);
+                               TryCatch(r == E_SUCCESS, , "PowerManager::KeepScreenOnState() failed:%s", GetErrorMessage(r));
+                       }
+               }
+               break;
+
+       case REPEAT_TYPE_ONE:
                {
-                       __pScreenModeButton->SetShowState(true);
+                       r = __pVideoPlayerPresentationModel->StartPlay();
+                       TryCatch(r == E_SUCCESS, , "__pVideoPlayerPresentationModel->StartPlay() Failed:%s", GetErrorMessage(r));
+
+                       __pSlider->SetEnabled(true);
+
+                       if (__pScreenModeButton->GetShowState() == false)
+                       {
+                               __pScreenModeButton->SetShowState(true);
+                       }
+
+                       r = PowerManager::KeepScreenOnState(true, false);
+                       TryCatch(r == E_SUCCESS, , "PowerManager::KeepScreenOnState() failed:%s", GetErrorMessage(r));
                }
+               break;
 
-               __pSlider->SetEnabled(true);
+       case REPEAT_TYPE_ALL:
+               {
+                       if (playNextContent == true)
+                       {
+                               SetScreenMode(SCREEN_MODE_NORMAL, true);
+                               __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
 
-               r = __pVideoPlayerPresentationModel->StartPlay();
-               TryCatch(r == E_SUCCESS, , "__pVideoPlayerPresentationModel->StartPlay() Failed:%s", GetErrorMessage(r));
+                               r = __pVideoPlayerPresentationModel->StartPlay();
+                               TryCatch(r == E_SUCCESS, , "__pVideoPlayerPresentationModel->StartPlay() Failed:%s", GetErrorMessage(r));
 
-               r = PowerManager::KeepScreenOnState(true, false);
-               TryCatch(r == E_SUCCESS, , "PowerManager::KeepScreenOnState() failed:%s", GetErrorMessage(r));
-       }
-       else
-       {
-               r = PowerManager::KeepScreenOnState(false);
-               TryCatch(r == E_SUCCESS, , "PowerManager::KeepScreenOnState() failed:%s", GetErrorMessage(r));
+                               String mediaPathName = __pVideoPlayerPresentationModel->GetMediaPathName();
+                               rect = __pVideoPlayerPresentationModel->GetVideoInfoN(mediaPathName);
+
+                               if (rect.width > W_NORMAL || rect.height > W_NORMAL)
+                               {
+                                       pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_function_icon_screenmode03.png");
+                                       __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+                                       pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_function_icon_screenmode03_press.png");
+                                       __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+                               }
+                               else
+                               {
+                                       pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_Function_icon_screenmode_press.png");
+                                       __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+                                       pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_Function_icon_screenmode_press.png");
+                                       __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+                               }
+
+                               __pSlider->SetEnabled(true);
+
+                               if (__pScreenModeButton->GetShowState() == false)
+                               {
+                                       __pScreenModeButton->SetShowState(true);
+                               }
+
+                               r = PowerManager::KeepScreenOnState(true, false);
+                               TryCatch(r == E_SUCCESS, , "PowerManager::KeepScreenOnState() failed:%s", GetErrorMessage(r));
+                       }
+                       else
+                       {
+                               if (__pVideoPlayerPresentationModel->GetMediaCount() >= 2)
+                               {
+                                       SetScreenMode(SCREEN_MODE_NORMAL, true);
+                                       __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
+                               }
+
+                               r = __pVideoPlayerPresentationModel->StartPlay();
+                               TryCatch(r == E_SUCCESS, , "__pVideoPlayerPresentationModel->StartPlay() Failed:%s", GetErrorMessage(r));
+
+                               String mediaPathName = __pVideoPlayerPresentationModel->GetMediaPathName();
+                               rect = __pVideoPlayerPresentationModel->GetVideoInfoN(mediaPathName);
+
+                               if (rect.width > W_NORMAL || rect.height > W_NORMAL)
+                               {
+                                       pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_function_icon_screenmode03.png");
+                                       __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+                                       pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_function_icon_screenmode03_press.png");
+                                       __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+                               }
+                               else
+                               {
+                                       pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_Function_icon_screenmode_press.png");
+                                       __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+                                       pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_Function_icon_screenmode_press.png");
+                                       __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+                               }
+
+                               __pSlider->SetEnabled(true);
+
+                               if (__pScreenModeButton->GetShowState() == false)
+                               {
+                                       __pScreenModeButton->SetShowState(true);
+                               }
+
+                               r = PowerManager::KeepScreenOnState(true, false);
+                               TryCatch(r == E_SUCCESS, , "PowerManager::KeepScreenOnState() failed:%s", GetErrorMessage(r));
+                       }
+               }
+               break;
+
+       default:
+               break;
        }
 
 CATCH:
        delete pPlayBitmap;
        pPlayBitmap = null;
+       delete pBitmapScreenMode;
+       pBitmapScreenMode = null;
 }
 
 void
@@ -702,14 +848,20 @@ VideoPlayerForm::OnActionPerformed(const Control& source, int actionId)
                {
                        __setPauseState = false;
 
-                       if ((__pVideoPlayerPresentationModel->GetState() == PLAYER_STATE_ENDOFCLIP))
+                       if (playState == PLAYER_STATE_ENDOFCLIP)
                        {
-                               if (__pVideoPlayerPresentationModel->GetCurrentMediaIndex() != __pVideoPlayerPresentationModel->GetPreviousMediaIndex())
+                               if (__pVideoPlayerPresentationModel->GetCurrentMediaIndex() < __pVideoPlayerPresentationModel->GetPreviousMediaIndex())
                                {
-                                       SetScreenMode(SCREEN_MODE_NORMAL, true);
-                                       __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
+                                       if (__pVideoPlayerPresentationModel->GetRepeatMode() == REPEAT_TYPE_ONE)
+                                       {
+                                               __pVideoPlayerPresentationModel->ChangeCurrentMediaIndex();
+                                       }
+                                       else
+                                       {
+                                               SetScreenMode(SCREEN_MODE_NORMAL, true);
+                                               __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
+                                       }
                                }
-                               __pVideoPlayerPresentationModel->InitializePlayer();
                        }
 
                        r = __pVideoPlayerPresentationModel->StartPlay();
@@ -721,6 +873,21 @@ VideoPlayerForm::OnActionPerformed(const Control& source, int actionId)
                        rect = __pVideoPlayerPresentationModel->GetVideoInfoN(
                                        __pVideoPlayerPresentationModel->GetMediaPathName());
 
+                       if (rect.width > W_NORMAL || rect.height > W_NORMAL)
+                       {
+                               pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_function_icon_screenmode03.png");
+                               __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+                               pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_function_icon_screenmode03_press.png");
+                               __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+                       }
+                       else
+                       {
+                               pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_Function_icon_screenmode_press.png");
+                               __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+                               pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_Function_icon_screenmode_press.png");
+                               __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+                       }
+
                        if (__pScreenModeButton->GetShowState() == false)
                        {
                                __pScreenModeButton->SetShowState(true);
@@ -902,6 +1069,122 @@ VideoPlayerForm::OnActionPerformed(const Control& source, int actionId)
                }
                break;
 
+       case IDA_BUTTON_SHARE:
+               {
+                       Point point((((GetClientAreaBounds().width - __pFunctionPanel->GetBounds().width) / DIVIDE_BY_TWO)
+                                       + (__pShareButton->GetBounds().width / DIVIDE_BY_TWO)),
+                                       __pFunctionPanel->GetBounds().y + __pFunctionPanel->GetBounds().height);
+
+                       if (__pContextMenuShare != null)
+                       {
+                               delete __pContextMenuShare;
+                               __pContextMenuShare = null;
+                       }
+
+                       __pContextMenuShare = new (std::nothrow) ContextMenu();
+                       r = __pContextMenuShare->Construct(point, CONTEXT_MENU_STYLE_LIST, CONTEXT_MENU_ANCHOR_DIRECTION_DOWNWARD);
+                       TryCatch(r == E_SUCCESS, , "__pContextMenuShare->Construct() failed:%s", GetErrorMessage(r));
+
+                       __pContextMenuShare->AddItem(L"Message", IDA_CONTEXTMENU_MESSAGE);
+                       __pContextMenuShare->AddItem(L"Email", IDA_CONTEXTMENU_EMAIL);
+                       __pContextMenuShare->AddActionEventListener(*this);
+                       __pContextMenuShare->SetShowState(true);
+                       __pContextMenuShare->Show();
+
+                       if (playState == PLAYER_STATE_PLAYING)
+                       {
+                               __pUiControlTimer->Start(SHOW_CONTROL_DURATION);
+                       }
+               }
+               break;
+
+       case IDA_CONTEXTMENU_MESSAGE:
+               {
+                       AppControl* pAppControl = AppManager::FindAppControlN(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE);
+                       if (pAppControl == null)
+                       {
+                               return;
+                       }
+
+                       HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
+                       pDataList->Construct();
+
+                       String mediaPathName = __pVideoPlayerPresentationModel->GetMediaPathName();
+                       pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS),
+                                               new (std::nothrow) String(mediaPathName));
+                       AppLogDebug("AppControl Data : %ls", mediaPathName.GetPointer());
+
+                       pAppControl->Start(null, null, pDataList, this);
+
+                       if (pAppControl != null)
+                       {
+                               delete pAppControl;
+                               pAppControl = null;
+                       }
+               }
+               break;
+
+       case IDA_CONTEXTMENU_EMAIL:
+               {
+                       AppControl* pAppControl = AppManager::FindAppControlN(APPCONTROL_PROVIDER_ID_EMAIL, APPCONTROL_OPERATION_ID_COMPOSE);
+                       if (pAppControl == null)
+                       {
+                               return;
+                       }
+
+                       HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
+                       pDataList->Construct();
+
+                       String mediaPathName = __pVideoPlayerPresentationModel->GetMediaPathName();
+                       pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS),
+                                               new (std::nothrow) String(mediaPathName));
+                       AppLogDebug("AppControl Data : %ls", mediaPathName.GetPointer());
+
+                       pAppControl->Start(null, null, pDataList, this);
+
+                       if (pAppControl != null)
+                       {
+                               delete pAppControl;
+                               pAppControl = null;
+                       }
+               }
+               break;
+
+       case IDA_BUTTON_REPEATMODE:
+               {
+                       int repeatMode = __pVideoPlayerPresentationModel->GetRepeatMode();
+
+                       switch (repeatMode)
+                       {
+                       case REPEAT_TYPE_OFF:
+                               {
+                                       SetRepeatButtonImage(REPEAT_TYPE_ONE);
+                               }
+                               break;
+
+                       case REPEAT_TYPE_ONE:
+                               {
+                                       SetRepeatButtonImage(REPEAT_TYPE_ALL);
+                               }
+                               break;
+
+                       case REPEAT_TYPE_ALL:
+                               {
+                                       SetRepeatButtonImage(REPEAT_TYPE_OFF);
+                               }
+                               break;
+
+                       default:
+                               break;
+                       }
+
+                       if (playState == PLAYER_STATE_PLAYING)
+                       {
+                               __pUiControlTimer->Start(SHOW_CONTROL_DURATION);
+                       }
+               }
+               break;
+
        case IDA_BUTTON_BACK:
                {
                        Application::GetInstance()->Terminate();
@@ -1147,6 +1430,51 @@ CATCH:
 }
 
 void
+VideoPlayerForm::SetRepeatButtonImage(int repeatValue)
+{
+       AppLogDebug("SetRepeatButtonImage");
+       Bitmap* pRepeatBitmap = null;
+       Bitmap* pRepeatPressBitmap = null;
+
+       AppResource* pAppResource = Application::GetInstance()->GetAppResource();
+
+       switch (repeatValue)
+       {
+       case REPEAT_TYPE_OFF:
+               {
+                       pRepeatBitmap = pAppResource->GetBitmapN(L"T01-2_function_icon_repeat.png");
+                       pRepeatPressBitmap = pAppResource->GetBitmapN(L"T01-2_function_icon_repeat_press.png");
+               }
+               break;
+
+       case REPEAT_TYPE_ONE:
+               {
+                       pRepeatBitmap = pAppResource->GetBitmapN(L"T01-2_function_icon_repeat_1.png");
+                       pRepeatPressBitmap = pAppResource->GetBitmapN(L"T01-2_function_icon_repeat_1_press.png");
+               }
+               break;
+
+       case REPEAT_TYPE_ALL:
+               {
+                       pRepeatBitmap = pAppResource->GetBitmapN(L"T01-2_function_icon_repeat_all.png");
+                       pRepeatPressBitmap = pAppResource->GetBitmapN(L"T01-2_function_icon_repeat_all_press.png");
+               }
+               break;
+
+       default:
+               break;
+       }
+       __pRepeatModeButton->SetNormalBitmap(Point(X_BASE, Y_BASE), *pRepeatBitmap);
+       __pRepeatModeButton->SetPressedBitmap(Point(X_BASE, Y_BASE), *pRepeatPressBitmap);
+       __pVideoPlayerPresentationModel->SetRepeatMode(repeatValue);
+
+       delete pRepeatBitmap;
+       pRepeatBitmap = null;
+       delete pRepeatPressBitmap;
+       pRepeatPressBitmap = null;
+}
+
+void
 VideoPlayerForm::GetTotalTime(String& totalTime)
 {
        result r = E_FAILURE;
@@ -1225,6 +1553,15 @@ VideoPlayerForm::ShowControl(bool setShow)
                __pHeaderPanel->SetShowState(false);
                __pFunctionPanel->SetShowState(false);
                __pControllerPanel->SetShowState(false);
+
+               if (__pContextMenuShare != null)
+               {
+                       if (__pContextMenuShare->GetShowState() == true)
+                       {
+                               __pContextMenuShare->SetShowState(false);
+                       }
+               }
+
                __isControlVisibleState = false;
        }
 }
@@ -1260,6 +1597,7 @@ VideoPlayerForm::OnPlayContentChanged(const String& fileName)
        GetTotalTime(totalTime);
 
        __pHeaderTitle->SetText(fileName);
+       __pHeaderTitle->Invalidate(true);
 
        __pTotalTimeLabel->SetText(totalTime);
        __pTotalTimeLabel->Invalidate(true);
@@ -1832,6 +2170,7 @@ void
 VideoPlayerForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
 {
        BatteryLevel batteryLevel;
+       bool isCharging = false;
 
        AppLogDebug("OnUserEventReceivedN");
 
@@ -1840,10 +2179,14 @@ VideoPlayerForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
        case REQUEST_VIDEO_EVENT_BATTERY_LEVEL_CHANGED:
                {
                        Battery::GetCurrentLevel(batteryLevel);
+                       Battery::IsCharging(isCharging);
 
                        if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
                        {
-                               OnFormBackRequested(*this);
+                               if (isCharging == false)
+                               {
+                                       OnFormBackRequested(*this);
+                               }
                        }
                }
                break;
@@ -1851,4 +2194,11 @@ VideoPlayerForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
        default:
                break;
        }
+}
+
+void
+VideoPlayerForm::OnAppControlCompleteResponseReceived(const AppId& appId, const Tizen::Base::String& operationId,
+                       AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData)
+{
+       AppLogDebug("OnAppControlCompleteResponseReceived : %d", appControlResult);
 }
\ No newline at end of file
index c4d59b2..e5204aa 100644 (file)
@@ -67,6 +67,7 @@ VideoPlayerPresentationModel::VideoPlayerPresentationModel(void)
        , __currentMediaIndex(INIT_CONTENT_INDEX)
        , __nextMediaIndex(INIT_CONTENT_INDEX)
        , __previousMediaIndex(INIT_CONTENT_INDEX)
+       , __repeatMode(REPEAT_TYPE_OFF)
 {
 }
 
@@ -345,22 +346,19 @@ result
 VideoPlayerPresentationModel::StartPlay(void)
 {
        result r = E_FAILURE;
+       String mediaPath;
+       String mediaName;
+       String delim = L"/";
 
        PlayerState playState = __pPlayer->GetState();
        AppLogDebug("StartPlay : %d", playState);
 
        switch (playState)
        {
-       case PLAYER_STATE_ENDOFCLIP:
-               // fall through
        case PLAYER_STATE_INITIALIZED:
                // fall through
        case PLAYER_STATE_CLOSED:
                {
-                       String mediaPath;
-                       String mediaName;
-                       String delim = L"/";
-
                        mediaPath = GetMediaPathName();
 
                        StringTokenizer strTok(mediaPath, delim);
@@ -431,6 +429,48 @@ VideoPlayerPresentationModel::StartPlay(void)
                }
                break;
 
+       case PLAYER_STATE_ENDOFCLIP:
+               {
+                       if (__pMediaPathArrayList->GetCount() < MULTI_CONTENT_COUNT)
+                       {
+                               r = __pPlayer->Play();
+                               TryCatch(r == E_SUCCESS, , "__pPlayer->Play() failed:%s", GetErrorMessage(r));
+                       }
+                       else
+                       {
+                               mediaPath = GetMediaPathName();
+                               StringTokenizer strTok(mediaPath, delim);
+
+                               while (strTok.HasMoreTokens())
+                               {
+                                       strTok.GetNextToken(mediaName);
+                               }
+
+                               if (GetRepeatMode() != REPEAT_TYPE_ONE)
+                               {
+                                       InitializePlayer();
+
+                                       r = __pPlayer->OpenFile(mediaPath);
+                                       TryCatch(r == E_SUCCESS, , "__pPlayer->OpenFile() failed:%s", GetErrorMessage(r));
+                               }
+
+                               r = __pPlayer->Play();
+                               TryCatch(r == E_SUCCESS, , "__pPlayer->Play() failed:%s", GetErrorMessage(r));
+
+                               mediaName.Append(L"(");
+                               mediaName.Append(__currentMediaIndex + 1);
+                               mediaName.Append(L"/");
+                               mediaName.Append(__pMediaPathArrayList->GetCount());
+                               mediaName.Append(L")");
+
+                               CallOnPlayContentChanged(mediaName);
+                       }
+
+                       r = __pTimer->Start(PROGRESS_TIMER_DURATION);
+                       TryCatch(r == E_SUCCESS, , "__pTimer->Start() failed:%s", GetErrorMessage(r));
+               }
+               break;
+
        case PLAYER_STATE_PAUSED:
                {
                        r = __pPlayer->Play();
@@ -586,40 +626,92 @@ VideoPlayerPresentationModel::OnPlayerEndOfClip(void)
        __pFastRewindTimer->Cancel();
 
        __playerSeekCompleted = true;
+       __playerLastSeekCompleted = false;
 
-       if (__pMediaPathArrayList->GetCount() < MULTI_CONTENT_COUNT)
+       switch (GetRepeatMode())
        {
-               __previousMediaIndex = INIT_CONTENT_INDEX;
-               __currentMediaIndex = INIT_CONTENT_INDEX;
-               __nextMediaIndex = INIT_CONTENT_INDEX;
-       }
-       else
-       {
-               if (__currentMediaIndex == __pMediaPathArrayList->GetCount() - 1)
+       case REPEAT_TYPE_OFF:
                {
-                       __previousMediaIndex = __currentMediaIndex;
-                       __currentMediaIndex = INIT_CONTENT_INDEX;
-                       __nextMediaIndex = __currentMediaIndex + 1;
+                       if (__pMediaPathArrayList->GetCount() < MULTI_CONTENT_COUNT)
+                       {
+                               __previousMediaIndex = INIT_CONTENT_INDEX;
+                               __currentMediaIndex = INIT_CONTENT_INDEX;
+                               __nextMediaIndex = INIT_CONTENT_INDEX;
+                       }
+                       else
+                       {
+                               if (__currentMediaIndex == __pMediaPathArrayList->GetCount() - 1)
+                               {
+                                       __previousMediaIndex = __currentMediaIndex;
+                                       __currentMediaIndex = INIT_CONTENT_INDEX;
+                                       __nextMediaIndex = __currentMediaIndex + 1;
+                               }
+                               else
+                               {
+                                       __previousMediaIndex = __currentMediaIndex;
+                                       __currentMediaIndex = __nextMediaIndex;
+                                       __nextMediaIndex = __currentMediaIndex + 1;
+                               }
+                       }
+
+                       if ((__currentMediaIndex > __previousMediaIndex)
+                               && (__currentMediaIndex < __pMediaPathArrayList->GetCount()))
+                       {
+                               playNextContent = true;
+                       }
+                       else
+                       {
+                               playNextContent = false;
+                       }
                }
-               else
+               break;
+
+       case REPEAT_TYPE_ONE:
                {
-                       __previousMediaIndex = __currentMediaIndex;
-                       __currentMediaIndex = __nextMediaIndex;
-                       __nextMediaIndex = __currentMediaIndex + 1;
+                       playNextContent = false;
                }
-       }
+               break;
 
-       if ((__currentMediaIndex > __previousMediaIndex)
-               && (__currentMediaIndex < __pMediaPathArrayList->GetCount()))
-       {
-               playNextContent = true;
-       }
-       else
-       {
-               playNextContent = false;
-       }
+       case REPEAT_TYPE_ALL:
+               {
+                       if (__pMediaPathArrayList->GetCount() < MULTI_CONTENT_COUNT)
+                       {
+                               __previousMediaIndex = INIT_CONTENT_INDEX;
+                               __currentMediaIndex = INIT_CONTENT_INDEX;
+                               __nextMediaIndex = INIT_CONTENT_INDEX;
+                       }
+                       else
+                       {
+                               if (__currentMediaIndex == __pMediaPathArrayList->GetCount() - 1)
+                               {
+                                       __previousMediaIndex = __currentMediaIndex;
+                                       __currentMediaIndex = INIT_CONTENT_INDEX;
+                                       __nextMediaIndex = __currentMediaIndex + 1;
+                               }
+                               else
+                               {
+                                       __previousMediaIndex = __currentMediaIndex;
+                                       __currentMediaIndex = __nextMediaIndex;
+                                       __nextMediaIndex = __currentMediaIndex + 1;
+                               }
+                       }
+
+                       if ((__currentMediaIndex > __previousMediaIndex)
+                               && (__currentMediaIndex < __pMediaPathArrayList->GetCount()))
+                       {
+                               playNextContent = true;
+                       }
+                       else
+                       {
+                               playNextContent = false;
+                       }
+               }
+               break;
 
-       __pVideoPlayerEventListener->OnPlayEndOfClip(playNextContent);
+       default:
+               break;
+       }
+       __pVideoPlayerEventListener->OnPlayEndOfClip(playNextContent, __repeatMode);
 }
 
 void
@@ -1029,4 +1121,24 @@ VideoPlayerPresentationModel::InitializePlayer(void)
        AppLogDebug("__pPlayer [%x]", __pPlayer);
 
        return r;
+}
+
+int
+VideoPlayerPresentationModel::GetRepeatMode(void)
+{
+       return __repeatMode;
+}
+
+void
+VideoPlayerPresentationModel::SetRepeatMode(int repeatMode)
+{
+       __repeatMode = repeatMode;
+}
+
+void
+VideoPlayerPresentationModel::ChangeCurrentMediaIndex(void)
+{
+       __currentMediaIndex = __previousMediaIndex;
+       __previousMediaIndex = __currentMediaIndex - 1;
+       __nextMediaIndex = INIT_CONTENT_INDEX;
 }
\ No newline at end of file