@granite-js/video 1.0.11 → 1.0.12

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @granite-js/video
2
2
 
3
+ ## 1.0.12
4
+
5
+ ### Patch Changes
6
+
7
+ - 61b8058: Add iOS native implementation for onVideoAudioFocusChanged event
8
+ - 61b8058: Improvement to Granite Video Props
9
+
3
10
  ## 1.0.11
4
11
 
5
12
  ## 1.0.10
@@ -76,8 +76,8 @@ class GraniteVideoView @JvmOverloads constructor(
76
76
  uri = source["uri"] as? String,
77
77
  type = source["type"] as? String,
78
78
  startPosition = (source["startPosition"] as? Number)?.toDouble() ?: 0.0,
79
- cropStart = (source["cropStart"] as? Number)?.toDouble() ?: 0.0,
80
- cropEnd = (source["cropEnd"] as? Number)?.toDouble() ?: 0.0,
79
+ startTime = (source["startTime"] as? Number)?.toDouble() ?: 0.0,
80
+ endTime = (source["endTime"] as? Number)?.toDouble() ?: 0.0,
81
81
  headers = headers,
82
82
  drm = parseDrm(source["drm"] as? Map<String, Any>),
83
83
  isNetwork = source["isNetwork"] as? Boolean,
@@ -34,8 +34,8 @@ data class GraniteVideoSource(
34
34
  val uri: String? = null,
35
35
  val type: String? = null,
36
36
  val startPosition: Double = 0.0,
37
- val cropStart: Double = 0.0,
38
- val cropEnd: Double = 0.0,
37
+ val startTime: Double = 0.0,
38
+ val endTime: Double = 0.0,
39
39
  val headers: Map<String, String>? = null,
40
40
  val drm: GraniteVideoDrmConfig? = null,
41
41
  val isNetwork: Boolean? = null,
@@ -81,8 +81,8 @@ interface NativeVideoSource {
81
81
  uri?: string;
82
82
  type?: string;
83
83
  startPosition?: Double;
84
- cropStart?: Double;
85
- cropEnd?: Double;
84
+ startTime?: Double;
85
+ endTime?: Double;
86
86
  isNetwork?: boolean;
87
87
  isAsset?: boolean;
88
88
  isLocalAssetFile?: boolean;
@@ -56,8 +56,8 @@ interface NativeVideoSource {
56
56
  uri?: string;
57
57
  type?: string;
58
58
  startPosition?: Double;
59
- cropStart?: Double;
60
- cropEnd?: Double;
59
+ startTime?: Double;
60
+ endTime?: Double;
61
61
  isNetwork?: boolean;
62
62
  isAsset?: boolean;
63
63
  isLocalAssetFile?: boolean;
@@ -71,8 +71,8 @@ export interface VideoSource {
71
71
  patchVer?: number;
72
72
  headers?: VideoSourceHeaders;
73
73
  startPosition?: number;
74
- cropStart?: number;
75
- cropEnd?: number;
74
+ startTime?: number;
75
+ endTime?: number;
76
76
  drm?: DrmConfig;
77
77
  textTracks?: TextTrack[];
78
78
  metadata?: VideoMetadata;
@@ -54,8 +54,8 @@ import AVFoundation
54
54
  @objc public var uri: String?
55
55
  @objc public var type: String?
56
56
  @objc public var startPosition: Double = 0
57
- @objc public var cropStart: Double = 0
58
- @objc public var cropEnd: Double = 0
57
+ @objc public var startTime: Double = 0
58
+ @objc public var endTime: Double = 0
59
59
  @objc public var headers: [String: String]?
60
60
  @objc public var drm: GraniteVideoDrmConfig?
61
61
 
@@ -141,6 +141,7 @@ import AVFoundation
141
141
  @objc optional func videoDidBecomeIdle()
142
142
  @objc optional func videoReadyForDisplay()
143
143
  @objc optional func videoAudioBecomingNoisy()
144
+ @objc optional func videoAudioFocusChanged(hasAudioFocus: Bool)
144
145
  @objc optional func videoFullscreenPlayerWillPresent()
145
146
  @objc optional func videoFullscreenPlayerDidPresent()
146
147
  @objc optional func videoFullscreenPlayerWillDismiss()
@@ -244,8 +244,8 @@ using namespace facebook::react;
244
244
  }
245
245
 
246
246
  videoSource.startPosition = source.startPosition;
247
- videoSource.cropStart = source.cropStart;
248
- videoSource.cropEnd = source.cropEnd;
247
+ videoSource.startTime = source.startTime;
248
+ videoSource.endTime = source.endTime;
249
249
 
250
250
  [_provider loadSource:videoSource];
251
251
 
@@ -534,6 +534,17 @@ using namespace facebook::react;
534
534
  }
535
535
  }
536
536
 
537
+ - (void)videoAudioFocusChangedWithHasAudioFocus:(BOOL)hasAudioFocus
538
+ {
539
+ if (_eventEmitter) {
540
+ auto emitter = std::static_pointer_cast<GraniteVideoViewEventEmitter const>(_eventEmitter);
541
+ facebook::react::GraniteVideoViewEventEmitter::OnVideoAudioFocusChanged event = {
542
+ .hasAudioFocus = hasAudioFocus
543
+ };
544
+ emitter->onVideoAudioFocusChanged(event);
545
+ }
546
+ }
547
+
537
548
  - (void)videoFullscreenPlayerWillPresent
538
549
  {
539
550
  if (_eventEmitter) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@granite-js/video",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "Pluggable video component for React Native with provider selection",
5
5
  "type": "module",
6
6
  "main": "./dist/module/index.js",
@@ -81,8 +81,8 @@ interface NativeVideoSource {
81
81
  uri?: string;
82
82
  type?: string;
83
83
  startPosition?: Double;
84
- cropStart?: Double;
85
- cropEnd?: Double;
84
+ startTime?: Double;
85
+ endTime?: Double;
86
86
  isNetwork?: boolean;
87
87
  isAsset?: boolean;
88
88
  isLocalAssetFile?: boolean;
package/src/types.ts CHANGED
@@ -105,8 +105,8 @@ export interface VideoSource {
105
105
  patchVer?: number;
106
106
  headers?: VideoSourceHeaders;
107
107
  startPosition?: number;
108
- cropStart?: number;
109
- cropEnd?: number;
108
+ startTime?: number;
109
+ endTime?: number;
110
110
  drm?: DrmConfig;
111
111
  textTracks?: TextTrack[];
112
112
  metadata?: VideoMetadata;