90 // |
90 // |
91 void CMPXVideoViewWrapper::ConstructL() |
91 void CMPXVideoViewWrapper::ConstructL() |
92 { |
92 { |
93 MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::ConstructL()")); |
93 MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::ConstructL()")); |
94 |
94 |
|
95 // |
|
96 // Get an instance of collection utility |
|
97 // Used for the Collection Observer to get the MediaL callbacks |
|
98 // |
|
99 iCollectionUtility = MMPXCollectionUtility::NewL( this ); |
|
100 |
|
101 // |
|
102 // Create Active Object for closing player |
|
103 // |
|
104 iCloseAO = CIdle::NewL( CActive::EPriorityStandard ); |
95 |
105 |
96 // |
106 // |
97 // Get the playback utility instance from playback utility |
107 // Get the playback utility instance from playback utility |
98 // |
108 // |
99 iPlaybackUtility = |
109 iPlaybackUtility = |
100 MMPXPlaybackUtility::UtilityL( EMPXCategoryVideo, KPbModeDefault ); |
110 MMPXPlaybackUtility::UtilityL( EMPXCategoryVideo, KPbModeDefault ); |
101 iPlaybackUtility->AddObserverL( *this ); |
|
102 iPlaybackUtility->SetPrimaryClientL(); |
111 iPlaybackUtility->SetPrimaryClientL(); |
103 |
112 } |
104 // |
113 |
105 // Get an instance of collection utility |
114 // ------------------------------------------------------------------------------------------------- |
106 // Used for the Collection Observer to get the MediaL callbacks |
115 // CMPXVideoViewWrapper::ActivateL() |
107 // |
116 // ------------------------------------------------------------------------------------------------- |
108 iCollectionUtility = MMPXCollectionUtility::NewL( this ); |
117 // |
109 |
118 void CMPXVideoViewWrapper::ActivateL() |
110 // |
119 { |
111 // Create Active Object for closing player |
120 MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::ActivateL()")); |
112 // |
121 |
113 iCloseAO = CIdle::NewL( CActive::EPriorityStandard ); |
122 if ( iPlaybackUtility ) |
|
123 { |
|
124 iPlaybackUtility->AddObserverL( *this ); |
|
125 } |
114 |
126 |
115 // |
127 // |
116 // Create Video Playback Display Handler |
128 // Create Video Playback Display Handler |
117 // |
129 // |
118 iDisplayHandler = CVideoPlaybackDisplayHandler::NewL( iPlaybackUtility, this ); |
130 iDisplayHandler = CVideoPlaybackDisplayHandler::NewL( iPlaybackUtility, this ); |
127 // |
139 // |
128 iUserInputHandler = CVideoPlaybackUserInputHandler::NewL( this ); |
140 iUserInputHandler = CVideoPlaybackUserInputHandler::NewL( this ); |
129 } |
141 } |
130 |
142 |
131 // ------------------------------------------------------------------------------------------------- |
143 // ------------------------------------------------------------------------------------------------- |
132 // CMPXVideoViewWrapper::~CMPXVideoViewWrapper() |
144 // CMPXVideoViewWrapper::DeactivateL() |
133 // ------------------------------------------------------------------------------------------------- |
145 // ------------------------------------------------------------------------------------------------- |
134 // |
146 // |
135 CMPXVideoViewWrapper::~CMPXVideoViewWrapper() |
147 void CMPXVideoViewWrapper::Deactivate() |
136 { |
148 { |
137 MPX_DEBUG(_L("CMPXVideoViewWrapper::~CMPXVideoViewWrapper()")); |
149 MPX_DEBUG(_L("CMPXVideoViewWrapper::Deactivate()")); |
138 |
150 |
139 // |
151 // |
140 // Delete the display handler when the view is deactivated |
152 // Delete the display handler when the view is deactivated |
141 // |
153 // |
142 if ( iDisplayHandler ) |
154 if ( iDisplayHandler ) |
155 { |
167 { |
156 delete iControlsController; |
168 delete iControlsController; |
157 iControlsController = NULL; |
169 iControlsController = NULL; |
158 } |
170 } |
159 |
171 |
|
172 if ( iFileDetails ) |
|
173 { |
|
174 delete iFileDetails; |
|
175 iFileDetails = NULL; |
|
176 } |
|
177 |
|
178 if ( iPlaybackUtility ) |
|
179 { |
|
180 iPlaybackUtility->CancelRequest(); |
|
181 TRAP_IGNORE( iPlaybackUtility->RemoveObserverL( *this ) ); |
|
182 } |
|
183 } |
|
184 |
|
185 // ------------------------------------------------------------------------------------------------- |
|
186 // CMPXVideoViewWrapper::~CMPXVideoViewWrapper() |
|
187 // ------------------------------------------------------------------------------------------------- |
|
188 // |
|
189 CMPXVideoViewWrapper::~CMPXVideoViewWrapper() |
|
190 { |
|
191 MPX_DEBUG(_L("CMPXVideoViewWrapper::~CMPXVideoViewWrapper()")); |
|
192 |
160 if ( iCloseAO ) |
193 if ( iCloseAO ) |
161 { |
194 { |
162 delete iCloseAO; |
195 delete iCloseAO; |
163 iCloseAO = NULL; |
196 iCloseAO = NULL; |
164 } |
197 } |
165 |
198 |
166 if ( iFileDetails ) |
199 if ( iCollectionUtility ) |
167 { |
200 { |
168 delete iFileDetails; |
201 iCollectionUtility->Close(); |
169 iFileDetails = NULL; |
|
170 } |
202 } |
171 |
203 |
172 if ( iPlaybackUtility ) |
204 if ( iPlaybackUtility ) |
173 { |
205 { |
174 TRAP_IGNORE( iPlaybackUtility->RemoveObserverL( *this ) ); |
|
175 iPlaybackUtility->Close(); |
206 iPlaybackUtility->Close(); |
176 iPlaybackUtility = NULL; |
207 iPlaybackUtility = NULL; |
177 } |
|
178 |
|
179 if ( iCollectionUtility ) |
|
180 { |
|
181 iCollectionUtility->Close(); |
|
182 } |
208 } |
183 } |
209 } |
184 |
210 |
185 // ------------------------------------------------------------------------------------------------- |
211 // ------------------------------------------------------------------------------------------------- |
186 // CMPXVideoViewWrapper::IsLive() |
212 // CMPXVideoViewWrapper::IsLive() |