264 CreateVideoSpecificCmdL( EPbCmdStopVideoSeeking ); |
264 CreateVideoSpecificCmdL( EPbCmdStopVideoSeeking ); |
265 break; |
265 break; |
266 } |
266 } |
267 case EMPXPbvCmdPlayPause: |
267 case EMPXPbvCmdPlayPause: |
268 { |
268 { |
269 MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdPause")); |
269 MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdPlayPause")); |
270 |
270 |
271 if ( iPlaybackState == EPbStatePlaying ) |
271 if ( iPlaybackState == EPbStatePlaying ) |
272 { |
272 { |
273 CreateGeneralPlaybackCommandL( EPbCmdPause ); |
273 CreateGeneralPlaybackCommandL( EPbCmdPause ); |
274 } |
274 } |
364 { |
364 { |
365 MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdPreviousListItem")); |
365 MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdPreviousListItem")); |
366 |
366 |
367 if ( iPlaylistView && iFileDetails->mMultiItemPlaylist ) |
367 if ( iPlaylistView && iFileDetails->mMultiItemPlaylist ) |
368 { |
368 { |
369 // |
369 // |
370 // the command is being sent twice on purpose |
370 // Need to send sync message to go back to a previous clip |
371 // one EMPXPbvCmdPreviousListItem command only sets the position to 0 |
371 // regardless of current positoin |
372 // the second cmd actually goes to the previous item in the list |
|
373 // |
372 // |
374 iPlaybackUtility->CommandL( EPbCmdPrevious ); |
373 CreateGeneralPlaybackCommandL( EPbCmdPrevious ); |
375 iPlaybackUtility->CommandL( EPbCmdPrevious ); |
|
376 } |
374 } |
377 else |
375 else |
378 { |
376 { |
379 MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() ignore EMPXPbvCmdNextListItem")); |
377 MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() ignore EMPXPbvCmdNextListItem")); |
380 } |
378 } |
1051 |
1049 |
1052 if ( iControlsController ) |
1050 if ( iControlsController ) |
1053 { |
1051 { |
1054 iControlsController->handleEvent( EMPXControlCmdSetPosition, aValue ); |
1052 iControlsController->handleEvent( EMPXControlCmdSetPosition, aValue ); |
1055 } |
1053 } |
1056 |
1054 |
|
1055 iPlayPosition = aValue; |
|
1056 |
1057 break; |
1057 break; |
1058 } |
1058 } |
1059 case EPbPropertyDuration: |
1059 case EPbPropertyDuration: |
1060 { |
1060 { |
1061 MPX_DEBUG(_L("CMPXVideoViewWrapper::DoHandlePropertyL duration(%d)"), aValue ); |
1061 MPX_DEBUG(_L("CMPXVideoViewWrapper::DoHandlePropertyL duration(%d)"), aValue ); |
1103 // CMPXVideoViewWrapper::RetrieveFileNameAndModeL |
1103 // CMPXVideoViewWrapper::RetrieveFileNameAndModeL |
1104 // ------------------------------------------------------------------------------------------------- |
1104 // ------------------------------------------------------------------------------------------------- |
1105 // |
1105 // |
1106 void CMPXVideoViewWrapper::RetrieveFileNameAndModeL( CMPXCommand* aCmd ) |
1106 void CMPXVideoViewWrapper::RetrieveFileNameAndModeL( CMPXCommand* aCmd ) |
1107 { |
1107 { |
|
1108 MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::RetrieveFileNameAndModeL()")); |
|
1109 |
1108 // |
1110 // |
1109 // set attributes on the command |
1111 // set attributes on the command |
1110 // |
1112 // |
1111 aCmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue ); |
1113 aCmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue ); |
1112 |
1114 |
1126 { |
1128 { |
1127 MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::ActivateClosePlayerActiveObject()")); |
1129 MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::ActivateClosePlayerActiveObject()")); |
1128 |
1130 |
1129 if ( ! iCloseAO->IsActive() ) |
1131 if ( ! iCloseAO->IsActive() ) |
1130 { |
1132 { |
1131 iCloseAO->Start( TCallBack( CMPXVideoViewWrapper::ClosePlayerL, this ) ); |
1133 iCloseAO->Start( TCallBack( CMPXVideoViewWrapper::ClosePlayer, this ) ); |
1132 } |
1134 } |
1133 } |
1135 } |
1134 |
1136 |
1135 // ------------------------------------------------------------------------------------------------- |
1137 // ------------------------------------------------------------------------------------------------- |
1136 // CMPXVideoViewWrapper::ClosePlayerL |
1138 // CMPXVideoViewWrapper::ClosePlayer |
1137 // ------------------------------------------------------------------------------------------------- |
1139 // ------------------------------------------------------------------------------------------------- |
1138 // |
1140 // |
1139 TInt CMPXVideoViewWrapper::ClosePlayerL( TAny* aPtr ) |
1141 TInt CMPXVideoViewWrapper::ClosePlayer( TAny* aPtr ) |
1140 { |
1142 { |
1141 MPX_DEBUG(_L("CMPXVideoViewWrapper::ClosePlayerL()")); |
1143 MPX_DEBUG(_L("CMPXVideoViewWrapper::ClosePlayer()")); |
1142 |
1144 |
1143 static_cast<CMPXVideoViewWrapper*>(aPtr)->DoClosePlayerL(); |
1145 static_cast<CMPXVideoViewWrapper*>(aPtr)->DoClosePlayer(); |
1144 return KErrNone; |
1146 return KErrNone; |
1145 } |
1147 } |
1146 |
1148 |
1147 // ------------------------------------------------------------------------------------------------- |
1149 // ------------------------------------------------------------------------------------------------- |
1148 // CMPXVideoViewWrapper::DoClosePlayerL |
1150 // CMPXVideoViewWrapper::DoClosePlayer |
1149 // ------------------------------------------------------------------------------------------------- |
1151 // ------------------------------------------------------------------------------------------------- |
1150 // |
1152 // |
1151 void CMPXVideoViewWrapper::DoClosePlayerL() |
1153 void CMPXVideoViewWrapper::DoClosePlayer() |
1152 { |
1154 { |
1153 MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::DoClosePlayerL()")); |
1155 MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::DoClosePlayer()")); |
1154 |
1156 |
1155 iView->doClosePlayer(); |
1157 iView->doClosePlayer(); |
1156 } |
1158 } |
1157 |
1159 |
1158 // ------------------------------------------------------------------------------------------------- |
1160 // ------------------------------------------------------------------------------------------------- |
1503 { |
1505 { |
1504 iControlsController->handleEvent( EMPXControlCmdSetAspectRatio, newAspectRatio ); |
1506 iControlsController->handleEvent( EMPXControlCmdSetAspectRatio, newAspectRatio ); |
1505 } |
1507 } |
1506 } |
1508 } |
1507 |
1509 |
1508 CreateGeneralPlaybackCommandL( EPbCmdPlay ); |
1510 // if coming back after a forced termination, the playback position must |
|
1511 // be restored and state be set to paused, as forced termination can only |
|
1512 // happen when app is on background, in which case Video Player is paused |
|
1513 // by default |
|
1514 if ( iView->mStayPaused ) |
|
1515 { |
|
1516 CreateGeneralPlaybackCommandL( EPbCmdPause ); |
|
1517 SetPropertyL( EPbPropertyPosition, iView->mLastPlayPosition ); |
|
1518 iView->mStayPaused = false; |
|
1519 } |
|
1520 else |
|
1521 { |
|
1522 CreateGeneralPlaybackCommandL( EPbCmdPlay ); |
|
1523 } |
|
1524 |
1509 } |
1525 } |
1510 } |
1526 } |
1511 |
1527 |
1512 // EOF |
1528 // EOF |