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#11 % |
|
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 "hbvideoplaybackview.h" |
|
30 #include "mpxvideoviewwrapper.h" |
|
31 #include "mpxvideoplaybackuids.hrh" |
|
32 #include "mpxvideoplaybackviewfiledetails.h" |
|
33 #include "mpxcommonvideoplaybackview.hrh" |
|
34 |
|
35 |
|
36 // Member Functions |
|
37 |
|
38 // ------------------------------------------------------------------------------------------------- |
|
39 // HbVideoPlaybackView::HbVideoPlaybackView() |
|
40 // ------------------------------------------------------------------------------------------------- |
|
41 // |
|
42 HbVideoPlaybackView::HbVideoPlaybackView() |
|
43 { |
|
44 MPX_ENTER_EXIT(_L("HbVideoPlaybackView::HbVideoPlaybackView()")); |
|
45 |
|
46 initializeVideoPlaybackView(); |
|
47 mSyncClose = false; |
|
48 } |
|
49 |
|
50 // ------------------------------------------------------------------------------------------------- |
|
51 // HbVideoPlaybackView::~HbVideoPlaybackView() |
|
52 // ------------------------------------------------------------------------------------------------- |
|
53 // |
|
54 HbVideoPlaybackView::~HbVideoPlaybackView() |
|
55 { |
|
56 MPX_DEBUG(_L("HbVideoPlaybackView::~HbVideoPlaybackView()")); |
|
57 } |
|
58 |
|
59 // ------------------------------------------------------------------------------------------------- |
|
60 // HbVideoPlaybackView::handleActivateView() |
|
61 // ------------------------------------------------------------------------------------------------- |
|
62 // |
|
63 void HbVideoPlaybackView::handleActivateView() |
|
64 { |
|
65 MPX_ENTER_EXIT(_L("HbVideoPlaybackView::handleActivateView()")); |
|
66 |
|
67 HbVideoBasePlaybackView::handleActivateView(); |
|
68 } |
|
69 |
|
70 // ------------------------------------------------------------------------------------------------- |
|
71 // HbVideoPlaybackView::handleDeactivateView() |
|
72 // ------------------------------------------------------------------------------------------------- |
|
73 // |
|
74 void HbVideoPlaybackView::handleDeactivateView() |
|
75 { |
|
76 MPX_ENTER_EXIT(_L("HbVideoPlaybackView::handleDeactivateView()")); |
|
77 |
|
78 HbVideoBasePlaybackView::handleDeactivateView(); |
|
79 } |
|
80 |
|
81 // ------------------------------------------------------------------------------------------------- |
|
82 // HbVideoPlaybackView::handleBack() |
|
83 // ------------------------------------------------------------------------------------------------- |
|
84 // |
|
85 void HbVideoPlaybackView::handleBack() |
|
86 { |
|
87 MPX_ENTER_EXIT(_L("HbVideoPlaybackView::handleBack()")); |
|
88 |
|
89 closePlaybackView(); |
|
90 } |
|
91 |
|
92 // ------------------------------------------------------------------------------------------------- |
|
93 // HbVideoPlaybackView::handleSoftkeyBack() |
|
94 // ------------------------------------------------------------------------------------------------- |
|
95 // |
|
96 void HbVideoPlaybackView::handleSoftkeyBack() |
|
97 { |
|
98 MPX_ENTER_EXIT(_L("HbVideoPlaybackView::handleSoftkeyBack()")); |
|
99 |
|
100 closePlaybackView(); |
|
101 } |
|
102 |
|
103 // ------------------------------------------------------------------------------------------------- |
|
104 // HbVideoPlaybackView::handlePluginError() |
|
105 // ------------------------------------------------------------------------------------------------- |
|
106 // |
|
107 void HbVideoPlaybackView::handlePluginError( int aError ) |
|
108 { |
|
109 MPX_DEBUG(_L("HbVideoPlaybackView::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 if ( ! mVideoMpxWrapper->IsLive() ) |
|
134 { |
|
135 showDialog( hbTrId( "txt_videos_info_resource_lost" ) ); |
|
136 } |
|
137 else |
|
138 { |
|
139 handleClosePlaybackView(); |
|
140 } |
|
141 break; |
|
142 } |
|
143 case KErrTimedOut: |
|
144 { |
|
145 showDialog( hbTrId( "txt_videos_info_unable_to_connect_connection_time" ) ); |
|
146 break; |
|
147 } |
|
148 case KErrNotFound: |
|
149 { |
|
150 showDialog( hbTrId( "txt_videos_info_unable_to_connect_file_not_found" ) ); |
|
151 break; |
|
152 } |
|
153 case KErrMMNotEnoughBandwidth: |
|
154 { |
|
155 showDialog( hbTrId( "txt_videos_info_unable_to_connect_not_enough_band" ) ); |
|
156 break; |
|
157 } |
|
158 case KErrDisconnected: |
|
159 case KErrMMProxyServer: |
|
160 case KErrCouldNotConnect: |
|
161 case KErrAbort: |
|
162 { |
|
163 showDialog( hbTrId( "txt_videos_info_unable_to_connect" ) ); |
|
164 break; |
|
165 } |
|
166 case KMPXVideoPlayOver2GDuringVoiceCallError: |
|
167 { |
|
168 showDialog( hbTrId( "txt_videos_info_video_play_not_allowed_during_voic" ), false ); |
|
169 break; |
|
170 } |
|
171 default: |
|
172 { |
|
173 HbVideoBasePlaybackView::handlePluginError( aError ); |
|
174 |
|
175 break; |
|
176 } |
|
177 } |
|
178 } |
|
179 |
|
180 // ----------------------------------------------------------------------------- |
|
181 // HbVideoPlaybackView::handlePdlStateChange |
|
182 // ----------------------------------------------------------------------------- |
|
183 // |
|
184 void HbVideoPlaybackView::handlePdlStateChange( int /*aState*/ ) |
|
185 { |
|
186 MPX_DEBUG(_L("HbVideoPlaybackView::handlePdlStateChange()")); |
|
187 } |
|
188 |
|
189 // ----------------------------------------------------------------------------- |
|
190 // HbVideoPlaybackView::handleStoppedState |
|
191 // ----------------------------------------------------------------------------- |
|
192 // |
|
193 void HbVideoPlaybackView::handleStoppedState() |
|
194 { |
|
195 MPX_DEBUG(_L("HbVideoPlaybackView::HandleStoppedState()")); |
|
196 |
|
197 if ( ! mVideoMpxWrapper->IsPlaylist() ) |
|
198 { |
|
199 handleBack(); |
|
200 } |
|
201 } |
|
202 |
|
203 // EOF |
|