@@ -10,7 +10,7 @@ import AVKit
1010
1111/// Player view for running a video in loop
1212@available ( iOS 14 . 0 , * )
13- public struct PlayerView : UIViewRepresentable {
13+ public struct LoopPlayerView : UIViewRepresentable {
1414
1515 /// Name of the video to play
1616 public let resourceName : String
@@ -26,14 +26,13 @@ public struct PlayerView: UIViewRepresentable {
2626
2727 /// Size of the error text Default : 17.0
2828 public let errorTextSize : CGFloat
29-
3029
3130 /// - Parameters:
3231 /// - resourceName: Name of the video to play
3332 /// - extention: Video extension
3433 /// - errorText: Error message text
3534 /// - 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
3736 public init (
3837 resourceName: String ,
3938 extention: String = " mp4 " ,
@@ -49,14 +48,14 @@ public struct PlayerView: UIViewRepresentable {
4948 }
5049
5150 /// Inherited from UIViewRepresentable
52- public func updateUIView( _ uiView: UIView , context: UIViewRepresentableContext < PlayerView > ) {
51+ public func updateUIView( _ uiView: UIView , context: UIViewRepresentableContext < LoopPlayerView > ) {
5352 }
5453
5554 /// - Parameter context: Contains details about the current state of the system
5655 /// - Returns: View
5756 public func makeUIView( context: Context ) -> UIView {
5857 let name = resourceName
59- let ext = extention
58+ let ext = extention
6059 guard let view = LoopingPlayerUIView ( name, width: ext, gravity: videoGravity) else {
6160 return errorTpl ( )
6261 }
0 commit comments