videoplayback/videoplaybackview/viewsrc/videoplaybackview.cpp
changeset 52 e3cecb93e76a
equal deleted inserted replaced
47:45e72b57a2fd 52:e3cecb93e76a
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implementation of Video playback view
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version:  da1mmcf#15 %
       
    19 
       
    20 
       
    21 
       
    22 //  Include Files
       
    23 #include <hbinstance.h>
       
    24 
       
    25 #include <mmf/common/mmferrors.h>
       
    26 #include <mpxvideoplaybackdefs.h>
       
    27 
       
    28 #include "mpxvideo_debug.h"
       
    29 #include "videoplaybackview.h"
       
    30 #include "mpxvideoviewwrapper.h"
       
    31 #include "mpxvideoplaybackuids.hrh"
       
    32 #include "videoplaybackviewfiledetails.h"
       
    33 #include "mpxcommonvideoplaybackview.hrh"
       
    34 
       
    35 
       
    36 //  Member Functions
       
    37 
       
    38 // -------------------------------------------------------------------------------------------------
       
    39 // VideoPlaybackView::VideoPlaybackView()
       
    40 // -------------------------------------------------------------------------------------------------
       
    41 //
       
    42 VideoPlaybackView::VideoPlaybackView()
       
    43 {
       
    44     MPX_ENTER_EXIT(_L("VideoPlaybackView::VideoPlaybackView()"));
       
    45 
       
    46     initializeVideoPlaybackView();
       
    47     mSyncClose = false;
       
    48 }
       
    49 
       
    50 // -------------------------------------------------------------------------------------------------
       
    51 //   VideoPlaybackView::~VideoPlaybackView()
       
    52 // -------------------------------------------------------------------------------------------------
       
    53 //
       
    54 VideoPlaybackView::~VideoPlaybackView()
       
    55 {
       
    56     MPX_DEBUG(_L("VideoPlaybackView::~VideoPlaybackView()"));
       
    57 }
       
    58 
       
    59 // -------------------------------------------------------------------------------------------------
       
    60 //   VideoPlaybackView::handleActivateView()
       
    61 // -------------------------------------------------------------------------------------------------
       
    62 //
       
    63 void VideoPlaybackView::handleActivateView()
       
    64 {
       
    65     MPX_ENTER_EXIT(_L("VideoPlaybackView::handleActivateView()"));
       
    66 
       
    67     VideoBasePlaybackView::handleActivateView();
       
    68 }
       
    69 
       
    70 // -------------------------------------------------------------------------------------------------
       
    71 //   VideoPlaybackView::handleDeactivateView()
       
    72 // -------------------------------------------------------------------------------------------------
       
    73 //
       
    74 void VideoPlaybackView::handleDeactivateView()
       
    75 {
       
    76     MPX_ENTER_EXIT(_L("VideoPlaybackView::handleDeactivateView()"));
       
    77 
       
    78     VideoBasePlaybackView::handleDeactivateView();
       
    79 }
       
    80 
       
    81 // -------------------------------------------------------------------------------------------------
       
    82 //   VideoPlaybackView::handleBack()
       
    83 // -------------------------------------------------------------------------------------------------
       
    84 //
       
    85 void VideoPlaybackView::handleBack()
       
    86 {   
       
    87     MPX_ENTER_EXIT(_L("VideoPlaybackView::handleBack()"));
       
    88 
       
    89     closePlaybackView();
       
    90 }
       
    91 
       
    92 // -------------------------------------------------------------------------------------------------
       
    93 //   VideoPlaybackView::handleSoftkeyBack()
       
    94 // -------------------------------------------------------------------------------------------------
       
    95 //
       
    96 void VideoPlaybackView::handleSoftkeyBack()
       
    97 {
       
    98     MPX_ENTER_EXIT(_L("VideoPlaybackView::handleSoftkeyBack()"));
       
    99 
       
   100     closePlaybackView();
       
   101 }
       
   102 
       
   103 // -------------------------------------------------------------------------------------------------
       
   104 //   VideoPlaybackView::handlePluginError()
       
   105 // -------------------------------------------------------------------------------------------------
       
   106 //
       
   107 void VideoPlaybackView::handlePluginError( int aError )
       
   108 {
       
   109     MPX_DEBUG(_L("VideoPlaybackView::handlePluginError() aError = %d"), aError );
       
   110    
       
   111     switch( aError )
       
   112     {
       
   113         case KErrNotSupported:
       
   114         case KErrUnknown:
       
   115         case KErrMMDecoder:
       
   116         case KErrCorrupt:
       
   117         case KErrTooBig:
       
   118         {
       
   119             showDialog( hbTrId( "txt_videos_info_invalid_clip_operation_canceled" ) );
       
   120             break;
       
   121         }
       
   122 
       
   123         case KErrMMInvalidProtocol:
       
   124         case KErrMMInvalidURL:
       
   125         case KErrArgument:
       
   126         {
       
   127             showDialog( hbTrId( "txt_videos_info_unable_to_connect_invalid_url" ) );
       
   128             break;
       
   129         }
       
   130 
       
   131         case KErrSessionClosed:
       
   132         {
       
   133             showDialog( hbTrId( "txt_videos_info_resource_lost" ) );
       
   134             break;
       
   135         }
       
   136         case KErrTimedOut:
       
   137         {
       
   138             showDialog( hbTrId( "txt_videos_info_unable_to_connect_connection_time" ) );
       
   139             break;
       
   140         }
       
   141         case KErrNotFound:
       
   142         {
       
   143             showDialog( hbTrId( "txt_videos_info_file_not_found" ) );
       
   144             break;
       
   145         }
       
   146         case KErrMMNotEnoughBandwidth:
       
   147         {
       
   148             showDialog( hbTrId( "txt_videos_info_unable_to_connect_not_enough_band" ) );
       
   149             break;
       
   150         }
       
   151         case KErrDisconnected:
       
   152         case KErrMMProxyServer:
       
   153         case KErrCouldNotConnect:
       
   154         case KErrAbort:
       
   155         {
       
   156             showDialog( hbTrId( "txt_videos_info_unable_to_connect" ) );
       
   157             break;
       
   158         }
       
   159         case KMPXVideoPlayOver2GDuringVoiceCallError:
       
   160         {
       
   161             showDialog( hbTrId( "txt_videos_info_video_play_not_allowed_during_voic" ), false );
       
   162             break;
       
   163         }
       
   164         default:
       
   165         {
       
   166             VideoBasePlaybackView::handlePluginError( aError );
       
   167 
       
   168             break;
       
   169         }
       
   170     }
       
   171 }
       
   172 
       
   173 // -----------------------------------------------------------------------------
       
   174 //   VideoPlaybackView::handlePdlStateChange
       
   175 // -----------------------------------------------------------------------------
       
   176 //
       
   177 void VideoPlaybackView::handlePdlStateChange( int /*aState*/ )
       
   178 {
       
   179     MPX_DEBUG(_L("VideoPlaybackView::handlePdlStateChange()"));
       
   180 }
       
   181 
       
   182 // -----------------------------------------------------------------------------
       
   183 //   VideoPlaybackView::handleStoppedState
       
   184 // -----------------------------------------------------------------------------
       
   185 //
       
   186 void VideoPlaybackView::handleStoppedState()
       
   187 {
       
   188     MPX_DEBUG(_L("VideoPlaybackView::HandleStoppedState()"));
       
   189 
       
   190     if ( ! mVideoMpxWrapper->IsPlaylist() )
       
   191     {        
       
   192         handleBack();
       
   193     }
       
   194 }
       
   195 
       
   196 // EOF