@@ -45,15 +45,19 @@ registerNativeHandlers({
4545 const results = await MediaLibrary . getAssetsAsync ( {
4646 after,
4747 first,
48- mediaType : [ MediaLibrary . MediaType . photo ] ,
48+ mediaType : [ MediaLibrary . MediaType . photo , MediaLibrary . MediaType . video ] ,
4949 } ) ;
5050 const assets = results . assets . map ( ( asset ) => ( {
51+ duration : asset . duration ,
52+ filename : asset . filename ,
5153 height : asset . height ,
5254 id : asset . id ,
5355 source : 'picker' ,
56+ type : asset . mediaType ,
5457 uri : asset . uri ,
5558 width : asset . width ,
5659 } ) ) ;
60+
5761 const hasNextPage = results . hasNextPage ;
5862 const endCursor = results . endCursor ;
5963 return { assets, endCursor, hasNextPage } ;
@@ -155,12 +159,13 @@ registerNativeHandlers({
155159 // https://github.com/ivpusic/react-native-image-crop-picker/issues/901
156160 // This we can't rely on them as it is, and we need to use Image.getSize
157161 // to get accurate size.
158- const getSize = ( ) => new Promise ( ( resolve ) => {
159- Image . getSize ( photo . uri , ( width , height ) => {
160- resolve ( { height, width} ) ;
162+ const getSize = ( ) =>
163+ new Promise ( ( resolve ) => {
164+ Image . getSize ( photo . uri , ( width , height ) => {
165+ resolve ( { height, width } ) ;
166+ } ) ;
161167 } ) ;
162- } ) ;
163-
168+
164169 try {
165170 const { height, width } = await getSize ( ) ;
166171 size . height = height ;
@@ -175,12 +180,12 @@ registerNativeHandlers({
175180 width : photo . width ,
176181 } ;
177182 }
178-
183+
179184 return {
180185 cancelled : false ,
181186 source : 'camera' ,
182187 uri : photo . uri ,
183- ...size
188+ ...size ,
184189 } ;
185190 }
186191 }
0 commit comments