-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from StreamAMG/feature/documentation
Feature/documentation
- Loading branch information
Showing
2,701 changed files
with
3,908 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "BitmovinAnalytics", | ||
"repositoryURL": "https://github.com/bitmovin/bitmovin-analytics-collector-ios.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "3feebb1db5f6bc2d3ad0b7241f3baea523e9ab9e", | ||
"version": "3.6.0" | ||
} | ||
}, | ||
{ | ||
"package": "BitmovinPlayer", | ||
"repositoryURL": "https://github.com/bitmovin/player-ios.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "31ed8a5fb931bd600c5e1ca6d19c17d77762b56b", | ||
"version": "3.56.1" | ||
} | ||
}, | ||
{ | ||
"package": "BitmovinPlayerCore", | ||
"repositoryURL": "https://github.com/bitmovin/player-ios-core.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "7a2742ff415a7423fd62c0ed23fe1c9ca8fcaa9f", | ||
"version": "3.56.1" | ||
} | ||
}, | ||
{ | ||
"package": "SwiftDocCPlugin", | ||
"repositoryURL": "https://github.com/apple/swift-docc-plugin", | ||
"state": { | ||
"branch": null, | ||
"revision": "26ac5758409154cc448d7ab82389c520fa8a8247", | ||
"version": "1.3.0" | ||
} | ||
}, | ||
{ | ||
"package": "SymbolKit", | ||
"repositoryURL": "https://github.com/apple/swift-docc-symbolkit", | ||
"state": { | ||
"branch": null, | ||
"revision": "b45d1f2ed151d057b54504d653e0da5552844e34", | ||
"version": "1.0.0" | ||
} | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
Sources/PlaybackSDK/Documentation.docc/Resources/InitializeSdkExample.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// InitializeSdkExample.swift | ||
// | ||
// | ||
// Created by Franco Driansetti on 27/02/2024. | ||
// | ||
|
||
import PlaybackSDK | ||
|
||
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)") | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
Sources/PlaybackSDK/Documentation.docc/Resources/InstallPlayerPluginTutorial.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// InstallPlayerPluginTutorial.swift | ||
// | ||
// | ||
// Created by Franco Driansetti on 27/02/2024. | ||
// | ||
|
||
import Foundation | ||
|
||
PlayBackSDKManager.shared.initialize(apiKey: settingsManager.apiKey, baseURL: settingsManager.baseURL) { result in | ||
switch result { | ||
case .success(let license): | ||
print("SDK initialized with license: \(license)") | ||
|
||
// Add player plugin | ||
let bitmovinPlugin = BitmovinPlayerPlugin() | ||
VideoPlayerPluginManager.shared.registerPlugin(bitmovinPlugin) | ||
|
||
case .failure(let error): | ||
print("SDK initialization failed with error: \(error)") | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
Sources/PlaybackSDK/Documentation.docc/Resources/LoadHlsStreamTutorial.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// LoadHlsStreamTutorial.swift | ||
// | ||
// | ||
// Created by Franco Driansetti on 27/02/2024. | ||
// | ||
|
||
import Foundation | ||
|
||
import SwiftUI | ||
|
||
internal struct ContentView: View { | ||
let entryId = "YOUR_ENTRY_ID" | ||
let authorizationToken = "YOUR_AUTHORIZATION_TOKEN" // optional | ||
|
||
|
||
var body: some View { | ||
PlaybackUIView(entryId: entryId, authorizationToken: authorizationToken) | ||
} | ||
} | ||
|
||
struct ContentView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
ContentView() | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
Sources/PlaybackSDK/Documentation.docc/Resources/LoadPlayerViewTutorial.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// LoadPlayerViewTutorial.swift | ||
// | ||
// | ||
// Created by Franco Driansetti on 27/02/2024. | ||
// | ||
|
||
import Foundation | ||
|
||
PlayBackSDKManager.shared.loadPlayer(entryID: settingsManager.entryId, authorizationToken: settingsManager.authorizationToken, onError: { error in | ||
// Handle the error here | ||
switch error { | ||
case .apiError(let statusCode, _): | ||
print("\(statusCode)") | ||
default: | ||
print("Error loading HLS stream in PlaybackUIView: \(error.localizedDescription)") | ||
} | ||
}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions
72
Sources/PlaybackSDK/Documentation.docc/Tutorial/CustomPluginTutorial.tutorial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
@Tutorial(time: 30) { | ||
@Intro(title: "Playback SDK Overview") { | ||
Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic. | ||
|
||
**Key Features:** | ||
|
||
- **Abstraction:** Hides the complexities of underlying video APIs, allowing you to focus on the core playback experience. | ||
- **Flexibility:** Supports different video providers and allows the creation of custom playback plugins for extended functionalities. | ||
- **Error Handling:** Provides mechanisms to handle potential issues during playback and notify your application. | ||
} | ||
|
||
@Section(title: "Video Player Plugins (Optional)") { | ||
@ContentAndMedia { | ||
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. | ||
|
||
```swift | ||
// 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() | ||
``` | ||
|
||
@Image(source: "custom_plugin.png", alt: "Custom Video Player Plugin") | ||
} | ||
|
||
@Steps { | ||
@Step { | ||
**Step 1:** Implement your custom player plugin conforming to the `VideoPlayerPlugin` protocol. | ||
|
||
@Image(source: "custom_plugin_step1.png", alt: "Implement Custom Plugin") | ||
} | ||
|
||
@Step { | ||
**Step 2:** Register your custom plugin with the manager and use the selected plugin for playback. | ||
|
||
@Image(source: "custom_plugin_step2.png", alt: "Register Custom Plugin") | ||
@Code(name: "RegisterAndUsePlugin", file: RegisterAndUsePlugin.swift) | ||
} | ||
} | ||
} | ||
|
||
@Section(title: "Error Handling") { | ||
@ContentAndMedia { | ||
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)") | ||
} | ||
} | ||
``` | ||
|
||
@Image(source: "error_handling.png", alt: "Error Handling") | ||
} | ||
} | ||
} |
120 changes: 120 additions & 0 deletions
120
Sources/PlaybackSDK/Documentation.docc/Tutorial/GetStarted.tutorial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
@Tutorial(time: 30) { | ||
@Intro(title: "Playback SDK Overview") { | ||
Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic. | ||
|
||
**Key Features:** | ||
|
||
- **Abstraction:** Hides the complexities of underlying video APIs, allowing you to focus on the core playback experience. | ||
- **Flexibility:** Supports different video providers and allows the creation of custom playback plugins for extended functionalities. | ||
- **Error Handling:** Provides mechanisms to handle potential issues during playback and notify your application. | ||
} | ||
|
||
@Section(title: "Installation") { | ||
@ContentAndMedia { | ||
To install the Playback SDK, follow these steps: | ||
|
||
1. Add the Playback SDK dependency to your project using Swift Package Manager. | ||
|
||
Swift | ||
|
||
``` | ||
dependencies: [ | ||
.package(url: "https://github.com/your-organization/playback-sdk.git", .branch("master")) | ||
] | ||
``` | ||
|
||
2. Import the `PlaybackSDK` module in your Swift files. | ||
|
||
Swift | ||
|
||
``` | ||
import PlaybackSDK | ||
``` | ||
} | ||
|
||
@Steps { | ||
@Step { | ||
**Step 1:** Initialize the Playback SDK by providing your API key. | ||
|
||
@Code(name: "InitializeSdkExample", file: InitializeSdkExample.swift) | ||
} | ||
|
||
@Step { | ||
**Step 2:** Load HLS Stream by providing the entry ID and optional authorization token. | ||
|
||
@Code(name: "LoadHlsStreamTutorial", file: LoadHlsStreamTutorial.swift) | ||
} | ||
|
||
@Step { | ||
**Step 3:** Add player plugin. Note: This should be done in the AppDelegate. | ||
@Code(name: "InstallPlayerPluginTutorial", file: InstallPlayerPluginTutorial.swift) | ||
} | ||
|
||
@Step { | ||
**Step 4:** Load the player view in your player view and handle errors. | ||
@Code(name: "LoadPlayerViewTutorial", file: LoadPlayerViewTutorial.swift) | ||
} | ||
} | ||
} | ||
|
||
@Section(title: "Video Player Plugins (Optional)") { | ||
@ContentAndMedia { | ||
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. | ||
|
||
```swift | ||
// 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() | ||
``` | ||
|
||
@Image(source: "custom_plugin.png", alt: "Custom Video Player Plugin") | ||
} | ||
|
||
@Steps { | ||
@Step { | ||
**Step 1:** Implement your custom player plugin conforming to the `VideoPlayerPlugin` protocol. | ||
|
||
@Image(source: "custom_plugin_step1.png", alt: "Implement Custom Plugin") | ||
} | ||
|
||
@Step { | ||
**Step 2:** Register your custom plugin with the manager and use the selected plugin for playback. | ||
|
||
@Image(source: "custom_plugin_step2.png", alt: "Register Custom Plugin") | ||
@Code(name: "RegisterAndUsePlugin", file: RegisterAndUsePlugin.swift) | ||
} | ||
} | ||
} | ||
|
||
@Section(title: "Error Handling") { | ||
@ContentAndMedia { | ||
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)") | ||
} | ||
} | ||
``` | ||
|
||
@Image(source: "error_handling.png", alt: "Error Handling") | ||
} | ||
} | ||
} |
Oops, something went wrong.