Skip to content

Commit 3e933af

Browse files
committed
update
1 parent ef8a910 commit 3e933af

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@ In the core of this package, I use `AVQueuePlayer`. Here are the supported featu
138138
### 1. Create LoopPlayerView
139139

140140
```swift
141-
LoopPlayerView(fileName: 'swipe')
141+
ExtPlayerView(fileName: 'swipe')
142142
```
143143

144144
or in a declarative way
145145

146146
```swift
147-
LoopPlayerView{
147+
ExtPlayerView{
148148
VideoSettings{
149149
SourceName("swipe")
150150
Ext("mp8") // Set default extension here If not provided then mp4 is default
@@ -165,7 +165,7 @@ or in a declarative way
165165
```
166166
167167
```swift
168-
LoopPlayerView{
168+
ExtPlayerView{
169169
VideoSettings{
170170
SourceName("swipe")
171171
Gravity(.resizeAspectFill)
@@ -175,7 +175,7 @@ or in a declarative way
175175
```
176176

177177
```swift
178-
LoopPlayerView{
178+
ExtPlayerView{
179179
VideoSettings{
180180
SourceName('https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8')
181181
ErrorGroup{
@@ -208,7 +208,7 @@ The AVFoundation framework used in the package supports a wide range of video fo
208208
The package now supports using remote video URLs, allowing you to stream videos directly from web resources. This is an extension to the existing functionality that primarily focused on local video files. Here's how to specify a remote URL within the settings:
209209

210210
```swift
211-
LoopPlayerView{
211+
ExtPlayerView{
212212
VideoSettings{
213213
SourceName('https://example.com/video')
214214
Gravity(.resizeAspectFill) // Video content fit
@@ -238,7 +238,7 @@ struct VideoView: View {
238238
@State private var playbackCommand: PlaybackCommand = .play
239239

240240
var body: some View {
241-
LoopPlayerView(
241+
ExtPlayerView(
242242
{
243243
VideoSettings {
244244
SourceName("swipe")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import AVKit
1313

1414
/// Player view for running a video in loop
1515
@available(iOS 14.0, macOS 11.0, tvOS 14.0, *)
16-
public struct LoopPlayerView: View{
16+
public struct ExtVideoPlayer: View{
1717

1818
/// Set of settings for video the player
1919
@Binding public var settings: VideoSettings

Sources/swiftui-loop-videoplayer/view/main/LoopPlayerMultiPlatform.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct LoopPlayerMultiPlatform: LoopPlayerViewProtocol {
5757
assetFor(settings)
5858
}
5959

60-
/// Initializes a new instance of `LoopPlayerView`.
60+
/// Initializes a new instance of `ExtPlayerView`.
6161
/// - Parameters:
6262
/// - settings: A binding to the video settings used by the player.
6363
/// - command: A binding to the playback command that controls playback actions.

Tests/swiftui-loop-videoplayerTests/testPlaybackCommandChangesOverTime.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class testPlaybackCommandChangesOverTime: XCTestCase {
2222
)
2323

2424
// Create an instance of the view with the initial command
25-
let playerView = LoopPlayerView(fileName: "swipe", command: commandBinding)
25+
let playerView = ExtPlayerView(fileName: "swipe", command: commandBinding)
2626

2727
// Setup expectation for asynchronous test
2828
let expectation = self.expectation(description: "Command should change to .pause")

Tests/swiftui-loop-videoplayerTests/testPlayerInitialization.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ final class testPlayerInitialization: XCTestCase {
99
func testInitializationWithCustomParameters() {
1010
let playbackCommand = PlaybackCommand.pause // Example of a non-default command
1111
let commandBinding = Binding.constant(playbackCommand)
12-
let playerView = LoopPlayerView(
12+
let playerView = ExtPlayerView(
1313
fileName: "swipe",
1414
ext: "mov",
1515
gravity: .resizeAspectFill,
@@ -31,7 +31,7 @@ final class testPlayerInitialization: XCTestCase {
3131

3232
// Test initialization with default parameters
3333
func testInitializationWithDefaultParameters() {
34-
let playerView = LoopPlayerView(fileName: "swipe")
34+
let playerView = ExtPlayerView(fileName: "swipe")
3535

3636
XCTAssertEqual(playerView.settings.name, "swipe")
3737
XCTAssertEqual(playerView.settings.ext, "mp4") // Default extension
@@ -44,8 +44,8 @@ final class testPlayerInitialization: XCTestCase {
4444
}
4545

4646
// Test the initializer that takes a closure returning VideoSettings
47-
func testLoopPlayerView_InitializesWithValues() {
48-
let playerView = LoopPlayerView{
47+
func testExtPlayerView_InitializesWithValues() {
48+
let playerView = ExtPlayerView{
4949
VideoSettings{
5050
SourceName("swipe")
5151
Ext("mp8") // Set default extension here If not provided then mp4 is default
@@ -67,8 +67,8 @@ final class testPlayerInitialization: XCTestCase {
6767
}
6868

6969
// Test the initializer that takes a closure returning VideoSettings
70-
func testLoopPlayerView_InitializesWithClosureProvidedSettings() {
71-
let playerView = LoopPlayerView {
70+
func testExtPlayerView_InitializesWithClosureProvidedSettings() {
71+
let playerView = ExtPlayerView {
7272
VideoSettings {
7373
SourceName("swipe")
7474
Ext("mp8")
@@ -90,7 +90,7 @@ final class testPlayerInitialization: XCTestCase {
9090
}
9191

9292
// Test the initializer that takes a binding to VideoSettings
93-
func testLoopPlayerView_InitializesWithBindingProvidedSettings() {
93+
func testExtPlayerView_InitializesWithBindingProvidedSettings() {
9494
let initialSettings = VideoSettings {
9595
SourceName("swipe")
9696
Ext("mkv")
@@ -102,7 +102,7 @@ final class testPlayerInitialization: XCTestCase {
102102
}
103103
}
104104
let settings = Binding.constant(initialSettings)
105-
let playerView = LoopPlayerView(settings: settings, command: .constant(.pause))
105+
let playerView = ExtPlayerView(settings: settings, command: .constant(.pause))
106106

107107
XCTAssertEqual(settings.wrappedValue.name, "swipe")
108108
XCTAssertEqual(settings.wrappedValue.ext, "mkv")

Tests/swiftui-loop-videoplayerTests/testVideoStreaming.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ final class testVideoStreaming: XCTestCase {
1818
return
1919
}
2020

21-
let _ = LoopPlayerView(fileName: filePath)
21+
let _ = ExtPlayerView(fileName: filePath)
2222
// Use the filePath as needed for your tests
2323
print("Video file path: \(filePath)")
2424

0 commit comments

Comments
 (0)