Skip to content

Commit fdd3978

Browse files
committed
Update README.md
1 parent 01690fb commit fdd3978

File tree

1 file changed

+36
-10
lines changed

1 file changed

+36
-10
lines changed

README.md

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,45 @@
77
### 1. Create LoopPlayerView
88

99
```swift
10-
LoopPlayerView(resourceName: "swipe")
10+
LoopPlayerView(fileName: "swipe")
1111
```
1212

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 |
1643
| --- | --- | --- |
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 |
2349
## SwiftUI example for the package
2450
[ SwiftUI loop video player example](https://github.com/The-Igor/swiftui-loop-videoplayer-example)
2551

0 commit comments

Comments
 (0)