Skip to content

Commit

Permalink
Merge pull request #2 from StreamAMG/gh-pages
Browse files Browse the repository at this point in the history
Update main branch
  • Loading branch information
francodriansetti authored Mar 1, 2024
2 parents a98a50f + 109cbb9 commit 42f298e
Show file tree
Hide file tree
Showing 2,668 changed files with 473 additions and 3,320 deletions.
78 changes: 78 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/PlaybackSDK.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "PlaybackSDK"
BuildableName = "PlaybackSDK"
BlueprintName = "PlaybackSDK"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "PlaybackSDKTests"
BuildableName = "PlaybackSDKTests"
BlueprintName = "PlaybackSDKTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "PlaybackSDK"
BuildableName = "PlaybackSDK"
BlueprintName = "PlaybackSDK"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
53 changes: 53 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/PlaybackSDKTests.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "PlaybackSDKTests"
BuildableName = "PlaybackSDKTests"
BlueprintName = "PlaybackSDKTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
7 changes: 4 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ let package = Package(
targets: ["PlaybackSDK"]
),
],

dependencies: [
// Declare dependencies

Expand All @@ -24,7 +25,7 @@ let package = Package(
.exact("3.56.1")),

// other dependencies
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")

],
targets: [
Expand All @@ -34,8 +35,8 @@ let package = Package(
name: "PlaybackSDK",
dependencies: [
.product(name: "BitmovinPlayer", package: "BitmovinPlayer"),
]
),
]
),
.testTarget(
name: "PlaybackSDKTests",
dependencies: ["PlaybackSDK"]),
Expand Down
72 changes: 9 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ This library simplifies integrating video playback functionalities into OTT appl
**Supported Platforms and Version**

- Platforms: iOS 14 and later
- Swift Package Manager:

**Installation**

Expand All @@ -36,71 +35,18 @@ import PlaybackSDK
```

**Usage**

1. **Initialization:**
**Resources:**

Swift

```
PlaybackSDKManager.shared.initialize(apiKey: "YOUR_API_KEY") { result in
switch result {
case .success:
print("Playback SDK initialized successfully.")
case .failure(let error):
print("Error initializing Playback SDK: \(error)")
}
}
```

1. **Loading HLS Stream:**

Swift

```
let entryId = "YOUR_ENTRY_ID"
let authorizationToken = "YOUR_AUTHORIZATION_TOKEN" (optional)
PlaybackUIView(entryId: entryId, authorizationToken: authorizationToken)
```
- **Tutorial:** [Tutorial](https://streamamg.github.io/playback-sdk-ios/tutorials/table-of-contents/#resources)
- **Demo app:** [GitHub Repository](https://github.com/StreamAMG/playback-demo-ios)
- **Stoplight API documentation:** [Documentation](https://streamamg.stoplight.io)

**Video Player Plugins (Optional)**
**Collaboration:**

The Playback SDK supports extending functionalities through custom video player plugins. These plugins can provide extended functionalities or integrate with third-party video players. Refer to the full source code for details on creating custom plugins.
To update the documentation, follow these steps:

```
// Implement your custom player plugin conforming to VideoPlayerPlugin protocol
// Register your custom plugin with the manager
let pluginManager = VideoPlayerPluginManager.shared
pluginManager.registerPlugin(YourCustomPlayerPlugin())
// Use the selected plugin for playback
pluginManager.selectedPlugin?.play()
```

**Error Handling**
1. Make changes to the documentation code.
2. Build the documentation following the instructions in [this URL](https://apple.github.io/swift-docc-plugin/documentation/swiftdoccplugin/publishing-to-github-pages/).
3. Merge the code into the `gh-pages` branch.

The library propagates errors through completion handlers. You can handle these errors to provide appropriate feedback to the user.

**Example**

Swift

```
PlaybackSDKManager.shared.initialize(apiKey: "YOUR_API_KEY") { result in
switch result {
case .success:
print("Playback SDK initialized successfully.")
let entryId = "YOUR_ENTRY_ID"
let authorizationToken = "YOUR_AUTHORIZATION_TOKEN" (optional)
PlaybackUIView(entryId: entryId, authorizationToken: authorizationToken)
case .failure(let error):
print("Error initializing Playback SDK: \(error)")
}
}
```

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,18 @@
// Created by Franco Driansetti on 27/02/2024.
//

import Foundation
Swift

import SwiftUI
```
dependencies: [
.package(url: "https://github.com/your-organization/playback-sdk.git", .branch("master"))
]
```

internal struct ContentView: View {
let entryId = "YOUR_ENTRY_ID"
let authorizationToken = "YOUR_AUTHORIZATION_TOKEN" // optional
2. Import the `PlaybackSDK` module in your Swift files.

Swift

var body: some View {
PlaybackUIView(entryId: entryId, authorizationToken: authorizationToken)
}
}

struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
```
import PlaybackSDK
```

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// InitializeSdkExample.swift
//
//
// Created by Franco Driansetti on 27/02/2024.
//

import SwiftUI
import PlaybackSDK

@main
struct PlayBackDemoApp: App {

let sdkManager = PlayBackSDKManager()
let apiKey = "API_KEY"
var body: some Scene {
WindowGroup {
HomeView()
}
}

init() {
// Initialize the Playback SDK with the provided API key and base URL
PlayBackSDKManager.shared.initialize(apiKey: apiKey) { result in
switch result {
case .success(let license):
// Obtained license upon successful initialization
print("SDK initialized with license: \(license)")

// Register the video player plugin
let bitmovinPlugin = BitmovinPlayerPlugin()
VideoPlayerPluginManager.shared.registerPlugin(bitmovinPlugin)

case .failure(let error):
// Print an error message and set initializationError flag upon initialization failure
print("SDK initialization failed with error: \(error)")

}
}
}
}
Loading

0 comments on commit 42f298e

Please sign in to comment.