feat: add notification controls (#3723)

* feat(ios): add `showNotificationControls` prop

* feat(android): add `showNotificationControls` prop

* add docs

* feat!: add `metadata` property to srouce

This is breaking change for iOS/tvOS as we are moving some properties, but I believe that this will more readable and more user friendly

* chore(ios): remove UI blocking function

* code review changes for android

* update example

* fix readme

* fix typos

* update docs

* fix typo

* chore: improve sample metadata notification

* update codegen types

* rename properties

* update tvOS example

* reset metadata on source change

* update docs

---------

Co-authored-by: Olivier Bouillet <freeboub@gmail.com>
This commit is contained in:
Krzysztof Moch
2024-05-07 12:30:57 +02:00
committed by GitHub
parent c59d00a0f0
commit 8ad4be459b
18 changed files with 908 additions and 105 deletions

View File

@@ -389,15 +389,21 @@ enum RCTVideoUtils {
return item.copy() as! AVMetadataItem
}
static func createImageMetadataItem(imageUri: String) -> Data? {
if let uri = URL(string: imageUri),
let imgData = try? Data(contentsOf: uri),
let image = UIImage(data: imgData),
let pngData = image.pngData() {
return pngData
static func createImageMetadataItem(imageUri: String) async -> Data? {
guard let url = URL(string: imageUri) else {
return nil
}
return nil
do {
let (data, _) = try await URLSession.shared.data(from: url)
guard let image = UIImage(data: data), let pngData = image.pngData() else {
return nil
}
return pngData
} catch {
print("Error fetching image data: \(error.localizedDescription)")
return nil
}
}
static func getCurrentWindow() -> UIWindow? {