videoplayback/videoplaybackviews/src/mpxvideopdlplaybackview.cpp
branchRCL_3
changeset 9 5294c000a26d
parent 8 ce5ada96ab30
child 12 7f2b2a65da29
equal deleted inserted replaced
8:ce5ada96ab30 9:5294c000a26d
    13 *
    13 *
    14 * Description:  Implementation of Video playback view
    14 * Description:  Implementation of Video playback view
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 22 %
    18 
       
    19 // Version : %version: 23 %
    19 
    20 
    20 
    21 
    21 //  Include Files
    22 //  Include Files
    22 #include <aknViewAppUi.h>
    23 #include <aknViewAppUi.h>
    23 #include <mpxplaybackutility.h>
    24 #include <mpxplaybackutility.h>
   114 //   CMPXVideoPdlPlaybackView::CloseEmbeddedPlaybackViewL
   115 //   CMPXVideoPdlPlaybackView::CloseEmbeddedPlaybackViewL
   115 // -------------------------------------------------------------------------------------------------
   116 // -------------------------------------------------------------------------------------------------
   116 //
   117 //
   117 void CMPXVideoPdlPlaybackView::CloseEmbeddedPlaybackViewL()
   118 void CMPXVideoPdlPlaybackView::CloseEmbeddedPlaybackViewL()
   118 {
   119 {
   119     MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::CloseEmbeddedPlaybackViewL()"));
   120     MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::CloseEmbeddedPlaybackViewL()"),
       
   121                    _L("iPlaybackState = %d"), iPlaybackState );
   120 
   122 
   121     //
   123     //
   122     //  If playback state is playing, pause playback
   124     //  If playback state is playing, pause playback
   123     //  If playback state is stopped, close the plugin so file will be moved
   125     //  If playback state is stopped, close the plugin so file will be moved
   124     //
   126     //
   126     {
   128     {
   127         HandleCommandL( EMPXPbvCmdPause );
   129         HandleCommandL( EMPXPbvCmdPause );
   128     }
   130     }
   129     else if ( iPlaybackState == EPbStateStopped )
   131     else if ( iPlaybackState == EPbStateStopped )
   130     {
   132     {
   131         //
   133         ActivateClosePlayerActiveObject();
   132         //  Close the playback plugin and clear out the PDL data from the PDL Handler
       
   133         //
       
   134         HandleCommandL( EMPXPbvCmdClose );
       
   135         AppUi()->HandleCommandL( EAknCmdHideInBackground );
       
   136     }
   134     }
   137 
   135 
   138     //
   136     //
   139     //  Embedded PDL
   137     //  Embedded PDL
   140     //  If we are in the foreground, bring the browser to the foreground
   138     //  If we are in the foreground, bring the browser to the foreground
   237             //
   235             //
   238             //  For progressive download mode, this indicates that the file
   236             //  For progressive download mode, this indicates that the file
   239             //  could not be played until the entire file is downloaded.
   237             //  could not be played until the entire file is downloaded.
   240             //
   238             //
   241             DisplayErrorMessageL( R_MPX_VIDEO_PDL_WAIT_DL_COMPLETE_MSG );
   239             DisplayErrorMessageL( R_MPX_VIDEO_PDL_WAIT_DL_COMPLETE_MSG );
   242             ClosePlaybackViewL();
   240             ClosePlaybackViewWithErrorL();
   243 
   241 
   244             break;
   242             break;
   245         }
   243         }
   246         case KErrEof:
   244         case KErrEof:
   247         {
   245         {
   248             //
   246             //
   249             //  For progressive download mode, this indicates that the file
   247             //  For progressive download mode, this indicates that the file
   250             //  has timed out waiting for more data to be downloaded
   248             //  has timed out waiting for more data to be downloaded
   251             //
   249             //
   252             DisplayErrorMessageL( R_MPX_VIDEO_PDL_ALL_CONTENT_PLAYED_MSG );
   250             DisplayErrorMessageL( R_MPX_VIDEO_PDL_ALL_CONTENT_PLAYED_MSG );
   253             ClosePlaybackViewL();
   251             ClosePlaybackViewWithErrorL();
   254 
   252 
   255             break;
   253             break;
   256         }
   254         }
   257         case KErrNotSupported:
   255         case KErrNotSupported:
   258         case KErrUnknown:
   256         case KErrUnknown:
   274             else
   272             else
   275             {
   273             {
   276                 DisplayErrorMessageL( R_MPX_VIDEO_INVALID_CLIP );
   274                 DisplayErrorMessageL( R_MPX_VIDEO_INVALID_CLIP );
   277             }
   275             }
   278 
   276 
   279             ClosePlaybackViewL();
   277             ClosePlaybackViewWithErrorL();
   280 
   278 
   281             break;
   279             break;
   282         }
   280         }
   283         default:
   281         default:
   284         {
   282         {
   303     {
   301     {
   304         case EPbDlStateDownloadError:
   302         case EPbDlStateDownloadError:
   305         case EPbDlStateDownloadCanceled:
   303         case EPbDlStateDownloadCanceled:
   306         {
   304         {
   307             HandleCommandL( EMPXPbvCmdStop );
   305             HandleCommandL( EMPXPbvCmdStop );
   308             ClosePlaybackViewL();
   306             ClosePlaybackViewWithErrorL();
   309             break;
   307             break;
   310         }
   308         }
   311         case EPbDlStateDownloading:
   309         case EPbDlStateDownloading:
   312         {
   310         {
   313             if ( prevPdlState == EPbDlStateDownloadPaused )
   311             if ( prevPdlState == EPbDlStateDownloadPaused )
   420     iPlaybackUtility->CommandL( *cmd );
   418     iPlaybackUtility->CommandL( *cmd );
   421 
   419 
   422     CleanupStack::PopAndDestroy( cmd );
   420     CleanupStack::PopAndDestroy( cmd );
   423 }
   421 }
   424 
   422 
       
   423 // -------------------------------------------------------------------------------------------------
       
   424 //   CMPXVideoPdlPlaybackView::ClosePlaybackViewWithErrorL()
       
   425 // -------------------------------------------------------------------------------------------------
       
   426 //
       
   427 void CMPXVideoPdlPlaybackView::ClosePlaybackViewWithErrorL()
       
   428 {
       
   429     MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::ClosePlaybackViewWithErrorL"));
       
   430 
       
   431     //
       
   432     //  An error has been processed, set the playback state to Stopped and close the view
       
   433     //
       
   434     iPlaybackState = EPbStateStopped;
       
   435 
       
   436     ClosePlaybackViewL();
       
   437 }
       
   438 
   425 // EOF
   439 // EOF