File tree Expand file tree Collapse file tree 1 file changed +36
-10
lines changed Expand file tree Collapse file tree 1 file changed +36
-10
lines changed Original file line number Diff line number Diff line change 7
7
### 1. Create LoopPlayerView
8
8
9
9
``` swift
10
- LoopPlayerView (resourceName : " swipe" )
10
+ LoopPlayerView (fileName : " swipe" )
11
11
```
12
12
13
- ### Params
14
-
15
- | Strategy | Description | Default |
13
+ or in declarative way
14
+
15
+ ``` swift
16
+ LoopPlayerView {
17
+ Settings {
18
+ FileName (" swipe" )
19
+ Ext (" mp4" )
20
+ Gravity (.resizeAspectFill )
21
+ ErrorGroup {
22
+ EText (" Not found" )
23
+ EFontSize (27 )
24
+ }
25
+ }
26
+ }
27
+
28
+ LoopPlayerView {
29
+ Settings {
30
+ FileName (" swipe" )
31
+ Ext (" mp4" )
32
+ Gravity (.resizeAspectFill )
33
+ EFontSize (27 )
34
+ }
35
+ }
36
+ ```
37
+ If you add any setting twice or more the first one only will be applied
38
+ You can group error settings in group ** ErrorGroup** or just pass all settings as a linear list of settings
39
+
40
+ ### Settings
41
+
42
+ | Name | Description | Default |
16
43
| --- | --- | --- |
17
- | ** resourceName** | Name of the video to play| - |
18
- | ** extention** | Video extension | "mp4" |
19
- | ** errorText** | Error message text| "Resource is not found" |
20
- | ** videoGravity** | A structure that defines how a layer displays a player’s visual content within the layer’s bounds | .resizeAspect |
21
- | ** errorTextSize** | Size of the error text | 17.0 |
22
-
44
+ | ** FileName("swipe")** | Name of the video to play| - |
45
+ | ** Ext("mp4")** | Video extension | "mp4" |
46
+ | ** Gravity(.resizeAspectFill)** | A structure that defines how a layer displays a player’s visual content within the layer’s bounds | .resizeAspect |
47
+ | ** EText("Not found")** | Error message text| "Resource is not found" |
48
+ | ** EFontSize(27)** | Size of the error text | 17.0 |
23
49
## SwiftUI example for the package
24
50
[ SwiftUI loop video player example] ( https://github.com/The-Igor/swiftui-loop-videoplayer-example )
25
51
You can’t perform that action at this time.
0 commit comments