Skip to content

Commit 420c07c

Browse files
committed
Update README.md
1 parent f9734ab commit 420c07c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Please note that using videos from URLs requires ensuring that you have the righ
2020
|---------------------------------------|-------------------------------|------------------------------------------------------------------------|
2121
| `settings` | `VideoSettings` | A struct containing configuration settings for the video player. |
2222
| `command` | `Binding<PlaybackCommand>` | A binding to control playback actions (play, pause, or seek). |
23-
| `init(fileName:ext:gravity:` <br> `eColor:eFontSize:command:)` | Constructor | Initializes the player with specific video parameters and playback command binding. |
23+
| `init(fileName:ext:gravity:timePublishing:eColor:eFontSize:command:)` | Constructor | Initializes the player with specific video parameters and playback command binding. |
2424
| `init(settings: () -> VideoSettings, command:)` | Constructor | Initializes the player with a declarative settings block and playback command binding. |
2525

2626
## Commands
@@ -90,6 +90,7 @@ Integrating vector graphics into SwiftUI views, particularly during lifecycle ev
9090
| **SourceName** | The URL or local filename of the video. If a valid URL (http or https) is provided, the video will be streamed from the URL. If not a URL, the system will check if a video with the given name exists in the local bundle. The local name provided can either include an extension or be without one. The system first checks if the local name contains an extension. If the local name includes an extension, it extracts this extension and uses it as the default. If the local name does not contain an extension, the system assigns a default extension of .mp4 The default file extension can be set up via Ext param. | - |
9191
| **Ext** | File extension for the video, used when loading from local resources. This is optional when a URL is provided and the URL ends with the video file extension. | "mp4" |
9292
| **Gravity** | How the video content should be resized to fit the player's bounds. | .resizeAspect |
93+
| **TimePublishing** | Specifies the interval at which the player publishes the current playback time. If the parameter is passed during initialization, the player will publish the time according to the input settings. You can pass just `TimePublishing` without any value to use the default interval of 1 second, or you can pass a specific `CMTime` value to set a custom interval. | 1 second (CMTime with 1 second and preferred timescale of 600) |
9394
| **EColor** | Error message text color. | .red |
9495
| **EFontSize** | Size of the error text. | 17.0 |
9596

@@ -120,12 +121,16 @@ or in a declarative way
120121
SourceName("swipe")
121122
Ext("mp8") // Set default extension here If not provided then mp4 is default
122123
Gravity(.resizeAspectFill)
124+
TimePublishing()
123125
ErrorGroup{
124126
EColor(.accentColor)
125127
EFontSize(27)
126128
}
127129
}
128-
}
130+
}
131+
.onTimeChange { newTime in
132+
// Current video playback time
133+
}
129134
```
130135
131136
```swift

0 commit comments

Comments
 (0)