File tree Expand file tree Collapse file tree 1 file changed +25
-4
lines changed
Sources/swiftui-loop-videoplayer Expand file tree Collapse file tree 1 file changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,33 @@ public struct LoopPlayerView: UIViewRepresentable {
18
18
19
19
// MARK: - Life circle
20
20
21
- public init ( fileName : String ) {
22
- self . settings = Settings {
23
- FileName ( fileName)
21
+ /// Player initializer
22
+ /// - Parameters:
23
+ /// - fileName: Name of the video to play
24
+ /// - ext: Video extension
25
+ /// - gravity: A structure that defines how a layer displays a player’s visual content within the layer’s bounds
26
+ /// - eText: Error message text if file is not found
27
+ /// - eFontSize: Size of the error text
28
+ public init (
29
+ fileName: String ,
30
+ ext: String = " mp4 " ,
31
+ gravity: AVLayerVideoGravity = . resizeAspect,
32
+ eText : String = " Resource is not found " ,
33
+ eFontSize : CGFloat = 17.0
34
+ ) {
35
+ self . settings = Settings {
36
+ FileName ( fileName)
37
+ Ext ( ext)
38
+ Gravity ( gravity)
39
+ ErrorGroup {
40
+ EText ( eText)
41
+ EFontSize ( eFontSize)
42
+ }
43
+ }
24
44
}
25
- }
26
45
46
+ /// Player initializer in a declarative way
47
+ /// - Parameter settings: Set of settings
27
48
public init ( _ settings : ( ) -> Settings ) {
28
49
self . settings = settings ( )
29
50
}
You can’t perform that action at this time.
0 commit comments