@@ -10,7 +10,7 @@ import AVKit
10
10
11
11
/// Player view for running a video in loop
12
12
@available ( iOS 14 . 0 , * )
13
- public struct PlayerView : UIViewRepresentable {
13
+ public struct LoopPlayerView : UIViewRepresentable {
14
14
15
15
/// Name of the video to play
16
16
public let resourceName : String
@@ -26,14 +26,13 @@ public struct PlayerView: UIViewRepresentable {
26
26
27
27
/// Size of the error text Default : 17.0
28
28
public let errorTextSize : CGFloat
29
-
30
29
31
30
/// - Parameters:
32
31
/// - resourceName: Name of the video to play
33
32
/// - extention: Video extension
34
33
/// - errorText: Error message text
35
34
/// - videoGravity: A structure that defines how a layer displays a player’s visual content within the layer’s bounds
36
- /// - errorTextSize: Size of the error text Default : 17
35
+ /// - errorTextSize: Size of the error text Default : 17.0
37
36
public init (
38
37
resourceName: String ,
39
38
extention: String = " mp4 " ,
@@ -49,14 +48,14 @@ public struct PlayerView: UIViewRepresentable {
49
48
}
50
49
51
50
/// Inherited from UIViewRepresentable
52
- public func updateUIView( _ uiView: UIView , context: UIViewRepresentableContext < PlayerView > ) {
51
+ public func updateUIView( _ uiView: UIView , context: UIViewRepresentableContext < LoopPlayerView > ) {
53
52
}
54
53
55
54
/// - Parameter context: Contains details about the current state of the system
56
55
/// - Returns: View
57
56
public func makeUIView( context: Context ) -> UIView {
58
57
let name = resourceName
59
- let ext = extention
58
+ let ext = extention
60
59
guard let view = LoopingPlayerUIView ( name, width: ext, gravity: videoGravity) else {
61
60
return errorTpl ( )
62
61
}
0 commit comments