| 
									
										
										
										
											2018-03-01 23:38:38 +01:00
										 |  |  | #import <AVFoundation/AVFoundation.h>
 | 
					
						
							| 
									
										
										
										
											2023-12-07 08:47:40 +01:00
										 |  |  | #import <CommonCrypto/CommonDigest.h>
 | 
					
						
							|  |  |  | #import <Foundation/Foundation.h>
 | 
					
						
							| 
									
										
										
										
											2018-03-01 23:38:38 +01:00
										 |  |  | #import <SPTPersistentCache/SPTPersistentCache.h>
 | 
					
						
							|  |  |  | #import <SPTPersistentCache/SPTPersistentCacheOptions.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-06 10:40:11 +02:00
										 |  |  | typedef NS_ENUM(NSUInteger, RCTVideoCacheStatus) { | 
					
						
							|  |  |  |   RCTVideoCacheStatusMissingFileExtension, | 
					
						
							|  |  |  |   RCTVideoCacheStatusUnsupportedFileExtension, | 
					
						
							|  |  |  |   RCTVideoCacheStatusNotAvailable, | 
					
						
							|  |  |  |   RCTVideoCacheStatusAvailable | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-01 23:38:38 +01:00
										 |  |  | @class SPTPersistentCache; | 
					
						
							|  |  |  | @class SPTPersistentCacheOptions; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-07 08:47:40 +01:00
										 |  |  | @interface RCTVideoCache : NSObject { | 
					
						
							|  |  |  |   SPTPersistentCache* videoCache; | 
					
						
							|  |  |  |   NSString* _Nullable cachePath; | 
					
						
							|  |  |  |   NSString* temporaryCachePath; | 
					
						
							|  |  |  |   NSString* _Nullable cacheIdentifier; | 
					
						
							| 
									
										
										
										
											2018-03-01 23:38:38 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-07 08:47:40 +01:00
										 |  |  | @property(nonatomic, strong) SPTPersistentCache* _Nullable videoCache; | 
					
						
							|  |  |  | @property(nonatomic, strong) NSString* cachePath; | 
					
						
							|  |  |  | @property(nonatomic, strong) NSString* cacheIdentifier; | 
					
						
							|  |  |  | @property(nonatomic, strong) NSString* temporaryCachePath; | 
					
						
							| 
									
										
										
										
											2018-03-01 23:38:38 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-07 08:47:40 +01:00
										 |  |  | + (RCTVideoCache*)sharedInstance; | 
					
						
							|  |  |  | - (void)storeItem:(NSData*)data forUri:(NSString*)uri withCallback:(void (^)(BOOL))handler; | 
					
						
							|  |  |  | - (void)getItemForUri:(NSString*)url withCallback:(void (^)(RCTVideoCacheStatus, AVAsset* _Nullable))handler; | 
					
						
							|  |  |  | - (NSURL*)createUniqueTemporaryFileUrl:(NSString* _Nonnull)url withExtension:(NSString* _Nonnull)extension; | 
					
						
							|  |  |  | - (AVURLAsset*)getItemFromTemporaryStorage:(NSString*)key; | 
					
						
							|  |  |  | - (BOOL)saveDataToTemporaryStorage:(NSData*)data key:(NSString*)key; | 
					
						
							|  |  |  | - (void)createTemporaryPath; | 
					
						
							| 
									
										
										
										
											2018-03-01 23:38:38 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | @end |