13 * |
13 * |
14 * Description: class for MPX Video File Details |
14 * Description: class for MPX Video File Details |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 // Version : %version: e003sa33#7 % |
18 // Version : %version: e003sa33#8 % |
19 |
19 |
20 |
20 |
21 // |
21 // |
22 // INCLUDE FILES |
22 // INCLUDE FILES |
23 // |
23 // |
24 #include <f32file.h> |
24 #include <f32file.h> |
|
25 #include <uri16.h> |
25 |
26 |
26 #include "mpxvideo_debug.h" |
27 #include "mpxvideo_debug.h" |
27 #include "mpxvideoplaybackviewfiledetails.h" |
28 #include "mpxvideoplaybackviewfiledetails.h" |
28 |
29 |
29 // ============================ MEMBER FUNCTIONS =================================================== |
30 // ============================ MEMBER FUNCTIONS =================================================== |
114 } |
115 } |
115 |
116 |
116 return fileName; |
117 return fileName; |
117 } |
118 } |
118 |
119 |
|
120 // ------------------------------------------------------------------------------------------------- |
|
121 // CMPXVideoPlaybackViewFileDetails::GenerateFileTitleL |
|
122 // ------------------------------------------------------------------------------------------------- |
|
123 // |
|
124 EXPORT_C HBufC* CMPXVideoPlaybackViewFileDetails::GenerateFileTitleL() |
|
125 { |
|
126 MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackViewFileDetails::GenerateFileTitleL()" ) ); |
|
127 |
|
128 HBufC* fileTitle = NULL; |
|
129 |
|
130 if ( iTitle && iTitle->Length() ) |
|
131 { |
|
132 // |
|
133 // use file title in metadata as title cotent directly |
|
134 // |
|
135 fileTitle = iTitle->AllocL(); |
|
136 } |
|
137 else if ( ( EMPXVideoStreaming == iPlaybackMode || EMPXVideoLiveStreaming == iPlaybackMode ) && |
|
138 iClipName && iClipName->Length() ) |
|
139 { |
|
140 // |
|
141 // parse file name in URL |
|
142 // |
|
143 TUriParser parser; |
|
144 |
|
145 if ( parser.Parse( iClipName->Des() ) == KErrNone ) |
|
146 { |
|
147 |
|
148 MPX_DEBUG( |
|
149 _L( " streaming link: schema = %S, urihost = %S, uriPort = %S, uriPath = %S" ), |
|
150 &( parser.Extract( EUriScheme ) ), |
|
151 &( parser.Extract( EUriHost ) ), |
|
152 &( parser.Extract( EUriPort ) ), |
|
153 &( parser.Extract( EUriPath ) ) ); |
|
154 |
|
155 HBufC* nameAndTail = NULL; |
|
156 |
|
157 MPX_TRAPD( err, nameAndTail = parser.GetFileNameL( EUriFileNameTail ) ); |
|
158 |
|
159 if ( KErrNone == err && nameAndTail ) |
|
160 { |
|
161 CleanupStack::PushL( nameAndTail ); |
|
162 TInt extPos = nameAndTail->Des().LocateReverse( KExtDelimiter ); |
|
163 |
|
164 if ( extPos > 0 ) |
|
165 { |
|
166 fileTitle = ( nameAndTail->Des().Left( extPos ) ).AllocL(); |
|
167 } |
|
168 else |
|
169 { |
|
170 fileTitle = nameAndTail->Des().AllocL(); |
|
171 } |
|
172 |
|
173 CleanupStack::PopAndDestroy( nameAndTail ); |
|
174 } |
|
175 } |
|
176 } |
|
177 |
|
178 return fileTitle; |
|
179 } |
|
180 |
119 // EOF |
181 // EOF |