From cf260ac031781c0c9797cfe0fa2518c8e28d80ec Mon Sep 17 00:00:00 2001 From: Roland Kakonyi Date: Wed, 6 Sep 2023 16:48:45 +0200 Subject: [PATCH 1/2] feat(sourcedescription): add SourceConfig.description property --- CHANGELOG.md | 6 ++++++ .../bitmovin/player/reactnative/converter/JsonConverter.kt | 1 + ios/RCTConvert+BitmovinPlayer.swift | 3 +++ src/source.ts | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d83124fe..0d9e46e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased] + +### Added + +- Support for `SourceConfig.description` property to allow setting a description for the source + ## [0.10.0] (2023-09-04) ### Added diff --git a/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt b/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt index 931fad64..1a552350 100644 --- a/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt +++ b/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt @@ -312,6 +312,7 @@ class JsonConverter { } val config = SourceConfig(url, toSourceType(type)) config.title = json.getString("title") + config.description = json.getString("description") config.posterSource = json.getString("poster") if (json.hasKey("isPosterPersistent")) { config.isPosterPersistent = json.getBoolean("isPosterPersistent") diff --git a/ios/RCTConvert+BitmovinPlayer.swift b/ios/RCTConvert+BitmovinPlayer.swift index 7147b8ef..e9b2f900 100644 --- a/ios/RCTConvert+BitmovinPlayer.swift +++ b/ios/RCTConvert+BitmovinPlayer.swift @@ -239,6 +239,9 @@ extension RCTConvert { if let title = json["title"] as? String { sourceConfig.title = title } + if let description = json["description"] as? String { + sourceConfig.sourceDescription = description + } if let poster = json["poster"] as? String { sourceConfig.posterSource = RCTConvert.nsurl(poster) } diff --git a/src/source.ts b/src/source.ts index 134bf9ad..15e341de 100644 --- a/src/source.ts +++ b/src/source.ts @@ -95,6 +95,10 @@ export interface SourceConfig extends NativeInstanceConfig { * The title of the video source. */ title?: string; + /** + * The description of the video source. + */ + description?: string; /** * The URL to a preview image displayed until the video starts. */ From 9a9ea7320b129b10e65cb6eb839296f7893d4df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20K=C3=A1konyi?= Date: Thu, 7 Sep 2023 14:57:38 +0200 Subject: [PATCH 2/2] feat(sourcedescription): improve changelog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Žiga Vehovec --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d9e46e1..5e4dfc7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Added -- Support for `SourceConfig.description` property to allow setting a description for the source +- `SourceConfig.description` property to allow setting a description for the source ## [0.10.0] (2023-09-04)