157 } |
157 } |
158 |
158 |
159 // ------------------------------------------------------------------------------------------------ |
159 // ------------------------------------------------------------------------------------------------ |
160 // CMPXVideoPlaybackMode::HandlePause() |
160 // CMPXVideoPlaybackMode::HandlePause() |
161 // ------------------------------------------------------------------------------------------------ |
161 // ------------------------------------------------------------------------------------------------ |
162 void CMPXVideoPlaybackMode::HandlePause() |
162 TInt CMPXVideoPlaybackMode::HandlePause() |
163 { |
163 { |
164 MPX_ENTER_EXIT(_L("CMPXVideoPlaybackMode::HandlePause()")); |
164 MPX_ENTER_EXIT(_L("CMPXVideoPlaybackMode::HandlePause()")); |
165 |
165 |
166 MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->PauseL() ); |
166 MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->PauseL() ); |
167 |
167 |
171 |
171 |
172 iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPaused, |
172 iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPaused, |
173 0, |
173 0, |
174 err ); |
174 err ); |
175 } |
175 } |
176 else |
176 |
177 { |
177 return err; |
178 TRAP_IGNORE( iVideoPlaybackCtlr->iState->SendErrorToViewL( err ) ); |
|
179 } |
|
180 } |
178 } |
181 |
179 |
182 // ------------------------------------------------------------------------------------------------ |
180 // ------------------------------------------------------------------------------------------------ |
183 // CMPXVideoPlaybackMode::HandleBackground() |
181 // CMPXVideoPlaybackMode::HandleBackground() |
184 // ------------------------------------------------------------------------------------------------ |
182 // ------------------------------------------------------------------------------------------------ |
477 } |
475 } |
478 |
476 |
479 // ------------------------------------------------------------------------------------------------ |
477 // ------------------------------------------------------------------------------------------------ |
480 // CMPXStreamingPlaybackMode::HandlePause() |
478 // CMPXStreamingPlaybackMode::HandlePause() |
481 // ------------------------------------------------------------------------------------------------ |
479 // ------------------------------------------------------------------------------------------------ |
482 void CMPXStreamingPlaybackMode::HandlePause() |
480 TInt CMPXStreamingPlaybackMode::HandlePause() |
483 { |
481 { |
484 MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::HandlePause()")); |
482 MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::HandlePause()")); |
485 |
483 |
|
484 TInt err = KErrNone; |
|
485 |
486 if ( iVideoPlaybackCtlr->iFileDetails->iPausableStream ) |
486 if ( iVideoPlaybackCtlr->iFileDetails->iPausableStream ) |
487 { |
487 { |
488 MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->PauseL() ); |
488 MPX_TRAP( err, iVideoPlaybackCtlr->iPlayer->PauseL() ); |
489 |
489 |
490 if ( err == KErrNone ) |
490 if ( err == KErrNone ) |
491 { |
491 { |
492 iVideoPlaybackCtlr->ChangeState( EMPXVideoPaused ); |
492 iVideoPlaybackCtlr->ChangeState( EMPXVideoPaused ); |
493 |
493 |
494 iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( |
494 iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( |
495 MMPXPlaybackPluginObserver::EPPaused, |
495 MMPXPlaybackPluginObserver::EPPaused, |
496 0, |
496 0, |
497 err ); |
497 err ); |
498 } |
498 } |
499 else |
|
500 { |
|
501 TRAP_IGNORE( iVideoPlaybackCtlr->iState->SendErrorToViewL( err ) ); |
|
502 } |
|
503 } |
499 } |
504 // Streaming link is non-pausable and no alarm stop playback |
500 // Streaming link is non-pausable and no alarm stop playback |
505 else if ( !iVideoPlaybackCtlr->IsAlarm() ) |
501 else if ( ! iVideoPlaybackCtlr->IsAlarm() ) |
506 { |
502 { |
507 iVideoPlaybackCtlr->iPlayer->Stop(); |
503 iVideoPlaybackCtlr->iPlayer->Stop(); |
508 |
504 |
509 iVideoPlaybackCtlr->ChangeState( EMPXVideoStopped ); |
505 iVideoPlaybackCtlr->ChangeState( EMPXVideoStopped ); |
510 |
506 |
511 iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPStopped, |
507 iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPStopped, |
512 0, |
508 0, |
513 KErrNone ); |
509 KErrNone ); |
514 } |
510 } |
|
511 |
|
512 return err; |
515 } |
513 } |
516 |
514 |
517 |
515 |
518 //************************************************************************************************// |
516 //************************************************************************************************// |
519 // CMPXLiveStreamingPlaybackMode |
517 // CMPXLiveStreamingPlaybackMode |
538 } |
536 } |
539 |
537 |
540 // ------------------------------------------------------------------------------------------------ |
538 // ------------------------------------------------------------------------------------------------ |
541 // CMPXLiveStreamingPlaybackMode::HandlePause() |
539 // CMPXLiveStreamingPlaybackMode::HandlePause() |
542 // ------------------------------------------------------------------------------------------------ |
540 // ------------------------------------------------------------------------------------------------ |
543 void CMPXLiveStreamingPlaybackMode::HandlePause() |
541 TInt CMPXLiveStreamingPlaybackMode::HandlePause() |
544 { |
542 { |
545 MPX_ENTER_EXIT(_L("CMPXLiveStreamingPlaybackMode::HandlePause()")); |
543 MPX_ENTER_EXIT(_L("CMPXLiveStreamingPlaybackMode::HandlePause()")); |
546 |
544 |
547 // |
545 // |
548 // Send a stop command to the player, but change state to pause |
546 // Send a stop command to the player, but change state to pause |
553 iVideoPlaybackCtlr->ChangeState( EMPXVideoPaused ); |
551 iVideoPlaybackCtlr->ChangeState( EMPXVideoPaused ); |
554 |
552 |
555 iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPaused, |
553 iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPaused, |
556 0, |
554 0, |
557 KErrNone ); |
555 KErrNone ); |
|
556 |
|
557 return KErrNone; |
558 } |
558 } |
559 |
559 |
560 // ------------------------------------------------------------------------------------------------ |
560 // ------------------------------------------------------------------------------------------------ |
561 // CMPXLiveStreamingPlaybackMode::SendErrorToView() |
561 // CMPXLiveStreamingPlaybackMode::SendErrorToView() |
562 // ------------------------------------------------------------------------------------------------ |
562 // ------------------------------------------------------------------------------------------------ |