You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -45,8 +46,42 @@ Please note that using videos from URLs requires ensuring that you have the righ
45
46
|`filter(CIFilter, clear: Bool)`| Applies a specific Core Image filter to the video. If `clear` is true, any existing filters on the stack are removed before applying the new filter; otherwise, the new filter is added to the existing stack. |
46
47
|`removeAllFilters`| Command to remove all applied filters from the video playback. |
47
48
|`audioTrack(String)`| Command to select a specific audio track based on language code. The `languageCode` parameter specifies the desired audio track's language (e.g., "en" for English). |
49
+
|`addVector(ShapeLayerBuilderProtocol, clear: Bool)`| Command to add a vector graphic layer over the video stream. The `builder` parameter is an instance conforming to `ShapeLayerBuilderProtocol`. The `clear` parameter specifies whether to clear existing vector layers before adding the new one. |
50
+
|`removeAllVectors`| Command to remove all vector graphic layers from the video stream. |
48
51
49
52
53
+
### Additional Notes on Adding and Removing Vector Graphics
54
+
55
+
When you use the `addVector` command, you can dynamically add a new vector graphic layer (such as a logo or animated vector) over the video stream. This is particularly useful for enhancing the user experience with overlays, such as branding elements, animated graphics.
56
+
57
+
**Adding a Vector Layer**:
58
+
- The `addVector` command takes a `ShapeLayerBuilderProtocol` instance. This protocol defines the necessary method to build a `CAShapeLayer` based on the given geometry (frame, bounds).
59
+
- The `clear` parameter determines whether existing vector layers should be removed before adding the new one. If set to `true`, all existing vector layers are cleared, and only the new layer will be displayed.
60
+
- The vector layer will be laid out directly over the video stream, allowing it to appear as part of the video playback experience.
61
+
62
+
These commands allow developers to seamlessly manage vector elements over a video, providing flexible options for adding and removing visual enhancements during playback. By leveraging the `ShapeLayerBuilderProtocol`, developers can create custom vector graphics that integrate smoothly into the video content.
63
+
64
+
### ShapeLayerBuilderProtocol
65
+
66
+
```swift
67
+
/// A protocol defining a builder for creating shape layers with a unique identifier.
68
+
///
69
+
/// Conforming types will be able to construct a CAShapeLayer based on provided frame, bounds, and center.
-**Brightness and Contrast**: These settings function also filters but are managed separately from the filter stack. Adjustments to brightness and contrast are applied additionally and independently of the image filters.
0 commit comments