@stepincto/expo-video 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -210,6 +210,15 @@ extension VideoCacheManager {
210
210
  let fileUrl = URL(fileURLWithPath: saveFilePath)
211
211
  let mediaInfoPath = saveFilePath + VideoCacheManager.mediaInfoSuffix
212
212
 
213
+ // Ensure parent directory exists before writing file
214
+ let parentDir = fileUrl.deletingLastPathComponent()
215
+ do {
216
+ try FileManager.default.createDirectory(at: parentDir, withIntermediateDirectories: true)
217
+ } catch {
218
+ print("[expo-video] Failed to create parent directory for cache file: \(error)")
219
+ throw error
220
+ }
221
+
213
222
  let (data, response) = try await URLSession.shared.data(from: url)
214
223
  try data.write(to: fileUrl, options: .atomic)
215
224
 
@@ -253,10 +262,13 @@ extension VideoCacheManager {
253
262
  let fileUrl = URL(fileURLWithPath: saveFilePath)
254
263
  let mediaInfoPath = saveFilePath + VideoCacheManager.mediaInfoSuffix
255
264
 
256
- // Ensure the cache directory exists (same as VideoAsset)
257
- if let cacheDir = try? FileManager.default.url(for: .cachesDirectory, in: .userDomainMask, appropriateFor: nil, create: true) {
258
- let videoCacheDir = cacheDir.appendingPathComponent(VideoCacheManager.expoVideoCacheScheme, isDirectory: true)
259
- try? FileManager.default.createDirectory(at: videoCacheDir, withIntermediateDirectories: true)
265
+ // Ensure parent directory exists before writing file
266
+ let parentDir = fileUrl.deletingLastPathComponent()
267
+ do {
268
+ try FileManager.default.createDirectory(at: parentDir, withIntermediateDirectories: true)
269
+ } catch {
270
+ print("[expo-video] Failed to create parent directory for cache file: \(error)")
271
+ throw error
260
272
  }
261
273
 
262
274
  // Ensure the file exists before opening for writing
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stepincto/expo-video",
3
3
  "title": "Expo Video",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "originalUpstreamVersion": "2.2.2",
6
6
  "description": "A cross-platform, performant video component for React Native and Expo with Web support",
7
7
  "main": "build/index.js",