videoplayback/videoplaybackviews/src/mpxvideobaseplaybackview.cpp
branchRCL_3
changeset 12 7f2b2a65da29
parent 11 8970fbd719ec
child 14 55fa1ec415c6
equal deleted inserted replaced
11:8970fbd719ec 12:7f2b2a65da29
    14 * Description:   Implementation of Video base playback view
    14 * Description:   Implementation of Video base playback view
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // Version : %version: e003sa33#71 %
    19 // Version : %version: 75 %
    20 
    20 
    21 
    21 
    22 //  Include Files
    22 //  Include Files
    23 
    23 
    24 #include <aknViewAppUi.h>
    24 #include <aknViewAppUi.h>
    49 #include <mpxcollectionutility.h>
    49 #include <mpxcollectionutility.h>
    50 #include <mpxcollectionutility.h>
    50 #include <mpxcollectionutility.h>
    51 #include <mpxcollectionplaylist.h>
    51 #include <mpxcollectionplaylist.h>
    52 #include <mpxcollectionpath.h>
    52 #include <mpxcollectionpath.h>
    53 #include <mpxmediageneralextdefs.h>
    53 #include <mpxmediageneralextdefs.h>
       
    54 #include <vcxmyvideosuids.h>
    54 
    55 
    55 #include <drmuihandling.h>
    56 #include <drmuihandling.h>
    56 #include <drmerrorhandling.h>
    57 #include <drmerrorhandling.h>
    57 
    58 
    58 #include "mpxvideobaseplaybackview.h"
    59 #include "mpxvideobaseplaybackview.h"
   105     //
   106     //
   106     iViewUtility = MMPXViewUtility::UtilityL();
   107     iViewUtility = MMPXViewUtility::UtilityL();
   107 
   108 
   108     //
   109     //
   109     //  Get an instance of collection utility
   110     //  Get an instance of collection utility
       
   111     //  Used for the Collection Observer to get the MediaL callbacks
   110     //
   112     //
   111     iCollectionUtility = MMPXCollectionUtility::NewL( this );
   113     iCollectionUtility = MMPXCollectionUtility::NewL( this );
   112 
   114 
   113     //
   115     //
   114     //  Create Active Object for closing player
   116     //  Create Active Object for closing player
   125 // -------------------------------------------------------------------------------------------------
   127 // -------------------------------------------------------------------------------------------------
   126 //
   128 //
   127 CMPXVideoBasePlaybackView::~CMPXVideoBasePlaybackView()
   129 CMPXVideoBasePlaybackView::~CMPXVideoBasePlaybackView()
   128 {
   130 {
   129     MPX_DEBUG(_L("CMPXVideoBasePlaybackView::~CMPXVideoBasePlaybackView()"));
   131     MPX_DEBUG(_L("CMPXVideoBasePlaybackView::~CMPXVideoBasePlaybackView()"));
   130 
       
   131     if ( iClipName )
       
   132     {
       
   133         delete iClipName;
       
   134         iClipName = NULL;
       
   135     }
       
   136 
   132 
   137     if ( iCloseAO )
   133     if ( iCloseAO )
   138     {
   134     {
   139         delete iCloseAO;
   135         delete iCloseAO;
   140         iCloseAO = NULL;
   136         iCloseAO = NULL;
   230         }
   226         }
   231         case EAknSoftkeyClose:
   227         case EAknSoftkeyClose:
   232         case EMPXPbvCmdClose:
   228         case EMPXPbvCmdClose:
   233         {
   229         {
   234             MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdClose"));
   230             MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdClose"));
   235 
       
   236             //
       
   237             //  The display window must be removed before closing the playback plugin
       
   238             //
       
   239             RemoveBackgroundSurfaceL();
       
   240 
       
   241             CreateGeneralPlaybackCommandL( EPbCmdClose );
   231             CreateGeneralPlaybackCommandL( EPbCmdClose );
   242             break;
   232             break;
   243         }
   233         }
   244         case EMPXPbvCmdSeekForward:
   234         case EMPXPbvCmdSeekForward:
   245         {
   235         {
   540         iContainer = NULL;
   530         iContainer = NULL;
   541     }
   531     }
   542 
   532 
   543     iMediaRequested = EFalse;
   533     iMediaRequested = EFalse;
   544     iPlaybackState = EPbStateNotInitialised;
   534     iPlaybackState = EPbStateNotInitialised;
   545 
       
   546     if ( iClipName )
       
   547     {
       
   548         delete iClipName;
       
   549         iClipName = NULL;
       
   550     }
       
   551 }
   535 }
   552 
   536 
   553 // -------------------------------------------------------------------------------------------------
   537 // -------------------------------------------------------------------------------------------------
   554 //   CMPXVideoBasePlaybackView::HandleForegroundEventL()
   538 //   CMPXVideoBasePlaybackView::HandleForegroundEventL()
   555 // -------------------------------------------------------------------------------------------------
   539 // -------------------------------------------------------------------------------------------------
   613                    _L("aCurrentViewType = 0x%08x, aPreviousViewType = 0x%08x"),
   597                    _L("aCurrentViewType = 0x%08x, aPreviousViewType = 0x%08x"),
   614                    aCurrentViewType.iUid, aPreviousViewType.iUid );
   598                    aCurrentViewType.iUid, aPreviousViewType.iUid );
   615 
   599 
   616     //
   600     //
   617     //  This view is active since we are receiving the callback.
   601     //  This view is active since we are receiving the callback.
   618     //  Some new view is being activated so stop playback and return to automatic orientation
   602     //  Some new view is being activated so remove surface, stop playback and
   619     //
   603     //  return to automatic orientation
   620     TRAP_IGNORE(
   604     //
   621         HandleCommandL( EMPXPbvCmdStop );
   605     iDisplayHandler->RemoveDisplayWindow();
   622         AppUi()->SetOrientationL( CAknAppUiBase::EAppUiOrientationAutomatic );
   606 
   623         );
   607     TRAP_IGNORE( HandleCommandL( EMPXPbvCmdStop );
       
   608                  AppUi()->SetOrientationL( CAknAppUiBase::EAppUiOrientationAutomatic ) );
   624 }
   609 }
   625 
   610 
   626 // -------------------------------------------------------------------------------------------------
   611 // -------------------------------------------------------------------------------------------------
   627 // From MMPXPlaybackObserver
   612 // From MMPXPlaybackObserver
   628 // Handle playback message.
   613 // Handle playback message.
   642         MPX_TRAPD( err, DoHandlePlaybackMessageL( aMessage ) );
   627         MPX_TRAPD( err, DoHandlePlaybackMessageL( aMessage ) );
   643     }
   628     }
   644 }
   629 }
   645 
   630 
   646 // -------------------------------------------------------------------------------------------------
   631 // -------------------------------------------------------------------------------------------------
       
   632 //   CMPXVideoBasePlaybackView::IsInMemoryPlugin
       
   633 // -------------------------------------------------------------------------------------------------
       
   634 //
       
   635 TBool CMPXVideoBasePlaybackView::IsInMemoryPlugin()
       
   636 {
       
   637     TBool retVal( EFalse );
       
   638 
       
   639     MMPXCollection& collectionPlugin = iCollectionUtility->Collection();
       
   640 
       
   641     TUid collectionUid;
       
   642     TUid inMemoryPluginUid = TUid::Uid( KMpxInMemoryPluginUid );
       
   643 
       
   644     MPX_TRAPD( error, collectionUid = collectionPlugin.UidL() );
       
   645 
       
   646     if ( ! error )
       
   647     {
       
   648         MPX_DEBUG(_L("CMPXVideoBasePlaybackView::IsInMemoryPlugin() collectionUid = 0x%08x"),
       
   649             collectionUid.iUid );
       
   650 
       
   651         if ( collectionUid == inMemoryPluginUid )
       
   652         {
       
   653             retVal = ETrue;
       
   654         }
       
   655     }
       
   656 
       
   657     MPX_DEBUG(_L("CMPXVideoBasePlaybackView::IsInMemoryPlugin(%d)"), retVal );
       
   658 
       
   659     return retVal;
       
   660 }
       
   661 
       
   662 // -------------------------------------------------------------------------------------------------
   647 // Request for the media object
   663 // Request for the media object
   648 // -------------------------------------------------------------------------------------------------
   664 // -------------------------------------------------------------------------------------------------
   649 //
   665 //
   650 void CMPXVideoBasePlaybackView::RequestMediaL()
   666 void CMPXVideoBasePlaybackView::RequestMediaL()
   651 {
   667 {
   653 
   669 
   654     if ( ! iMediaRequested && iPlaybackState == EPbStateInitialised )
   670     if ( ! iMediaRequested && iPlaybackState == EPbStateInitialised )
   655     {
   671     {
   656         iMediaRequested = ETrue;
   672         iMediaRequested = ETrue;
   657 
   673 
   658         if ( iPlaylistView )
   674         if ( iPlaylistView && IsInMemoryPlugin() )
   659         {
   675         {
   660             // Get the media attributes from the collection plugin
   676             // Get the media attributes from the collection plugin
   661             RequestCollectionMediaL();
   677             RequestCollectionMediaL();
   662         }
   678         }
   663         else
   679         else
   732     {
   748     {
   733         RArray<TMPXAttribute> attrs;
   749         RArray<TMPXAttribute> attrs;
   734         CleanupClosePushL(attrs);
   750         CleanupClosePushL(attrs);
   735 
   751 
   736         //  General Media Attributes
   752         //  General Media Attributes
   737         attrs.Append( KMPXMediaGeneralUri );
       
   738         attrs.Append( KMPXMediaGeneralExtAccessPoint );
       
   739         attrs.Append( KMPXMediaGeneralExtVideoSeekable );
   753         attrs.Append( KMPXMediaGeneralExtVideoSeekable );
   740 
   754 
   741         s->MediaL( attrs.Array(), *this);
   755         s->MediaL( attrs.Array(), *this );
   742 
   756 
   743         // Set the falg to indicate that media was reuqested from collection FW
   757         // Set the falg to indicate that media was reuqested from collection FW
   744         iCollectionMediaRequested = ETrue;
   758         iCollectionMediaRequested = ETrue;
   745 
   759 
   746         CleanupStack::PopAndDestroy( &attrs );
   760         CleanupStack::PopAndDestroy( &attrs );
   765     }
   779     }
   766     else if ( KMPXMediaIdVideoPlayback == id )
   780     else if ( KMPXMediaIdVideoPlayback == id )
   767     {
   781     {
   768         HandleVideoPlaybackMessage( aMessage );
   782         HandleVideoPlaybackMessage( aMessage );
   769     }
   783     }
   770     else if ( KMPXMediaIdVideoDisplaySyncMessage == id )
   784     else if ( KMPXMediaIdVideoDisplayMessage == id )
   771     {
   785     {
   772         if ( iDisplayHandler )
   786         if ( iDisplayHandler )
   773         {
   787         {
   774             iDisplayHandler->HandleVideoDisplaySyncMessageL( aMessage );
   788             iDisplayHandler->HandleVideoDisplayMessageL( aMessage );
   775         }
   789         }
   776     }
   790     }
   777 }
   791 }
   778 
   792 
   779 // -------------------------------------------------------------------------------------------------
   793 // -------------------------------------------------------------------------------------------------
   866             {
   880             {
   867                 MPX_TRAPD( err, iContainer->HandleEventL( cmdId, playbackAllowed ) );
   881                 MPX_TRAPD( err, iContainer->HandleEventL( cmdId, playbackAllowed ) );
   868             }
   882             }
   869             break;
   883             break;
   870         }
   884         }
       
   885         case EPbCmdLoadingStarted:
       
   886         {
       
   887             if ( iContainer )
       
   888             {
       
   889                 MPX_TRAPD( err, iContainer->HandleEventL( EMPXControlCmdLoadingStarted ) );
       
   890             }
       
   891 
       
   892             break;
       
   893         }
       
   894         case EPbCmdHideControls:
       
   895         {
       
   896             if ( iContainer )
       
   897             {
       
   898                 MPX_TRAPD( err, iContainer->HandleEventL( EMPXControlCmdHideControls ) );
       
   899             }
       
   900             break;
       
   901         }
   871     }
   902     }
   872 }
   903 }
   873 
   904 
   874 // -------------------------------------------------------------------------------------------------
   905 // -------------------------------------------------------------------------------------------------
   875 //   CMPXVideoBasePlaybackView::HandleClosePlaybackViewL()
   906 //   CMPXVideoBasePlaybackView::HandleClosePlaybackViewL()
   877 //
   908 //
   878 void CMPXVideoBasePlaybackView::HandleClosePlaybackViewL()
   909 void CMPXVideoBasePlaybackView::HandleClosePlaybackViewL()
   879 {
   910 {
   880     MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::HandleClosePlaybackViewL()"));
   911     MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::HandleClosePlaybackViewL()"));
   881 
   912 
   882     // Reset the playback state to stopped
       
   883     iPlaybackState = EPbStateStopped;
   913     iPlaybackState = EPbStateStopped;
   884     
   914 
   885     if ( IsMultiItemPlaylist() )
   915     if ( IsMultiItemPlaylist() )
   886     {
   916     {
   887         RemoveBackgroundSurfaceL();
       
   888 
       
   889         iPlaybackUtility->CommandL( EPbCmdNext );
   917         iPlaybackUtility->CommandL( EPbCmdNext );
   890     }
   918     }
   891     else
   919     else
   892     {
   920     {
   893         ClosePlaybackViewL();
   921         ClosePlaybackViewL();
   984 
  1012 
   985         switch ( aNewState )
  1013         switch ( aNewState )
   986         {
  1014         {
   987             case EPbStateInitialising:
  1015             case EPbStateInitialising:
   988             {
  1016             {
   989                 //
  1017                 HandleInitializingStateL( oldState );
   990                 //  For multi item playlists, reset the container and controls for next
       
   991                 //  item in playlist
       
   992                 //
       
   993                 if ( IsMultiItemPlaylist() && iContainer )
       
   994                 {
       
   995                     //
       
   996                     //  If transitioning from Not Initialized to Initialising there is
       
   997                     //  no need to update the playback information that was gathered
       
   998                     //  when the container was created
       
   999                     //
       
  1000                     if ( oldState != EPbStateNotInitialised )
       
  1001                     {
       
  1002                         iMediaRequested = EFalse;
       
  1003 
       
  1004                         iContainer->HandleCommandL( EMPXPbvCmdResetControls );
       
  1005 
       
  1006                         if ( iFileDetails )
       
  1007                         {
       
  1008                             if ( iFileDetailsDialog )
       
  1009                             {
       
  1010                                 iFileDetailsDialog->Close();
       
  1011                             }
       
  1012 
       
  1013                             iFileDetails->ClearFileDetails();
       
  1014                         }
       
  1015                     }
       
  1016                 }
       
  1017                 break;
  1018                 break;
  1018             }
  1019             }
  1019             case EPbStateBuffering:
  1020             case EPbStateBuffering:
  1020             {
  1021             {
  1021                 TInt bufferingPercentage( 0 );
  1022                 TInt bufferingPercentage( 0 );
  1291             iDisplayHandler->CreateDisplayWindowL( *(CCoeEnv::Static()->ScreenDevice()),
  1292             iDisplayHandler->CreateDisplayWindowL( *(CCoeEnv::Static()->ScreenDevice()),
  1292                                                    iContainer->GetWindow() );
  1293                                                    iContainer->GetWindow() );
  1293 
  1294 
  1294             iContainer->HandleEventL( EMPXControlCmdSetAspectRatio, newAspectRatio );
  1295             iContainer->HandleEventL( EMPXControlCmdSetAspectRatio, newAspectRatio );
  1295         }
  1296         }
       
  1297         else
       
  1298         {
       
  1299             //
       
  1300             //  Remove the display window so the surface can be released
       
  1301             //
       
  1302             iDisplayHandler->RemoveDisplayWindow();
       
  1303         }
  1296 
  1304 
  1297         //
  1305         //
  1298         //  Delay the play command while the Real One Bitmap is being shown
  1306         //  Delay the play command while the Real One Bitmap is being shown
  1299         //
  1307         //
  1300         if ( iContainer->IsRealOneBitmapTimerActive() )
  1308         if ( iContainer->IsRealOneBitmapTimerActive() )
  1312 //   CMPXVideoBasePlaybackView::UpdatePbPluginMedia()
  1320 //   CMPXVideoBasePlaybackView::UpdatePbPluginMedia()
  1313 // -------------------------------------------------------------------------------------------------
  1321 // -------------------------------------------------------------------------------------------------
  1314 //
  1322 //
  1315 void CMPXVideoBasePlaybackView::UpdatePbPluginMediaL( TBool aSeek)
  1323 void CMPXVideoBasePlaybackView::UpdatePbPluginMediaL( TBool aSeek)
  1316 {
  1324 {
  1317     MPX_DEBUG(_L("CMPXVideoBasePlaybackView::UpdatePbPluginMediaL() iSeekable %d"), aSeek);
  1325     MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::UpdatePbPluginMediaL()"),
       
  1326                    _L("aSeek = %d"), aSeek );
  1318 
  1327 
  1319     CMPXCommand* cmd = CMPXCommand::NewL();
  1328     CMPXCommand* cmd = CMPXCommand::NewL();
  1320     CleanupStack::PushL( cmd );
  1329     CleanupStack::PushL( cmd );
  1321 
  1330 
  1322     cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
  1331     cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
  1323 
  1332 
  1324     cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
  1333     cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
  1325 
  1334 
  1326     cmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand, EPbCmdUpdateSeekable );
  1335     cmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand,
       
  1336                                                      EPbCmdUpdateSeekable );
  1327 
  1337 
  1328     cmd->SetTObjectValueL<TBool>( KMPXMediaGeneralExtVideoSeekable, aSeek );
  1338     cmd->SetTObjectValueL<TBool>( KMPXMediaGeneralExtVideoSeekable, aSeek );
  1329 
  1339 
  1330     iPlaybackUtility->CommandL( *cmd );
  1340     iPlaybackUtility->CommandL( *cmd );
  1331 
  1341 
  1349 
  1359 
  1350         if ( aMedia.IsSupported( KMPXMediaGeneralExtVideoSeekable ) )
  1360         if ( aMedia.IsSupported( KMPXMediaGeneralExtVideoSeekable ) )
  1351         {
  1361         {
  1352             seek = aMedia.ValueTObjectL<TBool>( KMPXMediaGeneralExtVideoSeekable );
  1362             seek = aMedia.ValueTObjectL<TBool>( KMPXMediaGeneralExtVideoSeekable );
  1353             UpdatePbPluginMediaL( seek );
  1363             UpdatePbPluginMediaL( seek );
  1354             MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleMediaL() called UpdatePbPluginMediaL iSeekable %d"), seek);
       
  1355         }
       
  1356 
       
  1357         if ( aMedia.IsSupported( KMPXMediaGeneralUri ) )
       
  1358         {
       
  1359             TPtrC uri( aMedia.ValueText( KMPXMediaGeneralUri ) );
       
  1360 
       
  1361             if ( iClipName )
       
  1362             {
       
  1363                 delete iClipName;
       
  1364                 iClipName = NULL;
       
  1365             }
       
  1366 
       
  1367             iClipName = uri.AllocL();
       
  1368         }
  1364         }
  1369 
  1365 
  1370         // request for media from playbackplugin
  1366         // request for media from playbackplugin
  1371         RequestPlaybackMediaL();
  1367         RequestPlaybackMediaL();
  1372     }
  1368     }
  1976     MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::OpenDrmFileHandleL()"));
  1972     MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::OpenDrmFileHandleL()"));
  1977 
  1973 
  1978     TInt openError = KErrNotFound;
  1974     TInt openError = KErrNotFound;
  1979     RFs& fs = iCoeEnv->FsSession();
  1975     RFs& fs = iCoeEnv->FsSession();
  1980 
  1976 
  1981     if ( iPlaylistView )
  1977     if ( iPlaylistView && iFileDetails->iClipName )
  1982     {
  1978     {
  1983         //
  1979         openError = aFile.Open( fs,
  1984         //  Use iClipName from the MediaL() call
  1980                                 iFileDetails->iClipName->Des(),
  1985         //
  1981                                 EFileRead | EFileShareReadersOrWriters );
  1986         openError = aFile.Open( fs, iClipName->Des(), EFileRead | EFileShareReadersOrWriters );
       
  1987     }
  1982     }
  1988     else
  1983     else
  1989     {
  1984     {
  1990         MMPXSource* s = iPlaybackUtility->Source();
  1985         MMPXSource* s = iPlaybackUtility->Source();
  1991 
  1986 
  2113     MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::OpenDrmFileHandle64L()"));
  2108     MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::OpenDrmFileHandle64L()"));
  2114 
  2109 
  2115     TInt openError = KErrNotFound;
  2110     TInt openError = KErrNotFound;
  2116     RFs& fs = iCoeEnv->FsSession();
  2111     RFs& fs = iCoeEnv->FsSession();
  2117 
  2112 
  2118     if ( iPlaylistView )
  2113     if ( iPlaylistView && iFileDetails->iClipName )
  2119     {
  2114     {
  2120         //
  2115         openError = aFile.Open( fs,
  2121         //  Use iClipName from the MediaL() call
  2116                                 iFileDetails->iClipName->Des(),
  2122         //
  2117                                 EFileRead | EFileShareReadersOrWriters );
  2123         openError = aFile.Open( fs, iClipName->Des(), EFileRead | EFileShareReadersOrWriters );
       
  2124     }
  2118     }
  2125     else
  2119     else
  2126     {
  2120     {
  2127         MMPXSource* s = iPlaybackUtility->Source();
  2121         MMPXSource* s = iPlaybackUtility->Source();
  2128 
  2122 
  2158 }
  2152 }
  2159 
  2153 
  2160 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2154 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2161 
  2155 
  2162 // -------------------------------------------------------------------------------------------------
  2156 // -------------------------------------------------------------------------------------------------
  2163 //   CMPXVideoBasePlaybackView::RemoveBackgroundSurfaceL()
       
  2164 // -------------------------------------------------------------------------------------------------
       
  2165 //
       
  2166 void CMPXVideoBasePlaybackView::RemoveBackgroundSurfaceL()
       
  2167 {
       
  2168     MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::RemoveBackgroundSurfaceL()"));
       
  2169 
       
  2170     if ( iDisplayHandler )
       
  2171     {
       
  2172         //
       
  2173         //  Remove the display window so the surface can be released
       
  2174         //
       
  2175         iDisplayHandler->RemoveDisplayWindow();
       
  2176     }
       
  2177 }
       
  2178 
       
  2179 // -------------------------------------------------------------------------------------------------
       
  2180 //   CMPXVideoBasePlaybackView::HandleRealOneBitmapTimeoutL()
  2157 //   CMPXVideoBasePlaybackView::HandleRealOneBitmapTimeoutL()
  2181 // -------------------------------------------------------------------------------------------------
  2158 // -------------------------------------------------------------------------------------------------
  2182 //
  2159 //
  2183 void CMPXVideoBasePlaybackView::HandleRealOneBitmapTimeoutL()
  2160 void CMPXVideoBasePlaybackView::HandleRealOneBitmapTimeoutL()
  2184 {
  2161 {
  2219     //  Fg/Bg events aren't received when the view has lost keyboard focus
  2196     //  Fg/Bg events aren't received when the view has lost keyboard focus
  2220     //  If we are sent to full background, sent a background command to the playback plugin
  2197     //  If we are sent to full background, sent a background command to the playback plugin
  2221     //
  2198     //
  2222     if ( ! iKeyboardInFocus && aEvent.Type() == EEventWindowVisibilityChanged )
  2199     if ( ! iKeyboardInFocus && aEvent.Type() == EEventWindowVisibilityChanged )
  2223     {
  2200     {
  2224         MPX_DEBUG(_L("CMpxVideoPlayerAppUi::HandleWsEventL() EEventWindowVisibilityChanged"));
  2201         MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleWsEventL() EEventWindowVisibilityChanged"));
  2225 
  2202 
  2226         TUint visible = aEvent.VisibilityChanged()->iFlags;
  2203         TUint visible = aEvent.VisibilityChanged()->iFlags;
  2227 
  2204 
  2228         if ( visible & TWsVisibilityChangedEvent::ENotVisible )
  2205         if ( visible & TWsVisibilityChangedEvent::ENotVisible )
  2229         {
  2206         {
  2237 //   CMPXVideoBasePlaybackView::SendWindowCommandL()
  2214 //   CMPXVideoBasePlaybackView::SendWindowCommandL()
  2238 // -------------------------------------------------------------------------------------------------
  2215 // -------------------------------------------------------------------------------------------------
  2239 //
  2216 //
  2240 void CMPXVideoBasePlaybackView::SendWindowCommandL( TMPXVideoPlaybackCommand aCmd )
  2217 void CMPXVideoBasePlaybackView::SendWindowCommandL( TMPXVideoPlaybackCommand aCmd )
  2241 {
  2218 {
  2242     MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUi::SendWindowCommandL()"),
  2219     MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::SendWindowCommandL()"),
  2243                    _L("aCmd = %d"), aCmd );
  2220                    _L("aCmd = %d"), aCmd );
  2244 
  2221 
  2245     //
  2222     //
  2246     //  create command to pass to playback plugin
  2223     //  create command to pass to playback plugin
  2247     //
  2224     //
  2255 
  2232 
  2256     iPlaybackUtility->CommandL( *cmd );
  2233     iPlaybackUtility->CommandL( *cmd );
  2257     CleanupStack::PopAndDestroy( cmd );
  2234     CleanupStack::PopAndDestroy( cmd );
  2258 }
  2235 }
  2259 
  2236 
       
  2237 // -------------------------------------------------------------------------------------------------
       
  2238 //   CMPXVideoBasePlaybackView::DoHandleInitializingStateL()
       
  2239 // -------------------------------------------------------------------------------------------------
       
  2240 //
       
  2241 void CMPXVideoBasePlaybackView::DoHandleInitializingStateL( TMPXPlaybackState aLastState )
       
  2242 {
       
  2243     MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::DoHandleInitializingStateL()"),
       
  2244                    _L("aLastState = %d"), aLastState );
       
  2245 
       
  2246     if ( iContainer )
       
  2247     {
       
  2248         //
       
  2249         //  If transitioning from Not Initialized to Initialising there is
       
  2250         //  no need to update the playback information that was gathered
       
  2251         //  when the container was created
       
  2252         //
       
  2253         if ( aLastState != EPbStateNotInitialised )
       
  2254         {
       
  2255             iMediaRequested = EFalse;
       
  2256 
       
  2257             iContainer->HandleCommandL( EMPXPbvCmdResetControls );
       
  2258 
       
  2259             if ( iFileDetails )
       
  2260             {
       
  2261                 if ( iFileDetailsDialog )
       
  2262                 {
       
  2263                     iFileDetailsDialog->Close();
       
  2264                 }
       
  2265 
       
  2266                 iFileDetails->ClearFileDetails();
       
  2267             }
       
  2268         }
       
  2269     }
       
  2270 }
       
  2271 
  2260 // EOF
  2272 // EOF