diff --git a/modules/hls-downloader/android/build/.transforms/2e41d3fd159f6e89c238fe930efb8a95/results.bin b/modules/hls-downloader/android/build/.transforms/2e41d3fd159f6e89c238fe930efb8a95/results.bin
new file mode 100644
index 00000000..0d259ddc
--- /dev/null
+++ b/modules/hls-downloader/android/build/.transforms/2e41d3fd159f6e89c238fe930efb8a95/results.bin
@@ -0,0 +1 @@
+o/classes
diff --git a/modules/hls-downloader/android/build/.transforms/2e41d3fd159f6e89c238fe930efb8a95/transformed/classes/classes_dex/classes.dex b/modules/hls-downloader/android/build/.transforms/2e41d3fd159f6e89c238fe930efb8a95/transformed/classes/classes_dex/classes.dex
new file mode 100644
index 00000000..d2409ea8
Binary files /dev/null and b/modules/hls-downloader/android/build/.transforms/2e41d3fd159f6e89c238fe930efb8a95/transformed/classes/classes_dex/classes.dex differ
diff --git a/modules/hls-downloader/android/build/.transforms/724eca190d8af75ae0783ab82a1c8138/results.bin b/modules/hls-downloader/android/build/.transforms/724eca190d8af75ae0783ab82a1c8138/results.bin
new file mode 100644
index 00000000..0d259ddc
--- /dev/null
+++ b/modules/hls-downloader/android/build/.transforms/724eca190d8af75ae0783ab82a1c8138/results.bin
@@ -0,0 +1 @@
+o/classes
diff --git a/modules/hls-downloader/android/build/.transforms/724eca190d8af75ae0783ab82a1c8138/transformed/classes/classes_dex/classes.dex b/modules/hls-downloader/android/build/.transforms/724eca190d8af75ae0783ab82a1c8138/transformed/classes/classes_dex/classes.dex
new file mode 100644
index 00000000..6934281b
Binary files /dev/null and b/modules/hls-downloader/android/build/.transforms/724eca190d8af75ae0783ab82a1c8138/transformed/classes/classes_dex/classes.dex differ
diff --git a/modules/hls-downloader/android/build/generated/source/buildConfig/debug/expo/modules/hlsdownloader/BuildConfig.java b/modules/hls-downloader/android/build/generated/source/buildConfig/debug/expo/modules/hlsdownloader/BuildConfig.java
new file mode 100644
index 00000000..a35f8239
--- /dev/null
+++ b/modules/hls-downloader/android/build/generated/source/buildConfig/debug/expo/modules/hlsdownloader/BuildConfig.java
@@ -0,0 +1,10 @@
+/**
+ * Automatically generated file. DO NOT MODIFY
+ */
+package expo.modules.hlsdownloader;
+
+public final class BuildConfig {
+ public static final boolean DEBUG = Boolean.parseBoolean("true");
+ public static final String LIBRARY_PACKAGE_NAME = "expo.modules.hlsdownloader";
+ public static final String BUILD_TYPE = "debug";
+}
diff --git a/modules/hls-downloader/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml b/modules/hls-downloader/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml
new file mode 100644
index 00000000..36a67229
--- /dev/null
+++ b/modules/hls-downloader/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/hls-downloader/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json b/modules/hls-downloader/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json
new file mode 100644
index 00000000..5ea4256a
--- /dev/null
+++ b/modules/hls-downloader/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json
@@ -0,0 +1,18 @@
+{
+ "version": 3,
+ "artifactType": {
+ "type": "AAPT_FRIENDLY_MERGED_MANIFESTS",
+ "kind": "Directory"
+ },
+ "applicationId": "expo.modules.hlsdownloader",
+ "variantName": "debug",
+ "elements": [
+ {
+ "type": "SINGLE",
+ "filters": [],
+ "attributes": [],
+ "outputFile": "AndroidManifest.xml"
+ }
+ ],
+ "elementType": "File"
+}
\ No newline at end of file
diff --git a/modules/hls-downloader/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties b/modules/hls-downloader/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties
new file mode 100644
index 00000000..1211b1ef
--- /dev/null
+++ b/modules/hls-downloader/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties
@@ -0,0 +1,6 @@
+aarFormatVersion=1.0
+aarMetadataVersion=1.0
+minCompileSdk=1
+minCompileSdkExtension=0
+minAndroidGradlePluginVersion=1.0.0
+coreLibraryDesugaringEnabled=false
diff --git a/modules/hls-downloader/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json b/modules/hls-downloader/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json
new file mode 100644
index 00000000..9e26dfee
--- /dev/null
+++ b/modules/hls-downloader/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file
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
new file mode 100644
index 00000000..e7164188
Binary files /dev/null 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/compile_r_class_jar/debug/generateDebugRFile/R.jar b/modules/hls-downloader/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar
new file mode 100644
index 00000000..bfcd5312
Binary files /dev/null and b/modules/hls-downloader/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar differ
diff --git a/modules/hls-downloader/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt b/modules/hls-downloader/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/modules/hls-downloader/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties b/modules/hls-downloader/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties
new file mode 100644
index 00000000..711618c5
--- /dev/null
+++ b/modules/hls-downloader/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties
@@ -0,0 +1 @@
+#Mon Feb 17 21:32:35 CET 2025
diff --git a/modules/hls-downloader/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml b/modules/hls-downloader/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml
new file mode 100644
index 00000000..3f02d693
--- /dev/null
+++ b/modules/hls-downloader/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/modules/hls-downloader/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml b/modules/hls-downloader/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml
new file mode 100644
index 00000000..b8576250
--- /dev/null
+++ b/modules/hls-downloader/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/modules/hls-downloader/android/build/intermediates/incremental/mergeDebugShaders/merger.xml b/modules/hls-downloader/android/build/intermediates/incremental/mergeDebugShaders/merger.xml
new file mode 100644
index 00000000..aef30554
--- /dev/null
+++ b/modules/hls-downloader/android/build/intermediates/incremental/mergeDebugShaders/merger.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/modules/hls-downloader/android/build/intermediates/incremental/packageDebugAssets/merger.xml b/modules/hls-downloader/android/build/intermediates/incremental/packageDebugAssets/merger.xml
new file mode 100644
index 00000000..9b7b3599
--- /dev/null
+++ b/modules/hls-downloader/android/build/intermediates/incremental/packageDebugAssets/merger.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/modules/hls-downloader/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/hls-downloader_debug.kotlin_module b/modules/hls-downloader/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/hls-downloader_debug.kotlin_module
new file mode 100644
index 00000000..c998a4c1
Binary files /dev/null and b/modules/hls-downloader/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/hls-downloader_debug.kotlin_module differ
diff --git a/modules/hls-downloader/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/expo/modules/hlsdownloader/BuildConfig.class b/modules/hls-downloader/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/expo/modules/hlsdownloader/BuildConfig.class
new file mode 100644
index 00000000..b1be8668
Binary files /dev/null and b/modules/hls-downloader/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/expo/modules/hlsdownloader/BuildConfig.class differ
diff --git a/modules/hls-downloader/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt b/modules/hls-downloader/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt
new file mode 100644
index 00000000..78ac5b8b
--- /dev/null
+++ b/modules/hls-downloader/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt
@@ -0,0 +1,2 @@
+R_DEF: Internal format may change without notice
+local
diff --git a/modules/hls-downloader/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt b/modules/hls-downloader/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt
new file mode 100644
index 00000000..7a200211
--- /dev/null
+++ b/modules/hls-downloader/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt
@@ -0,0 +1,7 @@
+1
+2
+4
+5
+6
+7
diff --git a/modules/hls-downloader/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml b/modules/hls-downloader/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml
new file mode 100644
index 00000000..36a67229
--- /dev/null
+++ b/modules/hls-downloader/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/hls-downloader/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json b/modules/hls-downloader/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/modules/hls-downloader/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/modules/hls-downloader/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt b/modules/hls-downloader/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt
new file mode 100644
index 00000000..08f4ebea
--- /dev/null
+++ b/modules/hls-downloader/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt
@@ -0,0 +1 @@
+0 Warning/Error
\ No newline at end of file
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
new file mode 100644
index 00000000..b46b5af4
Binary files /dev/null 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/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt b/modules/hls-downloader/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt
new file mode 100644
index 00000000..179ea2bc
--- /dev/null
+++ b/modules/hls-downloader/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt
@@ -0,0 +1 @@
+expo.modules.hlsdownloader
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
new file mode 100644
index 00000000..33b7f7cd
Binary files /dev/null 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.keystream b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream
new file mode 100644
index 00000000..5f98e378
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len
new file mode 100644
index 00000000..eb0b8a06
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len
new file mode 100644
index 00000000..2a17e6e5
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len 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
new file mode 100644
index 00000000..5cd73643
Binary files /dev/null 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/inputs/source-to-output.tab_i b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i
new file mode 100644
index 00000000..7995d4ab
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len
new file mode 100644
index 00000000..131e2657
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len 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
new file mode 100644
index 00000000..5e770f6b
Binary files /dev/null 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.keystream b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream
new file mode 100644
index 00000000..c5732317
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len
new file mode 100644
index 00000000..77d97e92
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len
new file mode 100644
index 00000000..01bdaa1d
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len 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
new file mode 100644
index 00000000..8f283275
Binary files /dev/null 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-attributes.tab_i b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i
new file mode 100644
index 00000000..37939be9
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len
new file mode 100644
index 00000000..131e2657
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len 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
new file mode 100644
index 00000000..bc5781f2
Binary files /dev/null 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.keystream b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream
new file mode 100644
index 00000000..c5732317
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len
new file mode 100644
index 00000000..77d97e92
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len
new file mode 100644
index 00000000..01bdaa1d
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len 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
new file mode 100644
index 00000000..294f85b1
Binary files /dev/null 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/class-fq-name-to-source.tab_i b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i
new file mode 100644
index 00000000..37939be9
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len
new file mode 100644
index 00000000..131e2657
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len 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
new file mode 100644
index 00000000..874b6135
Binary files /dev/null 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.keystream b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream
new file mode 100644
index 00000000..f943ad72
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len
new file mode 100644
index 00000000..4015edf0
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len
new file mode 100644
index 00000000..a5413564
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len 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
new file mode 100644
index 00000000..afad4946
Binary files /dev/null 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/internal-name-to-source.tab_i b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i
new file mode 100644
index 00000000..02b0b2ae
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len
new file mode 100644
index 00000000..131e2657
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len 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
new file mode 100644
index 00000000..1f4bc99c
Binary files /dev/null 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.keystream b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream
new file mode 100644
index 00000000..14fc4383
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len
new file mode 100644
index 00000000..64edc349
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len
new file mode 100644
index 00000000..a9f80ae0
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len 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
new file mode 100644
index 00000000..1f656cfc
Binary files /dev/null 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/proto.tab_i b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i
new file mode 100644
index 00000000..f77d2eeb
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len
new file mode 100644
index 00000000..131e2657
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len 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
new file mode 100644
index 00000000..7b02d32d
Binary files /dev/null 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.keystream b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream
new file mode 100644
index 00000000..5f98e378
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len
new file mode 100644
index 00000000..eb0b8a06
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len
new file mode 100644
index 00000000..2a17e6e5
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len 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
new file mode 100644
index 00000000..61af0969
Binary files /dev/null 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/source-to-classes.tab_i b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i
new file mode 100644
index 00000000..7995d4ab
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len
new file mode 100644
index 00000000..131e2657
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len 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
new file mode 100644
index 00000000..c47bebde
Binary files /dev/null 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.keystream b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream
new file mode 100644
index 00000000..093092c6
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len
new file mode 100644
index 00000000..68d7fbd8
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len
new file mode 100644
index 00000000..2a17e6e5
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len 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
new file mode 100644
index 00000000..8e8d8e9b
Binary files /dev/null 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/subtypes.tab_i b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i
new file mode 100644
index 00000000..006451f7
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len
new file mode 100644
index 00000000..131e2657
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len 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
new file mode 100644
index 00000000..8d6488cb
Binary files /dev/null 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.keystream b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream
new file mode 100644
index 00000000..0ea5da72
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len
new file mode 100644
index 00000000..8107e24f
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len
new file mode 100644
index 00000000..2a17e6e5
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len 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
new file mode 100644
index 00000000..09bf9512
Binary files /dev/null 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/jvm/kotlin/supertypes.tab_i b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i
new file mode 100644
index 00000000..36a4ce34
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len
new file mode 100644
index 00000000..131e2657
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len 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
new file mode 100644
index 00000000..2ceb12b8
--- /dev/null
+++ b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab
@@ -0,0 +1,2 @@
+2
+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
new file mode 100644
index 00000000..59667494
Binary files /dev/null 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.keystream b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream
new file mode 100644
index 00000000..5f98e378
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len
new file mode 100644
index 00000000..eb0b8a06
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len
new file mode 100644
index 00000000..2a17e6e5
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len 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
new file mode 100644
index 00000000..7d30a43b
Binary files /dev/null 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/file-to-id.tab_i b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i
new file mode 100644
index 00000000..7995d4ab
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i differ
diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len
new file mode 100644
index 00000000..131e2657
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len 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
new file mode 100644
index 00000000..7307770a
Binary files /dev/null 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
new file mode 100644
index 00000000..100d2055
Binary files /dev/null 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
new file mode 100644
index 00000000..ccfcbf41
Binary files /dev/null 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
new file mode 100644
index 00000000..01bdaa1d
Binary files /dev/null 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
new file mode 100644
index 00000000..fa33d74d
Binary files /dev/null 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
new file mode 100644
index 00000000..f768a77f
Binary files /dev/null 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/id-to-file.tab_i.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len
new file mode 100644
index 00000000..131e2657
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len 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
new file mode 100644
index 00000000..c2317e8d
Binary files /dev/null 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
new file mode 100644
index 00000000..d90fb12a
Binary files /dev/null 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
new file mode 100644
index 00000000..72f11198
Binary files /dev/null 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
new file mode 100644
index 00000000..fabe277e
Binary files /dev/null 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
new file mode 100644
index 00000000..556782b9
Binary files /dev/null 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
new file mode 100644
index 00000000..620f77d9
Binary files /dev/null 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/caches-jvm/lookups/lookups.tab_i.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len
new file mode 100644
index 00000000..131e2657
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len 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
new file mode 100644
index 00000000..21e0da1b
Binary files /dev/null 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
new file mode 100644
index 00000000..27b7ba31
Binary files /dev/null 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
new file mode 100644
index 00000000..75e672f7
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/kaptGenerateStubsDebugKotlin/cacheable/last-build.bin differ
diff --git a/modules/hls-downloader/android/build/kotlin/kaptGenerateStubsDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin b/modules/hls-downloader/android/build/kotlin/kaptGenerateStubsDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin
new file mode 100644
index 00000000..593f4708
Binary files /dev/null and b/modules/hls-downloader/android/build/kotlin/kaptGenerateStubsDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin differ
diff --git a/modules/hls-downloader/android/build/outputs/logs/manifest-merger-debug-report.txt b/modules/hls-downloader/android/build/outputs/logs/manifest-merger-debug-report.txt
new file mode 100644
index 00000000..37485683
--- /dev/null
+++ b/modules/hls-downloader/android/build/outputs/logs/manifest-merger-debug-report.txt
@@ -0,0 +1,14 @@
+-- Merging decision tree log ---
+manifest
+ADDED from /Users/fredrikburmester/Documents/GitHub/streamyfin/modules/hls-downloader/android/src/main/AndroidManifest.xml:1:1-2:12
+INJECTED from /Users/fredrikburmester/Documents/GitHub/streamyfin/modules/hls-downloader/android/src/main/AndroidManifest.xml:1:1-2:12
+ package
+ INJECTED from /Users/fredrikburmester/Documents/GitHub/streamyfin/modules/hls-downloader/android/src/main/AndroidManifest.xml
+uses-sdk
+INJECTED from /Users/fredrikburmester/Documents/GitHub/streamyfin/modules/hls-downloader/android/src/main/AndroidManifest.xml reason: use-sdk injection requested
+INJECTED from /Users/fredrikburmester/Documents/GitHub/streamyfin/modules/hls-downloader/android/src/main/AndroidManifest.xml
+INJECTED from /Users/fredrikburmester/Documents/GitHub/streamyfin/modules/hls-downloader/android/src/main/AndroidManifest.xml
+ android:targetSdkVersion
+ INJECTED from /Users/fredrikburmester/Documents/GitHub/streamyfin/modules/hls-downloader/android/src/main/AndroidManifest.xml
+ android:minSdkVersion
+ INJECTED from /Users/fredrikburmester/Documents/GitHub/streamyfin/modules/hls-downloader/android/src/main/AndroidManifest.xml
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
new file mode 100644
index 00000000..7fa163fa
Binary files /dev/null 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/META-INF/hls-downloader_debug.kotlin_module b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/META-INF/hls-downloader_debug.kotlin_module
new file mode 100644
index 00000000..c998a4c1
Binary files /dev/null and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/META-INF/hls-downloader_debug.kotlin_module 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
new file mode 100644
index 00000000..79b6a6b9
Binary files /dev/null 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
new file mode 100644
index 00000000..a97e44fd
Binary files /dev/null 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$7$$inlined$Function$1.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$1.class
new file mode 100644
index 00000000..dca41407
Binary files /dev/null and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$1.class differ
diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$2.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$2.class
new file mode 100644
index 00000000..2ef413d4
Binary files /dev/null and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$2.class differ
diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$3.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$3.class
new file mode 100644
index 00000000..ef67f5a4
Binary files /dev/null and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$3.class differ
diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$4.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$4.class
new file mode 100644
index 00000000..06ec9b57
Binary files /dev/null and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$4.class differ
diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$5.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$5.class
new file mode 100644
index 00000000..9817e298
Binary files /dev/null and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$5.class differ
diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$6.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$6.class
new file mode 100644
index 00000000..b5bc9b1a
Binary files /dev/null and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$6.class differ
diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$FunctionWithoutArgs$1.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$FunctionWithoutArgs$1.class
new file mode 100644
index 00000000..f82e9d9d
Binary files /dev/null and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$FunctionWithoutArgs$1.class differ
diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$OnCreate$1.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$OnCreate$1.class
new file mode 100644
index 00000000..afd848df
Binary files /dev/null and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$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
new file mode 100644
index 00000000..fa80bba0
Binary files /dev/null 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 7abcc29f..e11de9c1 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
@@ -1,206 +1,227 @@
-package com.example.hlsdownloader
+package expo.modules.hlsdownloader
import android.content.Context
import android.net.Uri
-import android.os.Handler
-import android.os.Looper
import androidx.media3.common.MediaItem
-import androidx.media3.common.util.UnstableApi
import androidx.media3.exoplayer.offline.Download
import androidx.media3.exoplayer.offline.DownloadManager
-import androidx.media3.exoplayer.offline.DownloadService
-import androidx.media3.datasource.DefaultHttpDataSource
-import androidx.media3.datasource.cache.SimpleCache
-import androidx.media3.datasource.cache.NoOpCacheEvictor
import androidx.media3.exoplayer.offline.DownloadRequest
-import com.facebook.react.bridge.ReactContext
-import com.facebook.react.modules.core.DeviceEventManagerModule
-import java.io.File
+import androidx.media3.datasource.DefaultHttpDataSource
+import androidx.media3.datasource.cache.NoOpCacheEvictor
+import androidx.media3.datasource.cache.SimpleCache
+import androidx.media3.database.StandaloneDatabaseProvider
+import expo.modules.kotlin.modules.Module
+import expo.modules.kotlin.modules.ModuleDefinition
import org.json.JSONObject
-import java.util.concurrent.ConcurrentHashMap
+import java.io.File
+import java.util.concurrent.Executors
-@UnstableApi
-class HlsDownloaderModule(private val context: ReactContext) {
- private val mainHandler = Handler(Looper.getMainLooper())
- private val downloadCache: SimpleCache
- private val downloadManager: DownloadManager
- private val activeDownloads = ConcurrentHashMap()
+class HlsDownloaderModule : Module() {
+ private var activeDownloads = mutableMapOf()
+ private lateinit var downloadManager: DownloadManager
+ private lateinit var downloadCache: SimpleCache
+ private val executor = Executors.newSingleThreadExecutor()
- data class DownloadInfo(
+ data class DownloadMetadata(
+ val providedId: String,
val metadata: Map,
- val startTime: Long,
- var downloadRequest: DownloadRequest? = null
+ val startTime: Long
)
- init {
- // Initialize download cache
- val downloadDirectory = File(context.filesDir, "downloads")
- if (!downloadDirectory.exists()) {
- downloadDirectory.mkdirs()
- }
-
- downloadCache = SimpleCache(
- downloadDirectory,
- NoOpCacheEvictor(),
- DefaultHttpDataSource.Factory()
+ override fun definition() = ModuleDefinition {
+ Name("HlsDownloader")
+
+ Events(
+ "onProgress",
+ "onError",
+ "onComplete"
)
- // Initialize download manager
- downloadManager = DownloadManager(
- context,
- createDatabaseProvider(),
- downloadCache,
- DefaultHttpDataSource.Factory(),
- null
- )
-
- // Start tracking downloads
- downloadManager.addListener(object : DownloadManager.Listener {
- override fun onDownloadChanged(
- downloadManager: DownloadManager,
- download: Download,
- finalException: Exception?
- ) {
- val downloadInfo = activeDownloads[download.request.id] ?: return
-
- when (download.state) {
- Download.STATE_DOWNLOADING -> {
- sendEvent("onProgress", mapOf(
- "id" to download.request.id,
- "progress" to (download.percentDownloaded / 100.0),
- "state" to "DOWNLOADING",
- "metadata" to downloadInfo.metadata,
- "startTime" to downloadInfo.startTime
- ))
- }
- Download.STATE_COMPLETED -> {
- handleCompletedDownload(download, downloadInfo)
- }
- Download.STATE_FAILED -> {
- handleFailedDownload(download, downloadInfo, finalException)
- }
- }
+ OnCreate {
+ val context = appContext.reactContext as Context
+ val cacheDir = File(context.getExternalFilesDir(null), "downloads")
+ if (!cacheDir.exists()) {
+ cacheDir.mkdirs()
}
- })
- }
- fun downloadHLSAsset(providedId: String, url: String, metadata: Map?) {
- val startTime = System.currentTimeMillis()
-
- // Check if download already exists
- val downloadDir = File(context.filesDir, "downloads/$providedId")
- if (downloadDir.exists() && downloadDir.list()?.any { it.endsWith(".m3u8") } == true) {
- sendEvent("onComplete", mapOf(
- "id" to providedId,
- "location" to downloadDir.absolutePath,
- "state" to "DONE",
- "metadata" to (metadata ?: emptyMap()),
- "startTime" to startTime
- ))
- return
- }
+ val databaseProvider = StandaloneDatabaseProvider(context)
+ downloadCache = SimpleCache(cacheDir, NoOpCacheEvictor(), databaseProvider)
- try {
- val mediaItem = MediaItem.fromUri(Uri.parse(url))
- val downloadRequest = DownloadRequest.Builder(providedId, mediaItem.mediaId)
- .setCustomCacheKey(providedId)
- .setData(metadata?.toString()?.toByteArray() ?: ByteArray(0))
- .build()
+ val dataSourceFactory = DefaultHttpDataSource.Factory()
+ .setUserAgent("MyApp/1.0")
+ .setAllowCrossProtocolRedirects(true)
- activeDownloads[providedId] = DownloadInfo(
- metadata = metadata ?: emptyMap(),
- startTime = startTime,
- downloadRequest = downloadRequest
+ downloadManager = DownloadManager(
+ context,
+ databaseProvider,
+ downloadCache,
+ dataSourceFactory,
+ executor
)
- downloadManager.addDownload(downloadRequest)
-
- sendEvent("onProgress", mapOf(
- "id" to providedId,
- "progress" to 0.0,
- "state" to "PENDING",
- "metadata" to (metadata ?: emptyMap()),
- "startTime" to startTime
- ))
- } catch (e: Exception) {
- sendEvent("onError", mapOf(
- "id" to providedId,
- "error" to e.localizedMessage,
- "state" to "FAILED",
- "metadata" to (metadata ?: emptyMap()),
- "startTime" to startTime
- ))
+ downloadManager.addListener(object : DownloadManager.Listener {
+ override fun onDownloadChanged(
+ downloadManager: DownloadManager,
+ download: Download,
+ finalException: Exception?
+ ) {
+ val metadata = activeDownloads[download.request.id]
+ if (metadata != null) {
+ when (download.state) {
+ Download.STATE_COMPLETED -> {
+ sendEvent(
+ "onComplete",
+ mapOf(
+ "id" to metadata.providedId,
+ "location" to download.request.uri.toString(),
+ "state" to "DONE",
+ "metadata" to metadata.metadata,
+ "startTime" to metadata.startTime
+ )
+ )
+ activeDownloads.remove(download.request.id)
+ saveMetadataFile(metadata)
+ }
+ Download.STATE_FAILED -> {
+ sendEvent(
+ "onError",
+ mapOf(
+ "id" to metadata.providedId,
+ "error" to (finalException?.message ?: "Download failed"),
+ "state" to "FAILED",
+ "metadata" to metadata.metadata,
+ "startTime" to metadata.startTime
+ )
+ )
+ activeDownloads.remove(download.request.id)
+ }
+ else -> {
+ val progress = if (download.contentLength > 0) {
+ download.bytesDownloaded.toFloat() / download.contentLength
+ } else 0f
+
+ sendEvent(
+ "onProgress",
+ mapOf(
+ "id" to metadata.providedId,
+ "progress" to progress,
+ "state" to when (download.state) {
+ Download.STATE_DOWNLOADING -> "DOWNLOADING"
+ Download.STATE_QUEUED -> "PENDING"
+ else -> "DOWNLOADING"
+ },
+ "metadata" to metadata.metadata,
+ "startTime" to metadata.startTime,
+ "taskId" to download.request.id
+ )
+ )
+ }
+ }
+ }
+ }
+ })
+ }
+
+ Function("getActiveDownloads") {
+ activeDownloads.map { (taskId, metadata) ->
+ mapOf(
+ "id" to metadata.providedId,
+ "state" to "DOWNLOADING",
+ "metadata" to metadata.metadata,
+ "startTime" to metadata.startTime,
+ "taskId" to taskId
+ )
+ }
+ }
+
+ Function("downloadHLSAsset") { providedId: String, url: String, metadata: Map? ->
+ val startTime = System.currentTimeMillis()
+ val context = appContext.reactContext as Context
+
+ val downloadDir = File(context.getExternalFilesDir(null), "downloads/$providedId")
+ if (downloadDir.exists() && downloadDir.listFiles()?.any { file -> file.name.endsWith(".m3u8") } == true) {
+ sendEvent(
+ "onComplete",
+ mapOf(
+ "id" to providedId,
+ "location" to downloadDir.absolutePath,
+ "state" to "DONE",
+ "metadata" to (metadata ?: emptyMap()),
+ "startTime" to startTime
+ )
+ )
+ return@Function
+ }
+
+ try {
+ val downloadRequest = DownloadRequest.Builder(
+ providedId,
+ Uri.parse(url)
+ )
+ .setCustomCacheKey(providedId)
+ .build()
+
+ downloadManager.addDownload(downloadRequest)
+
+ activeDownloads[providedId] = DownloadMetadata(
+ providedId = providedId,
+ metadata = metadata ?: emptyMap(),
+ startTime = startTime
+ )
+
+ sendEvent(
+ "onProgress",
+ mapOf(
+ "id" to providedId,
+ "progress" to 0.0,
+ "state" to "PENDING",
+ "metadata" to (metadata ?: emptyMap()),
+ "startTime" to startTime
+ )
+ )
+
+ } catch (e: Exception) {
+ sendEvent(
+ "onError",
+ mapOf(
+ "id" to providedId,
+ "error" to e.message,
+ "state" to "FAILED",
+ "metadata" to (metadata ?: emptyMap()),
+ "startTime" to startTime
+ )
+ )
+ }
+ }
+
+ Function("cancelDownload") { providedId: String ->
+ activeDownloads[providedId]?.let { metadata ->
+ downloadManager.removeDownload(providedId)
+ sendEvent(
+ "onError",
+ mapOf(
+ "id" to metadata.providedId,
+ "error" to "Download cancelled",
+ "state" to "CANCELLED",
+ "metadata" to metadata.metadata,
+ "startTime" to metadata.startTime
+ )
+ )
+ activeDownloads.remove(providedId)
+ }
}
}
- fun cancelDownload(providedId: String) {
- val downloadInfo = activeDownloads[providedId] ?: return
- downloadInfo.downloadRequest?.let { request ->
- downloadManager.removeDownload(request.id)
- sendEvent("onError", mapOf(
- "id" to providedId,
- "error" to "Download cancelled",
- "state" to "CANCELLED",
- "metadata" to downloadInfo.metadata,
- "startTime" to downloadInfo.startTime
- ))
- activeDownloads.remove(providedId)
- }
- }
-
- private fun handleCompletedDownload(download: Download, downloadInfo: DownloadInfo) {
+ private fun saveMetadataFile(metadata: DownloadMetadata) {
try {
- val downloadDir = File(context.filesDir, "downloads/${download.request.id}")
- if (!downloadDir.exists()) {
- downloadDir.mkdirs()
- }
-
- // Save metadata if present
- downloadInfo.metadata.takeIf { it.isNotEmpty() }?.let { metadata ->
- val metadataFile = File(downloadDir, "${download.request.id}.json")
- metadataFile.writeText(JSONObject(metadata).toString())
- }
-
- sendEvent("onComplete", mapOf(
- "id" to download.request.id,
- "location" to downloadDir.absolutePath,
- "state" to "DONE",
- "metadata" to downloadInfo.metadata,
- "startTime" to downloadInfo.startTime
- ))
+ val context = appContext.reactContext as Context
+ val metadataFile = File(
+ context.getExternalFilesDir(null),
+ "downloads/${metadata.providedId}.json"
+ )
+ metadataFile.writeText(JSONObject(metadata.metadata).toString())
} catch (e: Exception) {
- handleFailedDownload(download, downloadInfo, e)
- } finally {
- activeDownloads.remove(download.request.id)
+ e.printStackTrace()
}
}
-
- private fun handleFailedDownload(
- download: Download,
- downloadInfo: DownloadInfo,
- error: Exception?
- ) {
- sendEvent("onError", mapOf(
- "id" to download.request.id,
- "error" to (error?.localizedMessage ?: "Unknown error"),
- "state" to "FAILED",
- "metadata" to downloadInfo.metadata,
- "startTime" to downloadInfo.startTime
- ))
- activeDownloads.remove(download.request.id)
- }
-
- private fun createDatabaseProvider() = StandaloneDatabaseProvider(context)
-
- private fun sendEvent(eventName: String, params: Map) {
- mainHandler.post {
- context
- .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
- .emit(eventName, params)
- }
- }
-
- companion object {
- private const val DOWNLOAD_CONTENT_DIRECTORY = "downloads"
- }
}
\ No newline at end of file
diff --git a/modules/hls-downloader/expo-module.config.json b/modules/hls-downloader/expo-module.config.json
index 2e70a5e9..9729bb01 100644
--- a/modules/hls-downloader/expo-module.config.json
+++ b/modules/hls-downloader/expo-module.config.json
@@ -1,5 +1,5 @@
{
- "platforms": ["ios"],
+ "platforms": ["ios", "android"],
"apple": {
"modules": ["HlsDownloaderModule"]
},