vtuis/lcvtplugin/src/control/clcvtlocalvideoplayer.cpp
changeset 36 f5f903566743
parent 27 dcbddbbaf8fd
equal deleted inserted replaced
33:f504698d93b6 36:f5f903566743
    49     MLcAudioControl& aLcAudioControl,
    49     MLcAudioControl& aLcAudioControl,
    50     TVtCameraHandler& aCameraHandler) :
    50     TVtCameraHandler& aCameraHandler) :
    51     CLcVtVideoPlayerBase( avtSession, aLcAudioControl ),
    51     CLcVtVideoPlayerBase( avtSession, aLcAudioControl ),
    52     iCameraHandler( aCameraHandler ) 
    52     iCameraHandler( aCameraHandler ) 
    53     {
    53     {
    54     iIsPlaying = ETrue;
       
    55     iOrientationChanged = EFalse;
    54     iOrientationChanged = EFalse;
    56     }
    55     }
    57 
    56 
    58 // -----------------------------------------------------------------------------
    57 // -----------------------------------------------------------------------------
    59 //
    58 //
    75 // From MLcVideoPlayer
    74 // From MLcVideoPlayer
    76 // -----------------------------------------------------------------------------
    75 // -----------------------------------------------------------------------------
    77 //
    76 //
    78 MLcVideoPlayer::TLcVideoPlayerState 
    77 MLcVideoPlayer::TLcVideoPlayerState 
    79 CLcVtLocalVideoPlayer::LcVideoPlayerState() const
    78 CLcVtLocalVideoPlayer::LcVideoPlayerState() const
    80     {    
    79     {
    81     TLcVideoPlayerState playerState = MLcVideoPlayer::EPlaying;
    80     TLcVideoPlayerState playerState;
       
    81     if ( ivtSession->LcVtStates().MediaState().IsVideo() )
       
    82         {
       
    83         playerState = MLcVideoPlayer::EPlaying;
       
    84         }
       
    85     else
       
    86         {
       
    87         playerState = MLcVideoPlayer::EPaused;
       
    88         }
       
    89     __VTPRINT2( DEBUG_GEN, "CLcVtLocalVideoPlayer.LcVideoPlayerState = %d", playerState )
    82     return playerState;
    90     return playerState;
    83     }
    91     }
    84 
    92 
    85 // -----------------------------------------------------------------------------
    93 // -----------------------------------------------------------------------------
    86 // From MLcVideoPlayer
    94 // From MLcVideoPlayer
    87 // -----------------------------------------------------------------------------
    95 // -----------------------------------------------------------------------------
    88 //
    96 //
    89 TBool CLcVtLocalVideoPlayer::LcIsPlayingL()
    97 TBool CLcVtLocalVideoPlayer::LcIsPlayingL()
    90     {         
    98     {         
    91     TBool result = ivtSession->LcVtStates().MediaState().IsVideo();
    99     TBool result = (LcVideoPlayerState() == MLcVideoPlayer::EPlaying);
    92     __VTPRINT2( DEBUG_GEN, "CLcVtLocalVideoPlayer.LcIsPlayingL = %d", result )
   100     __VTPRINT2( DEBUG_GEN, "CLcVtLocalVideoPlayer.LcIsPlayingL = %d", result )
    93     return result;
   101     return result;
    94     }
   102     }
    95 
   103 
    96 // -----------------------------------------------------------------------------
   104 // -----------------------------------------------------------------------------
    98 // -----------------------------------------------------------------------------
   106 // -----------------------------------------------------------------------------
    99 //
   107 //
   100 void CLcVtLocalVideoPlayer::LcPlayL(TLcVideoPlayerSource /*aSource*/)
   108 void CLcVtLocalVideoPlayer::LcPlayL(TLcVideoPlayerSource /*aSource*/)
   101     {
   109     {
   102     __VTPRINT( DEBUG_GEN, "CLcVtLocalVideoPlayer.LcPlayL" )
   110     __VTPRINT( DEBUG_GEN, "CLcVtLocalVideoPlayer.LcPlayL" )
   103     iIsPlaying = ETrue;
       
   104     ivtSession->HandleCommandL(EPluginCmdEnableVideo);
   111     ivtSession->HandleCommandL(EPluginCmdEnableVideo);
   105     }
   112     }
   106 
   113 
   107 // -----------------------------------------------------------------------------
   114 // -----------------------------------------------------------------------------
   108 // From MLcVideoPlayer
   115 // From MLcVideoPlayer
   109 // -----------------------------------------------------------------------------
   116 // -----------------------------------------------------------------------------
   110 //
   117 //
   111 void CLcVtLocalVideoPlayer::LcPauseL()
   118 void CLcVtLocalVideoPlayer::LcPauseL()
   112     {
   119     {
   113     __VTPRINT( DEBUG_GEN, "CLcVtLocalVideoPlayer.LcPauseL" )
   120     __VTPRINT( DEBUG_GEN, "CLcVtLocalVideoPlayer.LcPauseL" )
   114     iIsPlaying = EFalse;
       
   115     ivtSession->HandleCommandL(EPluginCmdDisableVideo);
   121     ivtSession->HandleCommandL(EPluginCmdDisableVideo);
   116     }
   122     }
   117 
   123 
   118 // -----------------------------------------------------------------------------
   124 // -----------------------------------------------------------------------------
   119 // From MLcVideoPlayer
   125 // From MLcVideoPlayer