Skip to content

Commit 343ebdc

Browse files
committed
update
1 parent 8c21f97 commit 343ebdc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# SwiftUI loop video player
22

33
## How to use the package
4-
### 1. Create PlayerView
4+
### 1. Create LoopPlayerView
55

66
```swift
7-
PlayerView(resourceName: "swipe")
7+
LoopPlayerView(resourceName: "swipe")
88
```
99

1010
### Params
@@ -15,6 +15,7 @@
1515
|**extention**| Video extension | "mp4" |
1616
|**errorText**| Error message text| "Resource is not found" |
1717
|**videoGravity**| A structure that defines how a layer displays a player’s visual content within the layer’s bounds | .resizeAspect |
18+
|**errorTextSize**| Size of the error text | 17.0 |
1819

1920
## SwiftUI example for the package
2021
[ SwiftUI loop video player example](https://github.com/The-Igor/swiftui-loop-videoplayer-example)

Sources/swiftui-loop-videoplayer/PlayerView.swift renamed to Sources/swiftui-loop-videoplayer/LoopPlayerView.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)