diff --git a/app/(auth)/(tabs)/(home)/downloads/index.tsx b/app/(auth)/(tabs)/(home)/downloads/index.tsx
index f82e1b13..9ba684e2 100644
--- a/app/(auth)/(tabs)/(home)/downloads/index.tsx
+++ b/app/(auth)/(tabs)/(home)/downloads/index.tsx
@@ -13,6 +13,7 @@ import { useRouter } from "expo-router";
import { useCallback, useMemo } from "react";
import {
ActivityIndicator,
+ Platform,
RefreshControl,
ScrollView,
TouchableOpacity,
@@ -222,9 +223,15 @@ export default function Index() {
tintColor="#9334E9"
backgroundColor="#bdc3c7"
/>
-
- {(progress * 100).toFixed(0)}%
-
+ {Platform.OS === "ios" ? (
+
+ {(progress * 100).toFixed(0)}%
+
+ ) : (
+
+ {(progress * 100).toFixed(0)}%
+
+ )}
)}
diff --git a/modules/hls-downloader/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar b/modules/hls-downloader/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar
index dddf760b..184c8883 100644
Binary files a/modules/hls-downloader/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar and b/modules/hls-downloader/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar differ
diff --git a/modules/hls-downloader/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar b/modules/hls-downloader/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar
index a8dfee24..c72abcf3 100644
Binary files a/modules/hls-downloader/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar and b/modules/hls-downloader/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab
index 09096053..a7441e4c 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at
index 20a30a55..21530005 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab
index 2d413c18..c77d81e8 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at
index 850852da..b7011bcb 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab
index 2fab24e0..8fb9c816 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at
index c272a17d..3c38e72a 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab
index ea3cc30d..75e347ee 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at
index 1108e424..55fc4564 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab
index d15562c8..7b0087ff 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at
index 3bfe996f..b5fd38c9 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab
index 133cb90f..043dc6f3 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at
index ffaf651d..8487570a 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab
index fc937879..33d6f721 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at
index b16c7162..78c3fec2 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab
index 9b705a47..38fa7361 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at
index 11f4b13b..cb904ad6 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab
index 0737472a..3a4beb90 100644
--- a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab
+++ b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab
@@ -1,2 +1,2 @@
-10
+14
0
\ No newline at end of file
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab
index c188e64a..63f042e7 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at
index 263bcd3c..add58948 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab
index 96acd5c8..dde45324 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream
index 8ad02ff9..bf06e376 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len
index c15663dd..46715fa2 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len
index fd5292d4..003bc0eb 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at
index 2d47b43d..fc5c8185 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i
index 5f2acb46..a131b895 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab
index 4382b741..0dddf28f 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream
index 5f905e64..de9a850e 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len
index 9c1e85c7..bd9881d8 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len
index e66d94da..26797814 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at
index ec8142cb..b2e8c79f 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i
index 6fcc6739..a6925082 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin
index 9d5f4b2e..f30d74cc 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin
index 142660aa..74962d47 100644
Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin differ
diff --git a/modules/hls-downloader/android/build/kotlin/kaptGenerateStubsDebugKotlin/cacheable/last-build.bin b/modules/hls-downloader/android/build/kotlin/kaptGenerateStubsDebugKotlin/cacheable/last-build.bin
index 5231507f..5fabf23f 100644
Binary files a/modules/hls-downloader/android/build/kotlin/kaptGenerateStubsDebugKotlin/cacheable/last-build.bin and b/modules/hls-downloader/android/build/kotlin/kaptGenerateStubsDebugKotlin/cacheable/last-build.bin differ
diff --git a/modules/hls-downloader/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin b/modules/hls-downloader/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin
index f6699410..e5b5fe71 100644
Binary files a/modules/hls-downloader/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin and b/modules/hls-downloader/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin differ
diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$DownloadMetadata.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$DownloadMetadata.class
index 07d39249..c5938cce 100644
Binary files a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$DownloadMetadata.class and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$DownloadMetadata.class differ
diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$1$1$1.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$1$1$1.class
index b208bde3..6f5557ac 100644
Binary files a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$1$1$1.class and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$1$1$1.class differ
diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$6$$inlined$Function$4.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$6$$inlined$Function$4.class
index 81825866..a6f05263 100644
Binary files a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$6$$inlined$Function$4.class and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$6$$inlined$Function$4.class differ
diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$6$$inlined$Function$6.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$6$$inlined$Function$6.class
index 53ab50a1..d01cead2 100644
Binary files a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$6$$inlined$Function$6.class and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$6$$inlined$Function$6.class differ
diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$6$$inlined$FunctionWithoutArgs$1.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$6$$inlined$FunctionWithoutArgs$1.class
index 6c1625ad..2fde2c13 100644
Binary files a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$6$$inlined$FunctionWithoutArgs$1.class and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$6$$inlined$FunctionWithoutArgs$1.class differ
diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$6$$inlined$OnCreate$1.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$6$$inlined$OnCreate$1.class
index 67f4407c..9c6a9340 100644
Binary files a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$6$$inlined$OnCreate$1.class and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$6$$inlined$OnCreate$1.class differ
diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule.class
index 2014e658..9da700cd 100644
Binary files a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule.class and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule.class differ
diff --git a/modules/hls-downloader/android/src/main/java/expo/modules/hls-downloader/HlsDownloaderModule.kt b/modules/hls-downloader/android/src/main/java/expo/modules/hls-downloader/HlsDownloaderModule.kt
index 3a3cd55a..0b39f3c2 100644
--- a/modules/hls-downloader/android/src/main/java/expo/modules/hls-downloader/HlsDownloaderModule.kt
+++ b/modules/hls-downloader/android/src/main/java/expo/modules/hls-downloader/HlsDownloaderModule.kt
@@ -14,6 +14,8 @@ import expo.modules.kotlin.modules.Module
import expo.modules.kotlin.modules.ModuleDefinition
import org.json.JSONObject
import java.io.File
+import java.io.FileInputStream
+import java.io.FileOutputStream
import java.util.concurrent.Executors
class HlsDownloaderModule : Module() {
@@ -104,6 +106,9 @@ class HlsDownloaderModule : Module() {
}
}
+ // Convert .v3.exo files to .ts files
+ convertExoToTs(providerDir)
+
// Generate the .m3u8 playlist
createM3U8Playlist(context, metadata.providedId)
@@ -295,66 +300,113 @@ class HlsDownloaderModule : Module() {
}
private fun createM3U8Playlist(context: Context, providerId: String) {
- val providerDir = File(context.filesDir, "downloads/$providerId")
+ val providerDir = File(context.filesDir, "downloads/$providerId")
- // Check if the provider directory exists
- if (!providerDir.exists() || !providerDir.isDirectory) {
- android.util.Log.e("M3U8", "Provider directory does not exist: ${providerDir.absolutePath}")
- return
- }
-
- // List all subfolders (0/, 1/, 2/, etc.)
- val subFolders = providerDir.listFiles { file ->
- file.isDirectory && file.name.matches(Regex("\\d+")) // Match folders with numeric names
- }
-
- if (subFolders.isNullOrEmpty()) {
- android.util.Log.e("M3U8", "No subfolders found in ${providerDir.absolutePath}")
- return
- }
-
- // Collect all .v3.exo files from subfolders
- val segmentFiles = mutableListOf()
- subFolders.forEach { folder ->
- val filesInFolder = folder.listFiles { file ->
- file.isFile && file.name.endsWith(".v3.exo")
- }
- if (!filesInFolder.isNullOrEmpty()) {
- segmentFiles.addAll(filesInFolder)
- }
- }
-
- if (segmentFiles.isEmpty()) {
- android.util.Log.e("M3U8", "No .v3.exo files found in any subfolder")
- return
- }
-
- // Sort files by their numeric names (e.g., 102.124532.v3.exo)
- val sortedFiles = segmentFiles.sortedBy { file ->
- file.nameWithoutExtension.toDoubleOrNull() ?: 0.0
- }
-
- // Create the .m3u8 file
- val m3u8File = File(providerDir, "playlist.m3u8")
- m3u8File.bufferedWriter().use { writer ->
- // Write the M3U8 header
- writer.write("#EXTM3U\n")
- writer.write("#EXT-X-VERSION:3\n")
- writer.write("#EXT-X-TARGETDURATION:10\n") // Adjust target duration as needed
- writer.write("#EXT-X-MEDIA-SEQUENCE:0\n") // Start sequence from 0
-
- // Write each segment with absolute path
- sortedFiles.forEach { file ->
- val segmentDuration = 10.0 // Adjust segment duration as needed
- val absolutePath = "file://${file.absolutePath}" // Add file:// prefix and use absolute path
- writer.write("#EXTINF:$segmentDuration,\n")
- writer.write("$absolutePath\n") // Use absolute path instead of relative
+ // Check if the provider directory exists
+ if (!providerDir.exists() || !providerDir.isDirectory) {
+ android.util.Log.e("M3U8", "Provider directory does not exist: ${providerDir.absolutePath}")
+ return
}
- // Write the end tag
- writer.write("#EXT-X-ENDLIST\n")
+ // List all subfolders (0/, 1/, 2/, etc.)
+ val subFolders = providerDir.listFiles { file ->
+ file.isDirectory && file.name.matches(Regex("\\d+")) // Match folders with numeric names
+ }
+
+ if (subFolders.isNullOrEmpty()) {
+ android.util.Log.e("M3U8", "No subfolders found in ${providerDir.absolutePath}")
+ return
+ }
+
+ // Minimum file size for a valid video segment (e.g., 1 KB)
+ val MIN_FILE_SIZE_BYTES = 1024
+
+ // Collect all .ts files from subfolders
+ val segmentFiles = mutableListOf()
+ subFolders.forEach { folder ->
+ val filesInFolder = folder.listFiles { file ->
+ file.isFile && file.name.endsWith(".ts") && file.length() >= MIN_FILE_SIZE_BYTES
+ }
+ if (!filesInFolder.isNullOrEmpty()) {
+ segmentFiles.addAll(filesInFolder)
+ }
+ }
+
+ if (segmentFiles.isEmpty()) {
+ android.util.Log.e("M3U8", "No valid .ts files found in any subfolder")
+ return
+ }
+
+ // Sort files by their numeric names (e.g., 102.124532.ts)
+ val sortedFiles = segmentFiles.sortedBy { file ->
+ file.nameWithoutExtension.toDoubleOrNull() ?: 0.0
+ }
+
+ // Create the .m3u8 file
+ val m3u8File = File(providerDir, "playlist.m3u8")
+ m3u8File.bufferedWriter().use { writer ->
+ // Write the M3U8 header
+ writer.write("#EXTM3U\n")
+ writer.write("#EXT-X-VERSION:3\n")
+ writer.write("#EXT-X-TARGETDURATION:10\n") // Adjust target duration as needed
+ writer.write("#EXT-X-MEDIA-SEQUENCE:0\n") // Start sequence from 0
+
+ // Write each segment with absolute path
+ sortedFiles.forEach { file ->
+ val segmentDuration = 10.0 // Adjust segment duration as needed
+ val absolutePath = "file://${file.absolutePath}" // Add file:// prefix and use absolute path
+ writer.write("#EXTINF:$segmentDuration,\n")
+ writer.write("$absolutePath\n") // Use absolute path instead of relative
+ }
+
+ // Write the end tag
+ writer.write("#EXT-X-ENDLIST\n")
+ }
+
+ android.util.Log.d("M3U8", "Playlist created at: ${m3u8File.absolutePath}")
}
- android.util.Log.d("M3U8", "Playlist created at: ${m3u8File.absolutePath}")
-}
+ private fun convertExoToTs(providerDir: File) {
+ // List all subfolders (0/, 1/, 2/, etc.)
+ val subFolders = providerDir.listFiles { file ->
+ file.isDirectory && file.name.matches(Regex("\\d+")) // Match folders with numeric names
+ }
+
+ if (subFolders.isNullOrEmpty()) {
+ android.util.Log.e("ConvertExoToTs", "No subfolders found in ${providerDir.absolutePath}")
+ return
+ }
+
+ // Minimum file size for a valid video segment (e.g., 16 KB)
+ val MIN_FILE_SIZE_BYTES = 16 * 1024
+
+ // Convert .v3.exo files to .ts files
+ subFolders.forEach { folder ->
+ val exoFiles = folder.listFiles { file ->
+ file.isFile && file.name.endsWith(".v3.exo") && file.length() >= MIN_FILE_SIZE_BYTES
+ }
+
+ exoFiles?.forEach { exoFile ->
+ val tsFile = File(folder, "${exoFile.nameWithoutExtension}.ts")
+ try {
+ // Copy the contents of the .v3.exo file to the .ts file
+ FileInputStream(exoFile).use { input ->
+ FileOutputStream(tsFile).use { output ->
+ input.copyTo(output)
+ }
+ }
+ android.util.Log.d("ConvertExoToTs", "Converted ${exoFile.name} to ${tsFile.name}")
+
+ // Delete the .v3.exo file after conversion
+ if (exoFile.delete()) {
+ android.util.Log.d("ConvertExoToTs", "Deleted ${exoFile.name}")
+ } else {
+ android.util.Log.e("ConvertExoToTs", "Failed to delete ${exoFile.name}")
+ }
+ } catch (e: Exception) {
+ android.util.Log.e("ConvertExoToTs", "Failed to convert ${exoFile.name} to .ts", e)
+ }
+ }
+ }
+ }
}
\ No newline at end of file