react-native-firework-sdk 1.2.6 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,6 +12,7 @@ data class FWVideoPlayerConfigModel(
12
12
  var showMuteButton: Boolean? = null,
13
13
  var showPlaybackButton: Boolean? = null,
14
14
  var launchBehavior: String? = null,
15
+ var showBranding: Boolean? = null,
15
16
  ) : Parcelable {
16
17
 
17
18
  @Parcelize
@@ -91,6 +91,7 @@ object FWVideoPlayerUtils {
91
91
  }
92
92
 
93
93
  fun setVideoPlayerConfig(config: FWVideoPlayerConfigModel?) {
94
+ VideoPlayerProperties.branding = config?.showBranding != false
94
95
  VideoPlayerProperties.share = config?.showShareButton != false
95
96
  VideoPlayerProperties.loop = config?.videoCompleteAction != FWVideoPlayerConstant.FW_VIDEO_COMPLETE_ACTION_ADVANCE_TO_NEXT
96
97
  // VideoPlayerProperties.autoPlayOnComplete = config?.videoCompleteAction != FWVideoPlayerConstant.FW_VIDEO_COMPLETE_ACTION_LOOP
@@ -314,9 +314,13 @@ extension VideoFeed {
314
314
  }
315
315
  if let showMuteButton = config.showMuteButton {
316
316
  vpcConfig.muteButton.isHidden = !showMuteButton
317
- if let launchBehavior = config.launchBehavior {
318
- vpcConfig.onFirstLaunch = launchBehavior.behavior()
319
- }
317
+ }
318
+ if let launchBehavior = config.launchBehavior {
319
+ vpcConfig.onFirstLaunch = launchBehavior.behavior()
320
+ }
321
+
322
+ if let showBranding = config.showBranding {
323
+ vpcConfig.videoDetail.fireworkAttribution.isHidden = !showBranding
320
324
  }
321
325
 
322
326
  return vpcConfig
@@ -16,7 +16,8 @@ public class VideoPlayerConfiguration: NSObject, Codable {
16
16
  var showPlaybackButton: Bool?
17
17
  var showMuteButton: Bool?
18
18
  var launchBehavior: VideoLaunchBehavior?
19
-
19
+ var showBranding: Bool?
20
+
20
21
  public enum VideoPlayerStyle: String, Codable {
21
22
  case full, fit
22
23
  }
@@ -16,15 +16,35 @@ extension RCTConvert {
16
16
  if let style = videoPlayerStyle(config["playerStyle"] as? String) {
17
17
  finalConfig.playerStyle = style
18
18
  }
19
+
19
20
  if let action = videoCompleteAction(config["videoCompleteAction"] as? String) {
20
21
  finalConfig.videoCompleteAction = action
21
22
  }
23
+
22
24
  if let showShareButton = config["showShareButton"] as? Bool {
23
- finalConfig.shareButton.isHidden = showShareButton
25
+ finalConfig.shareButton.isHidden = !showShareButton
24
26
  }
27
+
25
28
  if let ctaStyle = ctaButtonStyle(config["ctaButtonStyle"] as? Dictionary) {
26
29
  finalConfig.ctaButton.contentConfiguration = ctaStyle
27
30
  }
31
+
32
+ if let showPlaybackButton = config["showPlaybackButton"] as? Bool {
33
+ finalConfig.playbackButton.isHidden = !showPlaybackButton
34
+ }
35
+
36
+ if let showMuteButton = config["showMuteButton"] as? Bool {
37
+ finalConfig.muteButton.isHidden = !showMuteButton
38
+ }
39
+
40
+ if let launchBehaviorString = config["launchBehavior"] as? String,
41
+ let launchBehavior = VideoPlayerConfiguration.VideoLaunchBehavior(rawValue: launchBehaviorString) {
42
+ finalConfig.onFirstLaunch = launchBehavior.behavior()
43
+ }
44
+
45
+ if let showBranding = config["showBranding"] as? Bool {
46
+ finalConfig.videoDetail.fireworkAttribution.isHidden = !showBranding
47
+ }
28
48
 
29
49
  return finalConfig
30
50
  }
@@ -32,7 +32,11 @@ export default interface VideoPlayerConfiguration {
32
32
  */
33
33
  showMuteButton?: boolean;
34
34
  /**
35
- * The property is valid only if showMuteButton is true.
35
+ * Specifies the video player launch behavior.
36
36
  */
37
37
  launchBehavior?: VideoLaunchBehavior;
38
+ /**
39
+ * Indicates if Firework branding should be showed or not.
40
+ */
41
+ showBranding?: boolean;
38
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-firework-sdk",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "Firework React Native SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -34,7 +34,11 @@ export default interface VideoPlayerConfiguration {
34
34
  */
35
35
  showMuteButton?: boolean;
36
36
  /**
37
- * The property is valid only if showMuteButton is true.
37
+ * Specifies the video player launch behavior.
38
38
  */
39
39
  launchBehavior?: VideoLaunchBehavior;
40
+ /**
41
+ * Indicates if Firework branding should be showed or not.
42
+ */
43
+ showBranding?: boolean;
40
44
  }