react-native-video/ios/Video/DataStructures/CustomMetadata.swift
Krzysztof Moch 8ad4be459b
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>
2024-05-07 12:30:57 +02:00

29 lines
731 B
Swift

struct CustomMetadata {
let title: String?
let subtitle: String?
let artist: String?
let description: String?
let imageUri: String?
let json: NSDictionary?
init(_ json: NSDictionary?) {
guard let json else {
self.json = nil
title = nil
subtitle = nil
artist = nil
description = nil
imageUri = nil
return
}
self.json = json
title = json["title"] as? String ?? ""
subtitle = json["subtitle"] as? String ?? ""
artist = json["artist"] as? String ?? ""
description = json["description"] as? String ?? ""
imageUri = json["imageUri"] as? String ?? ""
}
}