From 55fb8d86f1bccae9c06dd8af8776278dd63d88f7 Mon Sep 17 00:00:00 2001 From: Artem Y <160732886+artem-y-pamediagroup@users.noreply.github.com> Date: Mon, 10 Jun 2024 21:36:40 +0300 Subject: [PATCH 1/7] [ZEUS-4449] Improve readme with better description of user-agent usage --- README.md | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 49c35df..5186c5d 100644 --- a/README.md +++ b/README.md @@ -84,23 +84,33 @@ PlayBackSDKManager.shared.loadPlayer(entryID: entryId, authorizationToken: autho ``` # Playing Access-Controlled Content -To play premium or freemium on-demand and live videos, an `authorizationToken` has to be passed into the player. -Before loading the player, a call to CloudPay to start session must be made with the same token. +To play on-demand and live videos that require authorization, at some point before loading the player your app must call CloudPay to start session, passing the authorization token: ```swift "\(baseURL)/sso/start?token=\(authorizationToken)" ``` -In case a custom `user-agent` header is set for the request when creating a token, it should be passed to the player as well. +Then the same token should be passed into the `loadPlayer(entryID:, authorizationToken:)` method of `PlayBackSDkManager`. +For the free videos that user should be able to watch without logging in, starting the session is not required and `authorizationToken` can be set to an empty string. + +> [!NOTE] +> If the user is authenticated, has enough access level to watch a video, the session was started and the same token was passed to the player but the videos still throw a 401 error, it might be related to these requests having different user-agent headers. + +## Configure user-agent +Sometimes a custom `user-agent` header is automatically set for the requests on iOS when creating a token and starting a session. `Alamofire` and other 3rd party networking frameworks can modify this header to include information about themselves. In such cases they should either be configured to not modify the header, or the custom header should be passed to the player as well. Example: ```swift -PlayBackSDKManager.shared.initialize(apiKey: apiKey, baseURL: baseURL, userAgent: customUserAgent) { result in  - // Handle player UI error  -}  +PlayBackSDKManager.shared.initialize( + apiKey: apiKey, + baseURL: baseURL, + userAgent: customUserAgent +) { result in + // Handle player UI error +} ``` +By default the SDK uses system user agent, so if your app uses native URL Session, the `userAgent` parameter most likely can be omitted. - -**Resources:** +# Resources - **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) From a1d190e307924380e11cf6a0ca7dd47641d81a66 Mon Sep 17 00:00:00 2001 From: Artem Yelizarov Date: Tue, 11 Jun 2024 14:22:52 +0300 Subject: [PATCH 2/7] Moved step 3 into the tutorial to be auto-generated, added minor fixes --- .../Resources/PlayBackAPIError.swift | 25 +++++++++++++++++++ .../Tutorial/GetStarted.tutorial | 7 ++++++ 2 files changed, 32 insertions(+) create mode 100644 Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackAPIError.swift diff --git a/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackAPIError.swift b/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackAPIError.swift new file mode 100644 index 0000000..135296b --- /dev/null +++ b/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackAPIError.swift @@ -0,0 +1,25 @@ +// +// PlayBackAPIError.swift +// +// +// Created by Artem Yelizarov on 11.06.2024. +// + +import Foundation + +public enum PlayBackAPIError: Error { + + case invalidResponsePlaybackData + + case invalidPlaybackDataURL + + case invalidPlayerInformationURL + + case initializationError + + case loadHLSStreamError + + case networkError(Error) + + case apiError(statusCode: Int, message: String) +} diff --git a/Sources/PlaybackSDK/Documentation.docc/Tutorial/GetStarted.tutorial b/Sources/PlaybackSDK/Documentation.docc/Tutorial/GetStarted.tutorial index f358321..8ce0857 100644 --- a/Sources/PlaybackSDK/Documentation.docc/Tutorial/GetStarted.tutorial +++ b/Sources/PlaybackSDK/Documentation.docc/Tutorial/GetStarted.tutorial @@ -34,6 +34,13 @@ @Code(name: "PlayerTestView.swift", file: PlayerTestView.swift) } + @Step { + **Step 3:** + Handle the playback errors from Playback SDK. + + This step describes enum for error handling. Above is the error enum returned by the SDK, where the apiError also has the reason code and message for the API error. The playback API is returning the reason code in the response. For the list of the error codes and reasons, please refer to [Get Video Playback Data | Playback](https://streamamg.stoplight.io/docs/playback-documentation-portal/ec642e6dcbb13-get-video-playback-data) + @Code(name: "PlayBackAPIError.swift", file: PlayBackAPIError.swift) + } } } } From 11c0ace339e91628c4b33ec48182e7227c4422b9 Mon Sep 17 00:00:00 2001 From: Artem Yelizarov Date: Tue, 11 Jun 2024 14:24:54 +0300 Subject: [PATCH 3/7] Remove author comments from documentation examples --- .../Resources/InitializeSdkExample.swift | 7 ------- .../Resources/InstallPlayerPluginTutorial.swift | 7 ------- .../Resources/LoadHlsStreamTutorial.swift | 6 ------ .../Resources/LoadPlayerViewTutorial.swift | 7 ------- .../Documentation.docc/Resources/PlayBackAPIError.swift | 7 ------- .../Documentation.docc/Resources/PlayBackDemoApp.swift | 7 ------- .../Documentation.docc/Resources/PlayerTestView.swift | 7 ------- 7 files changed, 48 deletions(-) diff --git a/Sources/PlaybackSDK/Documentation.docc/Resources/InitializeSdkExample.swift b/Sources/PlaybackSDK/Documentation.docc/Resources/InitializeSdkExample.swift index 49a8ca4..3e8c7ff 100644 --- a/Sources/PlaybackSDK/Documentation.docc/Resources/InitializeSdkExample.swift +++ b/Sources/PlaybackSDK/Documentation.docc/Resources/InitializeSdkExample.swift @@ -1,10 +1,3 @@ -// -// InitializeSdkExample.swift -// -// -// Created by Franco Driansetti on 27/02/2024. -// - import PlaybackSDK PlaybackSDKManager.shared.initialize(apiKey: "YOUR_API_KEY") { result in diff --git a/Sources/PlaybackSDK/Documentation.docc/Resources/InstallPlayerPluginTutorial.swift b/Sources/PlaybackSDK/Documentation.docc/Resources/InstallPlayerPluginTutorial.swift index e8f4ab2..196268b 100644 --- a/Sources/PlaybackSDK/Documentation.docc/Resources/InstallPlayerPluginTutorial.swift +++ b/Sources/PlaybackSDK/Documentation.docc/Resources/InstallPlayerPluginTutorial.swift @@ -1,10 +1,3 @@ -// -// InstallPlayerPluginTutorial.swift -// -// -// Created by Franco Driansetti on 27/02/2024. -// - import Foundation PlayBackSDKManager.shared.initialize(apiKey: settingsManager.apiKey, baseURL: settingsManager.baseURL) { result in diff --git a/Sources/PlaybackSDK/Documentation.docc/Resources/LoadHlsStreamTutorial.swift b/Sources/PlaybackSDK/Documentation.docc/Resources/LoadHlsStreamTutorial.swift index 93b6b5c..4b0e7e0 100644 --- a/Sources/PlaybackSDK/Documentation.docc/Resources/LoadHlsStreamTutorial.swift +++ b/Sources/PlaybackSDK/Documentation.docc/Resources/LoadHlsStreamTutorial.swift @@ -1,9 +1,3 @@ -// -// LoadHlsStreamTutorial.swift -// -// -// Created by Franco Driansetti on 27/02/2024. -// Swift diff --git a/Sources/PlaybackSDK/Documentation.docc/Resources/LoadPlayerViewTutorial.swift b/Sources/PlaybackSDK/Documentation.docc/Resources/LoadPlayerViewTutorial.swift index 0df153c..42046f3 100644 --- a/Sources/PlaybackSDK/Documentation.docc/Resources/LoadPlayerViewTutorial.swift +++ b/Sources/PlaybackSDK/Documentation.docc/Resources/LoadPlayerViewTutorial.swift @@ -1,10 +1,3 @@ -// -// LoadPlayerViewTutorial.swift -// -// -// Created by Franco Driansetti on 27/02/2024. -// - import Foundation PlayBackSDKManager.shared.loadPlayer(entryID: settingsManager.entryId, authorizationToken: settingsManager.authorizationToken, onError: { error in diff --git a/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackAPIError.swift b/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackAPIError.swift index 135296b..3bfb27d 100644 --- a/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackAPIError.swift +++ b/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackAPIError.swift @@ -1,10 +1,3 @@ -// -// PlayBackAPIError.swift -// -// -// Created by Artem Yelizarov on 11.06.2024. -// - import Foundation public enum PlayBackAPIError: Error { diff --git a/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackDemoApp.swift b/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackDemoApp.swift index 7577ced..a1bec0f 100644 --- a/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackDemoApp.swift +++ b/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackDemoApp.swift @@ -1,10 +1,3 @@ -// -// InitializeSdkExample.swift -// -// -// Created by Franco Driansetti on 27/02/2024. -// - import SwiftUI import PlaybackSDK diff --git a/Sources/PlaybackSDK/Documentation.docc/Resources/PlayerTestView.swift b/Sources/PlaybackSDK/Documentation.docc/Resources/PlayerTestView.swift index 3be8d23..07f1700 100644 --- a/Sources/PlaybackSDK/Documentation.docc/Resources/PlayerTestView.swift +++ b/Sources/PlaybackSDK/Documentation.docc/Resources/PlayerTestView.swift @@ -1,10 +1,3 @@ -// -// LoadPlayerViewTutorial.swift -// -// -// Created by Franco Driansetti on 27/02/2024. -// - import SwiftUI import PlaybackSDK From 3c7fa11f8750dad594b0c06df85f2dd7e21d1abe Mon Sep 17 00:00:00 2001 From: Artem Yelizarov Date: Tue, 11 Jun 2024 14:58:16 +0300 Subject: [PATCH 4/7] Generate documentation after updates --- docs/data/documentation/playbacksdk.json | 2 +- .../tutorials/playbacksdk/getstarted.json | 639 +----------------- docs/data/tutorials/table-of-contents.json | 2 +- docs/documentation/playbacksdk/index.html | 2 +- docs/index.html | 2 +- docs/metadata.json | 2 +- docs/theme-settings.json | 7 - .../playbacksdk/getstarted/index.html | 2 +- docs/tutorials/table-of-contents/index.html | 2 +- 9 files changed, 8 insertions(+), 652 deletions(-) delete mode 100644 docs/theme-settings.json diff --git a/docs/data/documentation/playbacksdk.json b/docs/data/documentation/playbacksdk.json index 2b4493d..8526bb9 100644 --- a/docs/data/documentation/playbacksdk.json +++ b/docs/data/documentation/playbacksdk.json @@ -1 +1 @@ -{"metadata":{"role":"collection","symbolKind":"module","externalID":"PlaybackSDK","roleHeading":"Framework","title":"PlaybackSDK","modules":[{"name":"PlaybackSDK"}]},"identifier":{"url":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","interfaceLanguage":"swift"},"sections":[],"hierarchy":{"paths":[[]]},"kind":"symbol","variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/playbacksdk"]}],"schemaVersion":{"minor":3,"major":0,"patch":0},"references":{"doc://PlaybackSDK/documentation/PlaybackSDK":{"title":"PlaybackSDK","role":"collection","abstract":[],"type":"topic","kind":"symbol","url":"\/documentation\/playbacksdk","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK"}}} \ No newline at end of file +{"kind":"symbol","metadata":{"modules":[{"name":"PlaybackSDK"}],"role":"collection","roleHeading":"Framework","externalID":"PlaybackSDK","symbolKind":"module","title":"PlaybackSDK"},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK"},"sections":[],"schemaVersion":{"major":0,"minor":3,"patch":0},"variants":[{"paths":["\/documentation\/playbacksdk"],"traits":[{"interfaceLanguage":"swift"}]}],"hierarchy":{"paths":[[]]},"references":{"doc://PlaybackSDK/documentation/PlaybackSDK":{"role":"collection","kind":"symbol","url":"\/documentation\/playbacksdk","abstract":[],"type":"topic","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","title":"PlaybackSDK"}}} \ No newline at end of file diff --git a/docs/data/tutorials/playbacksdk/getstarted.json b/docs/data/tutorials/playbacksdk/getstarted.json index 1b4bd99..a00bc22 100644 --- a/docs/data/tutorials/playbacksdk/getstarted.json +++ b/docs/data/tutorials/playbacksdk/getstarted.json @@ -1,638 +1 @@ -{ - "sections": [ - { - "chapter": "Getting Started", - "estimatedTimeInMinutes": 30, - "title": "Playback SDK Overview", - "content": [ - { - "inlineContent": [ - { - "type": "text", - "text": "Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic." - } - ], - "type": "paragraph" - }, - { - "inlineContent": [ - { - "inlineContent": [ - { - "type": "text", - "text": "Key Features:" - } - ], - "type": "strong" - } - ], - "type": "paragraph" - }, - { - "items": [ - { - "content": [ - { - "type": "paragraph", - "inlineContent": [ - { - "type": "strong", - "inlineContent": [ - { - "type": "text", - "text": "Abstraction:" - } - ] - }, - { - "text": " Hides the complexities of underlying video APIs, allowing you to focus on the core playback experience.", - "type": "text" - } - ] - } - ] - }, - { - "content": [ - { - "inlineContent": [ - { - "inlineContent": [ - { - "text": "Flexibility:", - "type": "text" - } - ], - "type": "strong" - }, - { - "type": "text", - "text": " Supports different video providers and allows the creation of custom playback plugins for extended functionalities." - } - ], - "type": "paragraph" - } - ] - }, - { - "content": [ - { - "inlineContent": [ - { - "type": "strong", - "inlineContent": [ - { - "type": "text", - "text": "Error Handling:" - } - ] - }, - { - "type": "text", - "text": " Provides mechanisms to handle potential issues during playback and notify your application." - } - ], - "type": "paragraph" - } - ] - } - ], - "type": "unorderedList" - } - ], - "kind": "hero" - }, - { - "tasks": [ - { - "title": "Playback SDK", - "stepsSection": [ - { - "content": [ - { - "type": "paragraph", - "inlineContent": [ - { - "type": "strong", - "inlineContent": [ - { - "text": "Step 1:", - "type": "text" - } - ] - }, - { - "type": "text", - "text": " Initialize the Playback SDK by providing your API key and register the default player plugin." - }, - { - "type": "text", - "text": " " - }, - { - "inlineContent": [ - { - "text": "Make sure this step is done when the app starts.", - "type": "text" - } - ], - "type": "strong" - } - ] - } - ], - "caption": [], - "type": "step", - "media": null, - "code": "PlayBackDemoApp.swift", - "runtimePreview": null - }, - { - "content": [ - { - "type": "paragraph", - "inlineContent": [ - { - "type": "strong", - "inlineContent": [ - { - "type": "text", - "text": "Step 2:" - } - ] - }, - { - "type": "text", - "text": "" - }, - { - "text": " ", - "type": "text" - }, - { - "type": "text", - "text": "Load the player using the Playback SDK and handle any playback errors." - } - ] - } - ], - "type": "step", - "media": null, - "code": "PlayerTestView.swift", - "runtimePreview": null, - "caption": [ - { - "type": "paragraph", - "inlineContent": [ - { - "type": "text", - "text": "In this step, the code utilizes the " - }, - { - "type": "strong", - "inlineContent": [ - { - "text": "loadPlayer", - "type": "text" - } - ] - }, - { - "type": "text", - "text": " function provided by the Playback SDK to initialize and load the video player. The function takes the entry ID and authorization token as parameters. Additionally, it includes a closure to handle any potential playback errors that may occur during the loading process." - }, - { - "type": "text", - "text": " " - }, - { - "type": "text", - "text": "The " - }, - { - "type": "strong", - "inlineContent": [ - { - "type": "text", - "text": "handlePlaybackError" - } - ] - }, - { - "type": "text", - "text": " function is called within the closure to handle the playback errors. It switches on the type of error received and provides appropriate error handling based on the type of error encountered." - }, - { - "type": "text", - "text": " " - }, - { - "type": "text", - "text": "The code also includes a placeholder comment to indicate where the removal of the player could be implemented in the " - }, - { - "type": "strong", - "inlineContent": [ - { - "type": "text", - "text": "onDisappear" - } - ] - }, - { - "type": "text", - "text": " modifier." - }, - { - "type": "paragraph", - "inlineContent": [ - { - "type": "text", - "text": "If you want to allow users to access free content or if you're implementing a guest mode, you can pass an empty string or " - }, - { - "type": "strong", - "inlineContent": [ - { - "type": "text", - "text": "nil" - } - ] - }, - { - "type": "text", - "text": " value as the " - }, - { - "type": "strong", - "inlineContent": [ - { - "type": "text", - "text": "authorizationToken" - } - ] - }, - { - "type": "text", - "text": " when calling the " - }, - { - "type": "strong", - "inlineContent": [ - { - "type": "text", - "text": "loadPlayer" - } - ] - }, - { - "type": "text", - "text": " function. This will bypass the need for authentication, enabling unrestricted access to the specified content." - } - ] - } - ] - } - ] - }, - { - "content": [ - { - "type": "paragraph", - "inlineContent": [ - { - "type": "strong", - "inlineContent": [ - { - "type": "text", - "text": "Step 3:" - } - ] - }, - { - "type": "text", - "text": "" - }, - { - "text": " ", - "type": "text" - }, - { - "type": "text", - "text": "Load the player using the Playback SDK and handle any playback errors." - } - ] - } - ], - "type": "step", - "media": null, - "code": "Errors.swift", - "runtimePreview": null, - "caption": [ - { - "type": "paragraph", - "inlineContent": [ - { - "type": "text", - "text": "In this step described enum for error handling. " - }, - { - "type": "text", - "text": "Above is the error enum returned by the SDK, in this the apiError also return the reason code and message for the API error. " - }, - { - "type": "text", - "text": "The playback API is returning the reason code in the response , refer " - }, - { - "overridingTitle": "Get Video Playback Data | Playback", - "type": "reference", - "identifier": "playback_link", - "isActive": true - } - ] - } - ] - } - ], - "anchor": "PlayBack-SDK", - "contentSection": [ - { - "content": [ - { - "inlineContent": [ - { - "type": "strong", - "inlineContent": [ - { - "text": "Explore how to use StreamAMG Playback SDK.", - "type": "text" - } - ] - } - ], - "type": "paragraph" - } - ], - "kind": "fullWidth" - } - ] - } - ], - "kind": "tasks" - } - ], - "hierarchy": { - "reference": "doc://PlaybackSDK/tutorials/Table-Of-Contents", - "modules": [ - { - "reference": "doc://PlaybackSDK/tutorials/Table-Of-Contents/Getting-Started", - "projects": [ - { - "reference": "doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted", - "sections": [ - { - "kind": "task", - "reference": "doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted#PlayBack-SDK" - } - ] - } - ] - } - ], - "paths": [ - [ - "doc://PlaybackSDK/tutorials/Table-Of-Contents", - "doc://PlaybackSDK/tutorials/Table-Of-Contents/$volume", - "doc://PlaybackSDK/tutorials/Table-Of-Contents/Getting-Started" - ] - ] - }, - "kind": "project", - "metadata": { - "title": "Playback SDK Overview", - "category": "PlaybackSDK Tutorial", - "categoryPathComponent": "Table-Of-Contents", - "role": "project" - }, - "schemaVersion": { - "major": 0, - "minor": 3, - "patch": 0 - }, - "variants": [ - { - "traits": [ - { - "interfaceLanguage": "swift" - } - ], - "paths": [ - "/tutorials/playbacksdk/getstarted" - ] - } - ], - "identifier": { - "interfaceLanguage": "swift", - "url": "doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted" - }, - "references": { - "PlayerTestView.swift": { - "identifier": "PlayerTestView.swift", - "content": [ - "//", - "// LoadPlayerViewTutorial.swift", - "//", - "//", - "// Created by Franco Driansetti on 27/02/2024.", - "//", - "", - "import SwiftUI", - "import PlaybackSDK", - "", - "struct PlayerTestView: View {", - " ", - " private let entryID = \"ENTRY_ID\"", - " private let authorizationToken = \"JWT_TOKEN\"", - " ", - " var body: some View {", - " VStack {", - " // Load player with the playback SDK", - " PlayBackSDKManager.shared.loadPlayer(entryID: entryID, authorizationToken: authorizationToken) { error in", - " handlePlaybackError(error)", - " }", - " .onDisappear {", - " // Remove the player here", - " }", - " Spacer()", - " }", - " .padding()", - " }", - " ", - " private func handlePlaybackError(_ error: PlaybackError) {", - " switch error {", - " case .apiError(let statusCode, let errorMessage, let reason):", - " print(\"\\(errorMessage) Status Code \\(statusCode)\")", - " errorMessage = \"\\(errorMessage) Status Code \\(statusCode) Reason \\(reason)\"", - " default:", - " print(\"Error loading HLS stream in PlaybackUIView: \\(error.localizedDescription)\")", - " errorMessage = \"Error code and errorrMessage not found: \\(error.localizedDescription)\"", - " }", - " }", - " ", - "}" - ], - "syntax": "swift", - "fileType": "swift", - "highlights": [], - "fileName": "PlayerTestView.swift", - "type": "file" - }, - "Errors.swift": { - "identifier": "Errors.swift", - "highlights": [], - "fileType": "swift", - "type": "file", - "syntax": "swift", - "fileName": "Errors.swift", - "content": [ - "", - "public enum PlayBackAPIError: Error {", - "", - " case invalidResponsePlaybackData", - "", - " case invalidPlaybackDataURL", - "", - " case invalidPlayerInformationURL", - "", - " case initializationError", - "", - " case loadHLSStreamError", - "", - " case networkError(Error)", - "", - " case apiError(statusCode: Int, message: String)", - "", - "}" - ] - }, - "PlayBackDemoApp.swift": { - "identifier": "PlayBackDemoApp.swift", - "highlights": [], - "fileType": "swift", - "type": "file", - "syntax": "swift", - "fileName": "PlayBackDemoApp.swift", - "content": [ - "//", - "// 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)\")", - " ", - " }", - " }", - " }", - "}" - ] - }, - "doc://PlaybackSDK/tutorials/Table-Of-Contents/Getting-Started": { - "title": "Getting Started", - "identifier": "doc://PlaybackSDK/tutorials/Table-Of-Contents/Getting-Started", - "role": "article", - "url": "/tutorials/table-of-contents/getting-started", - "abstract": [], - "kind": "article", - "type": "topic" - }, - "doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted": { - "title": "Playback SDK Overview", - "abstract": [ - { - "text": "Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic.", - "type": "text" - } - ], - "identifier": "doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted", - "url": "/tutorials/playbacksdk/getstarted", - "kind": "project", - "role": "project", - "estimatedTime": "30min", - "type": "topic" - }, - "doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted#PlayBack-SDK": { - "title": "Playback SDK", - "role": "pseudoSymbol", - "type": "section", - "url": "/tutorials/playbacksdk/getstarted#PlayBack-SDK", - "kind": "section", - "identifier": "doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted#PlayBack-SDK", - "abstract": [ - { - "text": "Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic.", - "type": "text" - } - ] - }, - "playback_link": { - "title": "Get Video Playback Data | Playback", - "role": "overview", - "type": "topic", - "role": "overview", - "url": "https://streamamg.stoplight.io/docs/playback-documentation-portal/ec642e6dcbb13-get-video-playback-data", - "kind": "section", - "identifier": "Get Video Playback Data | Playback ", - "abstract": [ - { - "text": "Get Video Playback Data | Playback", - "type": "text" - } - ] - }, - "doc://PlaybackSDK/tutorials/Table-Of-Contents": { - "identifier": "doc://PlaybackSDK/tutorials/Table-Of-Contents", - "kind": "overview", - "role": "overview", - "abstract": [ - { - "text": "Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications.", - "type": "text" - } - ], - "url": "/tutorials/table-of-contents", - "title": "Introduction to PlaybackSDK", - "type": "topic" - } - } - } \ No newline at end of file +{"kind":"project","hierarchy":{"modules":[{"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/Getting-Started","projects":[{"sections":[{"kind":"task","reference":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted#Playback-SDK"}],"reference":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted"}]}],"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","paths":[["doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/$volume","doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/Getting-Started"]]},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted"},"schemaVersion":{"minor":3,"patch":0,"major":0},"metadata":{"title":"Playback SDK Overview","role":"project","category":"PlaybackSDK Tutorial","categoryPathComponent":"Table-Of-Contents"},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/tutorials\/playbacksdk\/getstarted"]}],"sections":[{"content":[{"inlineContent":[{"type":"text","text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic."}],"type":"paragraph"},{"inlineContent":[{"type":"strong","inlineContent":[{"type":"text","text":"Key Features:"}]}],"type":"paragraph"},{"type":"unorderedList","items":[{"content":[{"type":"paragraph","inlineContent":[{"type":"strong","inlineContent":[{"type":"text","text":"Abstraction:"}]},{"type":"text","text":" Hides the complexities of underlying video APIs, allowing you to focus on the core playback experience."}]}]},{"content":[{"inlineContent":[{"type":"strong","inlineContent":[{"type":"text","text":"Flexibility:"}]},{"type":"text","text":" Supports different video providers and allows the creation of custom playback plugins for extended functionalities."}],"type":"paragraph"}]},{"content":[{"type":"paragraph","inlineContent":[{"type":"strong","inlineContent":[{"type":"text","text":"Error Handling:"}]},{"type":"text","text":" Provides mechanisms to handle potential issues during playback and notify your application."}]}]}]}],"title":"Playback SDK Overview","chapter":"Getting Started","estimatedTimeInMinutes":30,"kind":"hero"},{"kind":"tasks","tasks":[{"title":"Playback SDK","contentSection":[{"kind":"fullWidth","content":[{"type":"paragraph","inlineContent":[{"inlineContent":[{"text":"Explore how to use StreamAMG Playback SDK.","type":"text"}],"type":"strong"}]}]}],"stepsSection":[{"content":[{"type":"paragraph","inlineContent":[{"type":"strong","inlineContent":[{"text":"Step 1:","type":"text"}]},{"type":"text","text":" Initialize the Playback SDK by providing your API key and register the default player plugin."},{"text":" ","type":"text"},{"type":"strong","inlineContent":[{"type":"text","text":"Make sure this step is done when the app starts."}]}]}],"media":null,"caption":[],"type":"step","code":"PlayBackDemoApp.swift","runtimePreview":null},{"content":[{"type":"paragraph","inlineContent":[{"type":"strong","inlineContent":[{"text":"Step 2:","type":"text"}]},{"type":"text","text":""},{"text":" ","type":"text"},{"type":"text","text":"Load the player using the Playback SDK and handle any playback errors."}]}],"media":null,"code":"PlayerTestView.swift","caption":[{"type":"paragraph","inlineContent":[{"text":"In this step, the code utilizes the ","type":"text"},{"type":"strong","inlineContent":[{"type":"text","text":"loadPlayer"}]},{"type":"text","text":" function provided by the Playback SDK to initialize and load the video player. The function takes the entry ID and authorization token as parameters. Additionally, it includes a closure to handle any potential playback errors that may occur during the loading process."},{"text":" ","type":"text"},{"text":"The ","type":"text"},{"type":"strong","inlineContent":[{"type":"text","text":"handlePlaybackError"}]},{"text":" function is called within the closure to handle the playback errors. It switches on the type of error received and provides appropriate error handling based on the type of error encountered.","type":"text"},{"text":" ","type":"text"},{"type":"text","text":"The code also includes a placeholder comment to indicate where the removal of the player could be implemented in the "},{"type":"strong","inlineContent":[{"text":"onDisappear","type":"text"}]},{"text":" modifier.","type":"text"},{"type":"text","text":" "},{"type":"text","text":"If you want to allow users to access free content or if you’re implementing a guest mode, you can pass an empty string or "},{"inlineContent":[{"type":"text","text":"nil"}],"type":"strong"},{"type":"text","text":" value as the "},{"inlineContent":[{"type":"text","text":"authorizationToken"}],"type":"strong"},{"type":"text","text":" when calling the "},{"type":"strong","inlineContent":[{"type":"text","text":"loadPlayer"}]},{"text":" function. This will bypass the need for authentication, enabling unrestricted access to the specified content.","type":"text"}]}],"type":"step","runtimePreview":null},{"caption":[{"type":"paragraph","inlineContent":[{"type":"text","text":"This step describes enum for error handling. Above is the error enum returned by the SDK, where the apiError also has the reason code and message for the API error. The playback API is returning the reason code in the response. For the list of the error codes and reasons, please refer to "},{"identifier":"https:\/\/streamamg.stoplight.io\/docs\/playback-documentation-portal\/ec642e6dcbb13-get-video-playback-data","isActive":true,"type":"reference"}]}],"content":[{"type":"paragraph","inlineContent":[{"inlineContent":[{"text":"Step 3:","type":"text"}],"type":"strong"},{"text":" ","type":"text"},{"text":"Handle the playback errors from Playback SDK.","type":"text"}]}],"type":"step","code":"PlayBackAPIError.swift","media":null,"runtimePreview":null}],"anchor":"Playback-SDK"}]}],"references":{"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted":{"role":"project","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","title":"Playback SDK Overview","type":"topic","kind":"project","estimatedTime":"30min","url":"\/tutorials\/playbacksdk\/getstarted","abstract":[{"type":"text","text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic."}]},"PlayBackAPIError.swift":{"highlights":[],"type":"file","identifier":"PlayBackAPIError.swift","fileName":"PlayBackAPIError.swift","fileType":"swift","syntax":"swift","content":["import Foundation","","public enum PlayBackAPIError: Error {",""," case invalidResponsePlaybackData",""," case invalidPlaybackDataURL",""," case invalidPlayerInformationURL",""," case initializationError",""," case loadHLSStreamError",""," case networkError(Error)",""," case apiError(statusCode: Int, message: String)","}"]},"doc://PlaybackSDK/tutorials/Table-Of-Contents":{"role":"overview","identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","title":"Introduction to PlaybackSDK","type":"topic","kind":"overview","url":"\/tutorials\/table-of-contents","abstract":[{"type":"text","text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications."}]},"doc://PlaybackSDK/tutorials/Table-Of-Contents/Getting-Started":{"kind":"article","identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/Getting-Started","abstract":[],"title":"Getting Started","type":"topic","role":"article","url":"\/tutorials\/table-of-contents\/getting-started"},"PlayBackDemoApp.swift":{"fileName":"PlayBackDemoApp.swift","highlights":[],"type":"file","fileType":"swift","syntax":"swift","identifier":"PlayBackDemoApp.swift","content":["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)\")"," "," }"," }"," }","}"]},"PlayerTestView.swift":{"fileType":"swift","syntax":"swift","fileName":"PlayerTestView.swift","identifier":"PlayerTestView.swift","type":"file","highlights":[],"content":["import SwiftUI","import PlaybackSDK","","struct PlayerTestView: View {"," "," private let entryID = \"ENTRY_ID\""," private let authorizationToken = \"JWT_TOKEN\""," "," var body: some View {"," VStack {"," \/\/ Load player with the playback SDK"," PlayBackSDKManager.shared.loadPlayer(entryID: entryID, authorizationToken: authorizationToken) { error in"," handlePlaybackError(error)"," }"," .onDisappear {"," \/\/ Remove the player here"," }"," Spacer()"," }"," .padding()"," }"," "," private func handlePlaybackError(_ error: PlaybackError) {"," switch error {"," case .apiError(let statusCode, let errorMessage, let reason):"," print(\"\\(errorMessage) Status Code \\(statusCode)\")"," errorMessage = \"\\(errorMessage) Status Code \\(statusCode) Reason \\(reason)\""," default:"," print(\"Error loading HLS stream in PlaybackUIView: \\(error.localizedDescription)\")"," errorMessage = \"Error code and errorrMessage not found: \\(error.localizedDescription)\""," }"," }"," ","}"]},"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted#Playback-SDK":{"role":"pseudoSymbol","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted#Playback-SDK","type":"section","title":"Playback SDK","kind":"section","abstract":[{"text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic.","type":"text"}],"url":"\/tutorials\/playbacksdk\/getstarted#Playback-SDK"},"https://streamamg.stoplight.io/docs/playback-documentation-portal/ec642e6dcbb13-get-video-playback-data":{"type":"link","url":"https:\/\/streamamg.stoplight.io\/docs\/playback-documentation-portal\/ec642e6dcbb13-get-video-playback-data","title":"Get Video Playback Data | Playback","titleInlineContent":[{"text":"Get Video Playback Data | Playback","type":"text"}],"identifier":"https:\/\/streamamg.stoplight.io\/docs\/playback-documentation-portal\/ec642e6dcbb13-get-video-playback-data"}}} \ No newline at end of file diff --git a/docs/data/tutorials/table-of-contents.json b/docs/data/tutorials/table-of-contents.json index f653b1b..6f48e05 100644 --- a/docs/data/tutorials/table-of-contents.json +++ b/docs/data/tutorials/table-of-contents.json @@ -1 +1 @@ -{"metadata":{"category":"PlaybackSDK Tutorial","title":"Introduction to PlaybackSDK","estimatedTime":"30min","categoryPathComponent":"Table-Of-Contents","role":"overview"},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents"},"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications."}]}],"action":{"identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","type":"reference","isActive":true,"overridingTitle":"Get started","overridingTitleInlineContent":[{"text":"Get started","type":"text"}]},"kind":"hero","title":"Introduction to PlaybackSDK"},{"name":null,"kind":"volume","chapters":[{"content":[{"type":"paragraph","inlineContent":[{"text":"In this chapter, we’ll start by setting up the PlaybackSDK from the initialisation to load the Playback Player Plugin.","type":"text"}]}],"name":"Getting Started","image":"ios-marketing.png","tutorials":["doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted"]}],"image":null,"content":[]},{"tiles":[{"identifier":"documentation","title":"Documentation","content":[{"inlineContent":[{"text":"Browse and search the PlaybackSDK documentation.","type":"text"}],"type":"paragraph"},{"type":"unorderedList","items":[{"content":[{"inlineContent":[{"type":"reference","identifier":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","isActive":true}],"type":"paragraph"}]},{"content":[{"type":"paragraph","inlineContent":[{"isActive":true,"identifier":"https:\/\/streamamg.stoplight.io","type":"reference"}]}]}]}]}],"content":[{"inlineContent":[{"type":"text","text":"Explore more resources for learning about PlaybackSDK."}],"type":"paragraph"}],"kind":"resources"}],"hierarchy":{"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","paths":[]},"kind":"overview","variants":[{"paths":["\/tutorials\/table-of-contents"],"traits":[{"interfaceLanguage":"swift"}]}],"references":{"ios-marketing.png":{"variants":[{"url":"\/images\/ios-marketing.png","traits":["1x","light"]}],"identifier":"ios-marketing.png","type":"image","alt":"Getting Started with PlaybackSDK"},"https://streamamg.stoplight.io":{"identifier":"https:\/\/streamamg.stoplight.io","title":"Stoplight Playback API","titleInlineContent":[{"text":"Stoplight Playback API","type":"text"}],"url":"https:\/\/streamamg.stoplight.io","type":"link"},"doc://PlaybackSDK/tutorials/Table-Of-Contents":{"identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","kind":"overview","role":"overview","abstract":[{"text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications.","type":"text"}],"url":"\/tutorials\/table-of-contents","title":"Introduction to PlaybackSDK","type":"topic"},"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted":{"title":"Playback SDK Overview","abstract":[{"text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic.","type":"text"}],"identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","url":"\/tutorials\/playbacksdk\/getstarted","kind":"project","role":"project","estimatedTime":"30min","type":"topic"},"https://github.com/StreamAMG/playback-sdk-ios/tree/main":{"identifier":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","title":"GitHub Repository","url":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","titleInlineContent":[{"text":"GitHub Repository","type":"text"}],"type":"link"}}} \ No newline at end of file +{"sections":[{"title":"Introduction to PlaybackSDK","kind":"hero","action":{"isActive":true,"overridingTitle":"Get started","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","overridingTitleInlineContent":[{"type":"text","text":"Get started"}],"type":"reference"},"content":[{"inlineContent":[{"text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications.","type":"text"}],"type":"paragraph"}]},{"name":null,"kind":"volume","chapters":[{"name":"Getting Started","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"In this chapter, we’ll start by setting up the PlaybackSDK from the initialisation to load the PlayBack Player Plugin."}]}],"tutorials":["doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted"],"image":"ios-marketing.png"}],"image":null,"content":[]},{"tiles":[{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Browse and search the PlaybackSDK documentation."}]},{"items":[{"content":[{"inlineContent":[{"isActive":true,"identifier":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","type":"reference"}],"type":"paragraph"}]},{"content":[{"type":"paragraph","inlineContent":[{"isActive":true,"identifier":"https:\/\/streamamg.stoplight.io","type":"reference"}]}]}],"type":"unorderedList"}],"identifier":"documentation","title":"Documentation"}],"content":[{"inlineContent":[{"text":"Explore more resources for learning about PlaybackSDK.","type":"text"}],"type":"paragraph"}],"kind":"resources"}],"kind":"overview","schemaVersion":{"patch":0,"minor":3,"major":0},"metadata":{"role":"overview","category":"PlaybackSDK Tutorial","categoryPathComponent":"Table-Of-Contents","estimatedTime":"30min","title":"Introduction to PlaybackSDK"},"identifier":{"url":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","interfaceLanguage":"swift"},"hierarchy":{"paths":[],"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents"},"variants":[{"paths":["\/tutorials\/table-of-contents"],"traits":[{"interfaceLanguage":"swift"}]}],"references":{"doc://PlaybackSDK/tutorials/Table-Of-Contents":{"role":"overview","identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","title":"Introduction to PlaybackSDK","type":"topic","kind":"overview","url":"\/tutorials\/table-of-contents","abstract":[{"type":"text","text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications."}]},"ios-marketing.png":{"variants":[{"traits":["1x","light"],"url":"\/images\/ios-marketing.png"}],"alt":"Getting Started with PlaybackSDK","identifier":"ios-marketing.png","type":"image"},"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted":{"role":"project","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","title":"Playback SDK Overview","type":"topic","kind":"project","estimatedTime":"30min","url":"\/tutorials\/playbacksdk\/getstarted","abstract":[{"type":"text","text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic."}]},"https://streamamg.stoplight.io":{"titleInlineContent":[{"type":"text","text":"Stoplight PlayBack API"}],"url":"https:\/\/streamamg.stoplight.io","title":"Stoplight PlayBack API","identifier":"https:\/\/streamamg.stoplight.io","type":"link"},"https://github.com/StreamAMG/playback-sdk-ios/tree/main":{"title":"GitHub Repository","identifier":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","type":"link","titleInlineContent":[{"type":"text","text":"GitHub Repository"}],"url":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main"}}} \ No newline at end of file diff --git a/docs/documentation/playbacksdk/index.html b/docs/documentation/playbacksdk/index.html index c25d820..d5df4d7 100644 --- a/docs/documentation/playbacksdk/index.html +++ b/docs/documentation/playbacksdk/index.html @@ -1 +1 @@ -Documentation
\ No newline at end of file +Documentation
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index c25d820..d5df4d7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -Documentation
\ No newline at end of file +Documentation
\ No newline at end of file diff --git a/docs/metadata.json b/docs/metadata.json index 2820538..3988104 100644 --- a/docs/metadata.json +++ b/docs/metadata.json @@ -1 +1 @@ -{"bundleIdentifier":"PlaybackSDK","bundleDisplayName":"PlaybackSDK","schemaVersion":{"major":0,"patch":0,"minor":1}} \ No newline at end of file +{"bundleIdentifier":"PlaybackSDK","bundleDisplayName":"PlaybackSDK","schemaVersion":{"major":0,"minor":1,"patch":0}} \ No newline at end of file diff --git a/docs/theme-settings.json b/docs/theme-settings.json deleted file mode 100644 index 0fd159a..0000000 --- a/docs/theme-settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "theme": { - "color": { - "documentation-intro-fill": "rebeccapurple" - } - } -} diff --git a/docs/tutorials/playbacksdk/getstarted/index.html b/docs/tutorials/playbacksdk/getstarted/index.html index c25d820..d5df4d7 100644 --- a/docs/tutorials/playbacksdk/getstarted/index.html +++ b/docs/tutorials/playbacksdk/getstarted/index.html @@ -1 +1 @@ -Documentation
\ No newline at end of file +Documentation
\ No newline at end of file diff --git a/docs/tutorials/table-of-contents/index.html b/docs/tutorials/table-of-contents/index.html index c25d820..d5df4d7 100644 --- a/docs/tutorials/table-of-contents/index.html +++ b/docs/tutorials/table-of-contents/index.html @@ -1 +1 @@ -Documentation
\ No newline at end of file +Documentation
\ No newline at end of file From d172c441e5557a56508ee5ad2a8c9fb97dc650a7 Mon Sep 17 00:00:00 2001 From: Artem Yelizarov Date: Tue, 11 Jun 2024 15:02:44 +0300 Subject: [PATCH 5/7] Use playback-sdk-ios as hosting base path --- docs/data/documentation/playbacksdk.json | 2 +- docs/data/tutorials/playbacksdk/getstarted.json | 2 +- docs/data/tutorials/table-of-contents.json | 2 +- docs/documentation/playbacksdk/index.html | 2 +- docs/index.html | 2 +- docs/metadata.json | 2 +- docs/tutorials/playbacksdk/getstarted/index.html | 2 +- docs/tutorials/table-of-contents/index.html | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/data/documentation/playbacksdk.json b/docs/data/documentation/playbacksdk.json index 8526bb9..adba963 100644 --- a/docs/data/documentation/playbacksdk.json +++ b/docs/data/documentation/playbacksdk.json @@ -1 +1 @@ -{"kind":"symbol","metadata":{"modules":[{"name":"PlaybackSDK"}],"role":"collection","roleHeading":"Framework","externalID":"PlaybackSDK","symbolKind":"module","title":"PlaybackSDK"},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK"},"sections":[],"schemaVersion":{"major":0,"minor":3,"patch":0},"variants":[{"paths":["\/documentation\/playbacksdk"],"traits":[{"interfaceLanguage":"swift"}]}],"hierarchy":{"paths":[[]]},"references":{"doc://PlaybackSDK/documentation/PlaybackSDK":{"role":"collection","kind":"symbol","url":"\/documentation\/playbacksdk","abstract":[],"type":"topic","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","title":"PlaybackSDK"}}} \ No newline at end of file +{"kind":"symbol","schemaVersion":{"major":0,"patch":0,"minor":3},"hierarchy":{"paths":[[]]},"identifier":{"url":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","interfaceLanguage":"swift"},"metadata":{"title":"PlaybackSDK","modules":[{"name":"PlaybackSDK"}],"role":"collection","symbolKind":"module","externalID":"PlaybackSDK","roleHeading":"Framework"},"sections":[],"variants":[{"paths":["\/documentation\/playbacksdk"],"traits":[{"interfaceLanguage":"swift"}]}],"references":{"doc://PlaybackSDK/documentation/PlaybackSDK":{"identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","url":"\/documentation\/playbacksdk","kind":"symbol","title":"PlaybackSDK","type":"topic","role":"collection","abstract":[]}}} \ No newline at end of file diff --git a/docs/data/tutorials/playbacksdk/getstarted.json b/docs/data/tutorials/playbacksdk/getstarted.json index a00bc22..19bd758 100644 --- a/docs/data/tutorials/playbacksdk/getstarted.json +++ b/docs/data/tutorials/playbacksdk/getstarted.json @@ -1 +1 @@ -{"kind":"project","hierarchy":{"modules":[{"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/Getting-Started","projects":[{"sections":[{"kind":"task","reference":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted#Playback-SDK"}],"reference":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted"}]}],"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","paths":[["doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/$volume","doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/Getting-Started"]]},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted"},"schemaVersion":{"minor":3,"patch":0,"major":0},"metadata":{"title":"Playback SDK Overview","role":"project","category":"PlaybackSDK Tutorial","categoryPathComponent":"Table-Of-Contents"},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/tutorials\/playbacksdk\/getstarted"]}],"sections":[{"content":[{"inlineContent":[{"type":"text","text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic."}],"type":"paragraph"},{"inlineContent":[{"type":"strong","inlineContent":[{"type":"text","text":"Key Features:"}]}],"type":"paragraph"},{"type":"unorderedList","items":[{"content":[{"type":"paragraph","inlineContent":[{"type":"strong","inlineContent":[{"type":"text","text":"Abstraction:"}]},{"type":"text","text":" Hides the complexities of underlying video APIs, allowing you to focus on the core playback experience."}]}]},{"content":[{"inlineContent":[{"type":"strong","inlineContent":[{"type":"text","text":"Flexibility:"}]},{"type":"text","text":" Supports different video providers and allows the creation of custom playback plugins for extended functionalities."}],"type":"paragraph"}]},{"content":[{"type":"paragraph","inlineContent":[{"type":"strong","inlineContent":[{"type":"text","text":"Error Handling:"}]},{"type":"text","text":" Provides mechanisms to handle potential issues during playback and notify your application."}]}]}]}],"title":"Playback SDK Overview","chapter":"Getting Started","estimatedTimeInMinutes":30,"kind":"hero"},{"kind":"tasks","tasks":[{"title":"Playback SDK","contentSection":[{"kind":"fullWidth","content":[{"type":"paragraph","inlineContent":[{"inlineContent":[{"text":"Explore how to use StreamAMG Playback SDK.","type":"text"}],"type":"strong"}]}]}],"stepsSection":[{"content":[{"type":"paragraph","inlineContent":[{"type":"strong","inlineContent":[{"text":"Step 1:","type":"text"}]},{"type":"text","text":" Initialize the Playback SDK by providing your API key and register the default player plugin."},{"text":" ","type":"text"},{"type":"strong","inlineContent":[{"type":"text","text":"Make sure this step is done when the app starts."}]}]}],"media":null,"caption":[],"type":"step","code":"PlayBackDemoApp.swift","runtimePreview":null},{"content":[{"type":"paragraph","inlineContent":[{"type":"strong","inlineContent":[{"text":"Step 2:","type":"text"}]},{"type":"text","text":""},{"text":" ","type":"text"},{"type":"text","text":"Load the player using the Playback SDK and handle any playback errors."}]}],"media":null,"code":"PlayerTestView.swift","caption":[{"type":"paragraph","inlineContent":[{"text":"In this step, the code utilizes the ","type":"text"},{"type":"strong","inlineContent":[{"type":"text","text":"loadPlayer"}]},{"type":"text","text":" function provided by the Playback SDK to initialize and load the video player. The function takes the entry ID and authorization token as parameters. Additionally, it includes a closure to handle any potential playback errors that may occur during the loading process."},{"text":" ","type":"text"},{"text":"The ","type":"text"},{"type":"strong","inlineContent":[{"type":"text","text":"handlePlaybackError"}]},{"text":" function is called within the closure to handle the playback errors. It switches on the type of error received and provides appropriate error handling based on the type of error encountered.","type":"text"},{"text":" ","type":"text"},{"type":"text","text":"The code also includes a placeholder comment to indicate where the removal of the player could be implemented in the "},{"type":"strong","inlineContent":[{"text":"onDisappear","type":"text"}]},{"text":" modifier.","type":"text"},{"type":"text","text":" "},{"type":"text","text":"If you want to allow users to access free content or if you’re implementing a guest mode, you can pass an empty string or "},{"inlineContent":[{"type":"text","text":"nil"}],"type":"strong"},{"type":"text","text":" value as the "},{"inlineContent":[{"type":"text","text":"authorizationToken"}],"type":"strong"},{"type":"text","text":" when calling the "},{"type":"strong","inlineContent":[{"type":"text","text":"loadPlayer"}]},{"text":" function. This will bypass the need for authentication, enabling unrestricted access to the specified content.","type":"text"}]}],"type":"step","runtimePreview":null},{"caption":[{"type":"paragraph","inlineContent":[{"type":"text","text":"This step describes enum for error handling. Above is the error enum returned by the SDK, where the apiError also has the reason code and message for the API error. The playback API is returning the reason code in the response. For the list of the error codes and reasons, please refer to "},{"identifier":"https:\/\/streamamg.stoplight.io\/docs\/playback-documentation-portal\/ec642e6dcbb13-get-video-playback-data","isActive":true,"type":"reference"}]}],"content":[{"type":"paragraph","inlineContent":[{"inlineContent":[{"text":"Step 3:","type":"text"}],"type":"strong"},{"text":" ","type":"text"},{"text":"Handle the playback errors from Playback SDK.","type":"text"}]}],"type":"step","code":"PlayBackAPIError.swift","media":null,"runtimePreview":null}],"anchor":"Playback-SDK"}]}],"references":{"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted":{"role":"project","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","title":"Playback SDK Overview","type":"topic","kind":"project","estimatedTime":"30min","url":"\/tutorials\/playbacksdk\/getstarted","abstract":[{"type":"text","text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic."}]},"PlayBackAPIError.swift":{"highlights":[],"type":"file","identifier":"PlayBackAPIError.swift","fileName":"PlayBackAPIError.swift","fileType":"swift","syntax":"swift","content":["import Foundation","","public enum PlayBackAPIError: Error {",""," case invalidResponsePlaybackData",""," case invalidPlaybackDataURL",""," case invalidPlayerInformationURL",""," case initializationError",""," case loadHLSStreamError",""," case networkError(Error)",""," case apiError(statusCode: Int, message: String)","}"]},"doc://PlaybackSDK/tutorials/Table-Of-Contents":{"role":"overview","identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","title":"Introduction to PlaybackSDK","type":"topic","kind":"overview","url":"\/tutorials\/table-of-contents","abstract":[{"type":"text","text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications."}]},"doc://PlaybackSDK/tutorials/Table-Of-Contents/Getting-Started":{"kind":"article","identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/Getting-Started","abstract":[],"title":"Getting Started","type":"topic","role":"article","url":"\/tutorials\/table-of-contents\/getting-started"},"PlayBackDemoApp.swift":{"fileName":"PlayBackDemoApp.swift","highlights":[],"type":"file","fileType":"swift","syntax":"swift","identifier":"PlayBackDemoApp.swift","content":["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)\")"," "," }"," }"," }","}"]},"PlayerTestView.swift":{"fileType":"swift","syntax":"swift","fileName":"PlayerTestView.swift","identifier":"PlayerTestView.swift","type":"file","highlights":[],"content":["import SwiftUI","import PlaybackSDK","","struct PlayerTestView: View {"," "," private let entryID = \"ENTRY_ID\""," private let authorizationToken = \"JWT_TOKEN\""," "," var body: some View {"," VStack {"," \/\/ Load player with the playback SDK"," PlayBackSDKManager.shared.loadPlayer(entryID: entryID, authorizationToken: authorizationToken) { error in"," handlePlaybackError(error)"," }"," .onDisappear {"," \/\/ Remove the player here"," }"," Spacer()"," }"," .padding()"," }"," "," private func handlePlaybackError(_ error: PlaybackError) {"," switch error {"," case .apiError(let statusCode, let errorMessage, let reason):"," print(\"\\(errorMessage) Status Code \\(statusCode)\")"," errorMessage = \"\\(errorMessage) Status Code \\(statusCode) Reason \\(reason)\""," default:"," print(\"Error loading HLS stream in PlaybackUIView: \\(error.localizedDescription)\")"," errorMessage = \"Error code and errorrMessage not found: \\(error.localizedDescription)\""," }"," }"," ","}"]},"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted#Playback-SDK":{"role":"pseudoSymbol","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted#Playback-SDK","type":"section","title":"Playback SDK","kind":"section","abstract":[{"text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic.","type":"text"}],"url":"\/tutorials\/playbacksdk\/getstarted#Playback-SDK"},"https://streamamg.stoplight.io/docs/playback-documentation-portal/ec642e6dcbb13-get-video-playback-data":{"type":"link","url":"https:\/\/streamamg.stoplight.io\/docs\/playback-documentation-portal\/ec642e6dcbb13-get-video-playback-data","title":"Get Video Playback Data | Playback","titleInlineContent":[{"text":"Get Video Playback Data | Playback","type":"text"}],"identifier":"https:\/\/streamamg.stoplight.io\/docs\/playback-documentation-portal\/ec642e6dcbb13-get-video-playback-data"}}} \ No newline at end of file +{"sections":[{"kind":"hero","estimatedTimeInMinutes":30,"content":[{"type":"paragraph","inlineContent":[{"text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic.","type":"text"}]},{"inlineContent":[{"type":"strong","inlineContent":[{"text":"Key Features:","type":"text"}]}],"type":"paragraph"},{"type":"unorderedList","items":[{"content":[{"inlineContent":[{"type":"strong","inlineContent":[{"text":"Abstraction:","type":"text"}]},{"type":"text","text":" Hides the complexities of underlying video APIs, allowing you to focus on the core playback experience."}],"type":"paragraph"}]},{"content":[{"type":"paragraph","inlineContent":[{"inlineContent":[{"type":"text","text":"Flexibility:"}],"type":"strong"},{"text":" Supports different video providers and allows the creation of custom playback plugins for extended functionalities.","type":"text"}]}]},{"content":[{"inlineContent":[{"type":"strong","inlineContent":[{"type":"text","text":"Error Handling:"}]},{"text":" Provides mechanisms to handle potential issues during playback and notify your application.","type":"text"}],"type":"paragraph"}]}]}],"title":"Playback SDK Overview","chapter":"Getting Started"},{"tasks":[{"stepsSection":[{"content":[{"type":"paragraph","inlineContent":[{"inlineContent":[{"type":"text","text":"Step 1:"}],"type":"strong"},{"type":"text","text":" Initialize the Playback SDK by providing your API key and register the default player plugin."},{"type":"text","text":" "},{"type":"strong","inlineContent":[{"type":"text","text":"Make sure this step is done when the app starts."}]}]}],"code":"PlayBackDemoApp.swift","runtimePreview":null,"caption":[],"media":null,"type":"step"},{"content":[{"inlineContent":[{"type":"strong","inlineContent":[{"type":"text","text":"Step 2:"}]},{"text":"","type":"text"},{"text":" ","type":"text"},{"text":"Load the player using the Playback SDK and handle any playback errors.","type":"text"}],"type":"paragraph"}],"caption":[{"type":"paragraph","inlineContent":[{"type":"text","text":"In this step, the code utilizes the "},{"type":"strong","inlineContent":[{"text":"loadPlayer","type":"text"}]},{"type":"text","text":" function provided by the Playback SDK to initialize and load the video player. The function takes the entry ID and authorization token as parameters. Additionally, it includes a closure to handle any potential playback errors that may occur during the loading process."},{"text":" ","type":"text"},{"type":"text","text":"The "},{"type":"strong","inlineContent":[{"text":"handlePlaybackError","type":"text"}]},{"text":" function is called within the closure to handle the playback errors. It switches on the type of error received and provides appropriate error handling based on the type of error encountered.","type":"text"},{"type":"text","text":" "},{"text":"The code also includes a placeholder comment to indicate where the removal of the player could be implemented in the ","type":"text"},{"type":"strong","inlineContent":[{"text":"onDisappear","type":"text"}]},{"type":"text","text":" modifier."},{"type":"text","text":" "},{"text":"If you want to allow users to access free content or if you’re implementing a guest mode, you can pass an empty string or ","type":"text"},{"type":"strong","inlineContent":[{"type":"text","text":"nil"}]},{"type":"text","text":" value as the "},{"inlineContent":[{"text":"authorizationToken","type":"text"}],"type":"strong"},{"type":"text","text":" when calling the "},{"inlineContent":[{"type":"text","text":"loadPlayer"}],"type":"strong"},{"type":"text","text":" function. This will bypass the need for authentication, enabling unrestricted access to the specified content."}]}],"media":null,"code":"PlayerTestView.swift","runtimePreview":null,"type":"step"},{"type":"step","code":"PlayBackAPIError.swift","runtimePreview":null,"caption":[{"type":"paragraph","inlineContent":[{"text":"This step describes enum for error handling. Above is the error enum returned by the SDK, where the apiError also has the reason code and message for the API error. The playback API is returning the reason code in the response. For the list of the error codes and reasons, please refer to ","type":"text"},{"type":"reference","identifier":"https:\/\/streamamg.stoplight.io\/docs\/playback-documentation-portal\/ec642e6dcbb13-get-video-playback-data","isActive":true}]}],"content":[{"type":"paragraph","inlineContent":[{"type":"strong","inlineContent":[{"type":"text","text":"Step 3:"}]},{"type":"text","text":" "},{"text":"Handle the playback errors from Playback SDK.","type":"text"}]}],"media":null}],"anchor":"Playback-SDK","contentSection":[{"content":[{"type":"paragraph","inlineContent":[{"inlineContent":[{"type":"text","text":"Explore how to use StreamAMG Playback SDK."}],"type":"strong"}]}],"kind":"fullWidth"}],"title":"Playback SDK"}],"kind":"tasks"}],"metadata":{"category":"PlaybackSDK Tutorial","role":"project","categoryPathComponent":"Table-Of-Contents","title":"Playback SDK Overview"},"variants":[{"paths":["\/tutorials\/playbacksdk\/getstarted"],"traits":[{"interfaceLanguage":"swift"}]}],"hierarchy":{"paths":[["doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/$volume","doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/Getting-Started"]],"modules":[{"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/Getting-Started","projects":[{"reference":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","sections":[{"reference":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted#Playback-SDK","kind":"task"}]}]}],"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents"},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted"},"schemaVersion":{"major":0,"minor":3,"patch":0},"kind":"project","references":{"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted#Playback-SDK":{"type":"section","url":"\/tutorials\/playbacksdk\/getstarted#Playback-SDK","abstract":[{"type":"text","text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic."}],"role":"pseudoSymbol","kind":"section","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted#Playback-SDK","title":"Playback SDK"},"PlayBackDemoApp.swift":{"highlights":[],"content":["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)\")"," "," }"," }"," }","}"],"syntax":"swift","fileType":"swift","identifier":"PlayBackDemoApp.swift","type":"file","fileName":"PlayBackDemoApp.swift"},"PlayerTestView.swift":{"fileType":"swift","syntax":"swift","type":"file","highlights":[],"fileName":"PlayerTestView.swift","content":["import SwiftUI","import PlaybackSDK","","struct PlayerTestView: View {"," "," private let entryID = \"ENTRY_ID\""," private let authorizationToken = \"JWT_TOKEN\""," "," var body: some View {"," VStack {"," \/\/ Load player with the playback SDK"," PlayBackSDKManager.shared.loadPlayer(entryID: entryID, authorizationToken: authorizationToken) { error in"," handlePlaybackError(error)"," }"," .onDisappear {"," \/\/ Remove the player here"," }"," Spacer()"," }"," .padding()"," }"," "," private func handlePlaybackError(_ error: PlaybackError) {"," switch error {"," case .apiError(let statusCode, let errorMessage, let reason):"," print(\"\\(errorMessage) Status Code \\(statusCode)\")"," errorMessage = \"\\(errorMessage) Status Code \\(statusCode) Reason \\(reason)\""," default:"," print(\"Error loading HLS stream in PlaybackUIView: \\(error.localizedDescription)\")"," errorMessage = \"Error code and errorrMessage not found: \\(error.localizedDescription)\""," }"," }"," ","}"],"identifier":"PlayerTestView.swift"},"doc://PlaybackSDK/tutorials/Table-Of-Contents":{"url":"\/tutorials\/table-of-contents","title":"Introduction to PlaybackSDK","role":"overview","type":"topic","kind":"overview","identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","abstract":[{"type":"text","text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications."}]},"https://streamamg.stoplight.io/docs/playback-documentation-portal/ec642e6dcbb13-get-video-playback-data":{"identifier":"https:\/\/streamamg.stoplight.io\/docs\/playback-documentation-portal\/ec642e6dcbb13-get-video-playback-data","type":"link","title":"Get Video Playback Data | Playback","titleInlineContent":[{"type":"text","text":"Get Video Playback Data | Playback"}],"url":"https:\/\/streamamg.stoplight.io\/docs\/playback-documentation-portal\/ec642e6dcbb13-get-video-playback-data"},"PlayBackAPIError.swift":{"content":["import Foundation","","public enum PlayBackAPIError: Error {",""," case invalidResponsePlaybackData",""," case invalidPlaybackDataURL",""," case invalidPlayerInformationURL",""," case initializationError",""," case loadHLSStreamError",""," case networkError(Error)",""," case apiError(statusCode: Int, message: String)","}"],"fileType":"swift","identifier":"PlayBackAPIError.swift","syntax":"swift","highlights":[],"type":"file","fileName":"PlayBackAPIError.swift"},"doc://PlaybackSDK/tutorials/Table-Of-Contents/Getting-Started":{"type":"topic","identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/Getting-Started","kind":"article","url":"\/tutorials\/table-of-contents\/getting-started","abstract":[],"title":"Getting Started","role":"article"},"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted":{"title":"Playback SDK Overview","abstract":[{"text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic.","type":"text"}],"url":"\/tutorials\/playbacksdk\/getstarted","type":"topic","kind":"project","estimatedTime":"30min","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","role":"project"}}} \ No newline at end of file diff --git a/docs/data/tutorials/table-of-contents.json b/docs/data/tutorials/table-of-contents.json index 6f48e05..f9a35ad 100644 --- a/docs/data/tutorials/table-of-contents.json +++ b/docs/data/tutorials/table-of-contents.json @@ -1 +1 @@ -{"sections":[{"title":"Introduction to PlaybackSDK","kind":"hero","action":{"isActive":true,"overridingTitle":"Get started","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","overridingTitleInlineContent":[{"type":"text","text":"Get started"}],"type":"reference"},"content":[{"inlineContent":[{"text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications.","type":"text"}],"type":"paragraph"}]},{"name":null,"kind":"volume","chapters":[{"name":"Getting Started","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"In this chapter, we’ll start by setting up the PlaybackSDK from the initialisation to load the PlayBack Player Plugin."}]}],"tutorials":["doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted"],"image":"ios-marketing.png"}],"image":null,"content":[]},{"tiles":[{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Browse and search the PlaybackSDK documentation."}]},{"items":[{"content":[{"inlineContent":[{"isActive":true,"identifier":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","type":"reference"}],"type":"paragraph"}]},{"content":[{"type":"paragraph","inlineContent":[{"isActive":true,"identifier":"https:\/\/streamamg.stoplight.io","type":"reference"}]}]}],"type":"unorderedList"}],"identifier":"documentation","title":"Documentation"}],"content":[{"inlineContent":[{"text":"Explore more resources for learning about PlaybackSDK.","type":"text"}],"type":"paragraph"}],"kind":"resources"}],"kind":"overview","schemaVersion":{"patch":0,"minor":3,"major":0},"metadata":{"role":"overview","category":"PlaybackSDK Tutorial","categoryPathComponent":"Table-Of-Contents","estimatedTime":"30min","title":"Introduction to PlaybackSDK"},"identifier":{"url":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","interfaceLanguage":"swift"},"hierarchy":{"paths":[],"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents"},"variants":[{"paths":["\/tutorials\/table-of-contents"],"traits":[{"interfaceLanguage":"swift"}]}],"references":{"doc://PlaybackSDK/tutorials/Table-Of-Contents":{"role":"overview","identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","title":"Introduction to PlaybackSDK","type":"topic","kind":"overview","url":"\/tutorials\/table-of-contents","abstract":[{"type":"text","text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications."}]},"ios-marketing.png":{"variants":[{"traits":["1x","light"],"url":"\/images\/ios-marketing.png"}],"alt":"Getting Started with PlaybackSDK","identifier":"ios-marketing.png","type":"image"},"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted":{"role":"project","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","title":"Playback SDK Overview","type":"topic","kind":"project","estimatedTime":"30min","url":"\/tutorials\/playbacksdk\/getstarted","abstract":[{"type":"text","text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic."}]},"https://streamamg.stoplight.io":{"titleInlineContent":[{"type":"text","text":"Stoplight PlayBack API"}],"url":"https:\/\/streamamg.stoplight.io","title":"Stoplight PlayBack API","identifier":"https:\/\/streamamg.stoplight.io","type":"link"},"https://github.com/StreamAMG/playback-sdk-ios/tree/main":{"title":"GitHub Repository","identifier":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","type":"link","titleInlineContent":[{"type":"text","text":"GitHub Repository"}],"url":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main"}}} \ No newline at end of file +{"hierarchy":{"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","paths":[]},"identifier":{"url":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","interfaceLanguage":"swift"},"metadata":{"category":"PlaybackSDK Tutorial","estimatedTime":"30min","categoryPathComponent":"Table-Of-Contents","role":"overview","title":"Introduction to PlaybackSDK"},"schemaVersion":{"major":0,"patch":0,"minor":3},"sections":[{"action":{"identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","isActive":true,"overridingTitle":"Get started","overridingTitleInlineContent":[{"type":"text","text":"Get started"}],"type":"reference"},"kind":"hero","title":"Introduction to PlaybackSDK","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications."}]}]},{"content":[],"kind":"volume","chapters":[{"name":"Getting Started","image":"ios-marketing.png","tutorials":["doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted"],"content":[{"inlineContent":[{"text":"In this chapter, we’ll start by setting up the PlaybackSDK from the initialisation to load the PlayBack Player Plugin.","type":"text"}],"type":"paragraph"}]}],"name":null,"image":null},{"kind":"resources","tiles":[{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Browse and search the PlaybackSDK documentation."}]},{"type":"unorderedList","items":[{"content":[{"inlineContent":[{"identifier":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","type":"reference","isActive":true}],"type":"paragraph"}]},{"content":[{"type":"paragraph","inlineContent":[{"identifier":"https:\/\/streamamg.stoplight.io","isActive":true,"type":"reference"}]}]}]}],"identifier":"documentation","title":"Documentation"}],"content":[{"type":"paragraph","inlineContent":[{"text":"Explore more resources for learning about PlaybackSDK.","type":"text"}]}]}],"variants":[{"paths":["\/tutorials\/table-of-contents"],"traits":[{"interfaceLanguage":"swift"}]}],"kind":"overview","references":{"https://github.com/StreamAMG/playback-sdk-ios/tree/main":{"identifier":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","title":"GitHub Repository","url":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","type":"link","titleInlineContent":[{"text":"GitHub Repository","type":"text"}]},"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted":{"title":"Playback SDK Overview","abstract":[{"text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic.","type":"text"}],"url":"\/tutorials\/playbacksdk\/getstarted","type":"topic","kind":"project","estimatedTime":"30min","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","role":"project"},"ios-marketing.png":{"variants":[{"traits":["1x","light"],"url":"\/images\/ios-marketing.png"}],"alt":"Getting Started with PlaybackSDK","identifier":"ios-marketing.png","type":"image"},"doc://PlaybackSDK/tutorials/Table-Of-Contents":{"url":"\/tutorials\/table-of-contents","title":"Introduction to PlaybackSDK","role":"overview","type":"topic","kind":"overview","identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","abstract":[{"type":"text","text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications."}]},"https://streamamg.stoplight.io":{"title":"Stoplight PlayBack API","url":"https:\/\/streamamg.stoplight.io","titleInlineContent":[{"text":"Stoplight PlayBack API","type":"text"}],"identifier":"https:\/\/streamamg.stoplight.io","type":"link"}}} \ No newline at end of file diff --git a/docs/documentation/playbacksdk/index.html b/docs/documentation/playbacksdk/index.html index d5df4d7..c25d820 100644 --- a/docs/documentation/playbacksdk/index.html +++ b/docs/documentation/playbacksdk/index.html @@ -1 +1 @@ -Documentation
\ No newline at end of file +Documentation
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index d5df4d7..c25d820 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -Documentation
\ No newline at end of file +Documentation
\ No newline at end of file diff --git a/docs/metadata.json b/docs/metadata.json index 3988104..2820538 100644 --- a/docs/metadata.json +++ b/docs/metadata.json @@ -1 +1 @@ -{"bundleIdentifier":"PlaybackSDK","bundleDisplayName":"PlaybackSDK","schemaVersion":{"major":0,"minor":1,"patch":0}} \ No newline at end of file +{"bundleIdentifier":"PlaybackSDK","bundleDisplayName":"PlaybackSDK","schemaVersion":{"major":0,"patch":0,"minor":1}} \ No newline at end of file diff --git a/docs/tutorials/playbacksdk/getstarted/index.html b/docs/tutorials/playbacksdk/getstarted/index.html index d5df4d7..c25d820 100644 --- a/docs/tutorials/playbacksdk/getstarted/index.html +++ b/docs/tutorials/playbacksdk/getstarted/index.html @@ -1 +1 @@ -Documentation
\ No newline at end of file +Documentation
\ No newline at end of file diff --git a/docs/tutorials/table-of-contents/index.html b/docs/tutorials/table-of-contents/index.html index d5df4d7..c25d820 100644 --- a/docs/tutorials/table-of-contents/index.html +++ b/docs/tutorials/table-of-contents/index.html @@ -1 +1 @@ -Documentation
\ No newline at end of file +Documentation
\ No newline at end of file From d637e14f5e7047fd1fbcd5b36991d6117b6425a3 Mon Sep 17 00:00:00 2001 From: Artem Yelizarov Date: Tue, 11 Jun 2024 15:53:35 +0300 Subject: [PATCH 6/7] Describe user-agent header configuration --- .../Resources/PlayBackDemoApp.swift | 11 +++--- .../PlayBackDemoAppWithUserAgent.swift | 38 +++++++++++++++++++ .../Tutorial/GetStarted.tutorial | 11 ++++-- 3 files changed, 52 insertions(+), 8 deletions(-) create mode 100644 Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackDemoAppWithUserAgent.swift diff --git a/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackDemoApp.swift b/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackDemoApp.swift index a1bec0f..dc1847a 100644 --- a/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackDemoApp.swift +++ b/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackDemoApp.swift @@ -3,7 +3,7 @@ import PlaybackSDK @main struct PlayBackDemoApp: App { - + let sdkManager = PlayBackSDKManager() let apiKey = "API_KEY" var body: some Scene { @@ -11,7 +11,7 @@ struct PlayBackDemoApp: App { HomeView() } } - + init() { // Initialize the Playback SDK with the provided API key and base URL PlayBackSDKManager.shared.initialize(apiKey: apiKey) { result in @@ -19,16 +19,17 @@ struct PlayBackDemoApp: App { 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)") - + } } } } + diff --git a/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackDemoAppWithUserAgent.swift b/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackDemoAppWithUserAgent.swift new file mode 100644 index 0000000..8a04146 --- /dev/null +++ b/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackDemoAppWithUserAgent.swift @@ -0,0 +1,38 @@ +import SwiftUI +import PlaybackSDK +import Alamofire + +@main +struct PlayBackDemoApp: App { + + let sdkManager = PlayBackSDKManager() + let apiKey = "API_KEY" + var body: some Scene { + WindowGroup { + HomeView() + } + } + + init() { + // Get the user-agent set by Alamofire + let userAgent = AF.session.configuration.httpAdditionalHeaders?["User-Agent"] + + // Initialize the Playback SDK with the provided API key and custom user-agent + PlayBackSDKManager.shared.initialize(apiKey: apiKey, userAgent: userAgent) { 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)") + + } + } + } +} diff --git a/Sources/PlaybackSDK/Documentation.docc/Tutorial/GetStarted.tutorial b/Sources/PlaybackSDK/Documentation.docc/Tutorial/GetStarted.tutorial index 8ce0857..75f5176 100644 --- a/Sources/PlaybackSDK/Documentation.docc/Tutorial/GetStarted.tutorial +++ b/Sources/PlaybackSDK/Documentation.docc/Tutorial/GetStarted.tutorial @@ -16,14 +16,20 @@ @Steps { @Step { - **Step 1:** Initialize the Playback SDK by providing your API key and register the default player plugin. + Initialize the Playback SDK by providing your API key and register the default player plugin. **Make sure this step is done when the app starts.** @Code(name: "PlayBackDemoApp.swift", file: PlayBackDemoApp.swift) } @Step { - **Step 2:** + Add custom `user-agent` header. + + This step is only required for content that needs a token, when using Alamofire or other 3rd party frameworks that overwrite the standard `user-agent` header with their own. + If the content requires starting a CloudPay session, it's important that the request to start the session has the same `user-agent` header as the video loading requests from the player. This can be achieved either by disabling the overwriting behaviour in the 3rd party networking framework you're using, or by passing a `userAgent` parameter to the `initialize` method, like in this example with Alamofire. + @Code(name: "PlayBackDemoAppWithUserAgent.swift", file: PlayBackDemoAppWithUserAgent.swift, previousFile: PlayBackDemoApp.swift) + } + @Step { Load the player using the Playback SDK and handle any playback errors. In this step, the code utilizes the **loadPlayer** function provided by the Playback SDK to initialize and load the video player. The function takes the entry ID and authorization token as parameters. Additionally, it includes a closure to handle any potential playback errors that may occur during the loading process. @@ -35,7 +41,6 @@ @Code(name: "PlayerTestView.swift", file: PlayerTestView.swift) } @Step { - **Step 3:** Handle the playback errors from Playback SDK. This step describes enum for error handling. Above is the error enum returned by the SDK, where the apiError also has the reason code and message for the API error. The playback API is returning the reason code in the response. For the list of the error codes and reasons, please refer to [Get Video Playback Data | Playback](https://streamamg.stoplight.io/docs/playback-documentation-portal/ec642e6dcbb13-get-video-playback-data) From 89ac23e5a2259b3a2cb7faa795f76c0c77917952 Mon Sep 17 00:00:00 2001 From: Artem Yelizarov Date: Tue, 11 Jun 2024 15:54:34 +0300 Subject: [PATCH 7/7] Generate github pages after adding user-agent step --- docs/data/documentation/playbacksdk.json | 2 +- docs/data/tutorials/playbacksdk/getstarted.json | 2 +- docs/data/tutorials/table-of-contents.json | 2 +- docs/metadata.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/data/documentation/playbacksdk.json b/docs/data/documentation/playbacksdk.json index adba963..8f340b2 100644 --- a/docs/data/documentation/playbacksdk.json +++ b/docs/data/documentation/playbacksdk.json @@ -1 +1 @@ -{"kind":"symbol","schemaVersion":{"major":0,"patch":0,"minor":3},"hierarchy":{"paths":[[]]},"identifier":{"url":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","interfaceLanguage":"swift"},"metadata":{"title":"PlaybackSDK","modules":[{"name":"PlaybackSDK"}],"role":"collection","symbolKind":"module","externalID":"PlaybackSDK","roleHeading":"Framework"},"sections":[],"variants":[{"paths":["\/documentation\/playbacksdk"],"traits":[{"interfaceLanguage":"swift"}]}],"references":{"doc://PlaybackSDK/documentation/PlaybackSDK":{"identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","url":"\/documentation\/playbacksdk","kind":"symbol","title":"PlaybackSDK","type":"topic","role":"collection","abstract":[]}}} \ No newline at end of file +{"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK"},"sections":[],"metadata":{"role":"collection","modules":[{"name":"PlaybackSDK"}],"roleHeading":"Framework","externalID":"PlaybackSDK","symbolKind":"module","title":"PlaybackSDK"},"schemaVersion":{"patch":0,"major":0,"minor":3},"hierarchy":{"paths":[[]]},"kind":"symbol","variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/playbacksdk"]}],"references":{"doc://PlaybackSDK/documentation/PlaybackSDK":{"title":"PlaybackSDK","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","kind":"symbol","url":"\/documentation\/playbacksdk","abstract":[],"role":"collection","type":"topic"}}} \ No newline at end of file diff --git a/docs/data/tutorials/playbacksdk/getstarted.json b/docs/data/tutorials/playbacksdk/getstarted.json index 19bd758..608854a 100644 --- a/docs/data/tutorials/playbacksdk/getstarted.json +++ b/docs/data/tutorials/playbacksdk/getstarted.json @@ -1 +1 @@ -{"sections":[{"kind":"hero","estimatedTimeInMinutes":30,"content":[{"type":"paragraph","inlineContent":[{"text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic.","type":"text"}]},{"inlineContent":[{"type":"strong","inlineContent":[{"text":"Key Features:","type":"text"}]}],"type":"paragraph"},{"type":"unorderedList","items":[{"content":[{"inlineContent":[{"type":"strong","inlineContent":[{"text":"Abstraction:","type":"text"}]},{"type":"text","text":" Hides the complexities of underlying video APIs, allowing you to focus on the core playback experience."}],"type":"paragraph"}]},{"content":[{"type":"paragraph","inlineContent":[{"inlineContent":[{"type":"text","text":"Flexibility:"}],"type":"strong"},{"text":" Supports different video providers and allows the creation of custom playback plugins for extended functionalities.","type":"text"}]}]},{"content":[{"inlineContent":[{"type":"strong","inlineContent":[{"type":"text","text":"Error Handling:"}]},{"text":" Provides mechanisms to handle potential issues during playback and notify your application.","type":"text"}],"type":"paragraph"}]}]}],"title":"Playback SDK Overview","chapter":"Getting Started"},{"tasks":[{"stepsSection":[{"content":[{"type":"paragraph","inlineContent":[{"inlineContent":[{"type":"text","text":"Step 1:"}],"type":"strong"},{"type":"text","text":" Initialize the Playback SDK by providing your API key and register the default player plugin."},{"type":"text","text":" "},{"type":"strong","inlineContent":[{"type":"text","text":"Make sure this step is done when the app starts."}]}]}],"code":"PlayBackDemoApp.swift","runtimePreview":null,"caption":[],"media":null,"type":"step"},{"content":[{"inlineContent":[{"type":"strong","inlineContent":[{"type":"text","text":"Step 2:"}]},{"text":"","type":"text"},{"text":" ","type":"text"},{"text":"Load the player using the Playback SDK and handle any playback errors.","type":"text"}],"type":"paragraph"}],"caption":[{"type":"paragraph","inlineContent":[{"type":"text","text":"In this step, the code utilizes the "},{"type":"strong","inlineContent":[{"text":"loadPlayer","type":"text"}]},{"type":"text","text":" function provided by the Playback SDK to initialize and load the video player. The function takes the entry ID and authorization token as parameters. Additionally, it includes a closure to handle any potential playback errors that may occur during the loading process."},{"text":" ","type":"text"},{"type":"text","text":"The "},{"type":"strong","inlineContent":[{"text":"handlePlaybackError","type":"text"}]},{"text":" function is called within the closure to handle the playback errors. It switches on the type of error received and provides appropriate error handling based on the type of error encountered.","type":"text"},{"type":"text","text":" "},{"text":"The code also includes a placeholder comment to indicate where the removal of the player could be implemented in the ","type":"text"},{"type":"strong","inlineContent":[{"text":"onDisappear","type":"text"}]},{"type":"text","text":" modifier."},{"type":"text","text":" "},{"text":"If you want to allow users to access free content or if you’re implementing a guest mode, you can pass an empty string or ","type":"text"},{"type":"strong","inlineContent":[{"type":"text","text":"nil"}]},{"type":"text","text":" value as the "},{"inlineContent":[{"text":"authorizationToken","type":"text"}],"type":"strong"},{"type":"text","text":" when calling the "},{"inlineContent":[{"type":"text","text":"loadPlayer"}],"type":"strong"},{"type":"text","text":" function. This will bypass the need for authentication, enabling unrestricted access to the specified content."}]}],"media":null,"code":"PlayerTestView.swift","runtimePreview":null,"type":"step"},{"type":"step","code":"PlayBackAPIError.swift","runtimePreview":null,"caption":[{"type":"paragraph","inlineContent":[{"text":"This step describes enum for error handling. Above is the error enum returned by the SDK, where the apiError also has the reason code and message for the API error. The playback API is returning the reason code in the response. For the list of the error codes and reasons, please refer to ","type":"text"},{"type":"reference","identifier":"https:\/\/streamamg.stoplight.io\/docs\/playback-documentation-portal\/ec642e6dcbb13-get-video-playback-data","isActive":true}]}],"content":[{"type":"paragraph","inlineContent":[{"type":"strong","inlineContent":[{"type":"text","text":"Step 3:"}]},{"type":"text","text":" "},{"text":"Handle the playback errors from Playback SDK.","type":"text"}]}],"media":null}],"anchor":"Playback-SDK","contentSection":[{"content":[{"type":"paragraph","inlineContent":[{"inlineContent":[{"type":"text","text":"Explore how to use StreamAMG Playback SDK."}],"type":"strong"}]}],"kind":"fullWidth"}],"title":"Playback SDK"}],"kind":"tasks"}],"metadata":{"category":"PlaybackSDK Tutorial","role":"project","categoryPathComponent":"Table-Of-Contents","title":"Playback SDK Overview"},"variants":[{"paths":["\/tutorials\/playbacksdk\/getstarted"],"traits":[{"interfaceLanguage":"swift"}]}],"hierarchy":{"paths":[["doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/$volume","doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/Getting-Started"]],"modules":[{"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/Getting-Started","projects":[{"reference":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","sections":[{"reference":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted#Playback-SDK","kind":"task"}]}]}],"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents"},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted"},"schemaVersion":{"major":0,"minor":3,"patch":0},"kind":"project","references":{"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted#Playback-SDK":{"type":"section","url":"\/tutorials\/playbacksdk\/getstarted#Playback-SDK","abstract":[{"type":"text","text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic."}],"role":"pseudoSymbol","kind":"section","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted#Playback-SDK","title":"Playback SDK"},"PlayBackDemoApp.swift":{"highlights":[],"content":["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)\")"," "," }"," }"," }","}"],"syntax":"swift","fileType":"swift","identifier":"PlayBackDemoApp.swift","type":"file","fileName":"PlayBackDemoApp.swift"},"PlayerTestView.swift":{"fileType":"swift","syntax":"swift","type":"file","highlights":[],"fileName":"PlayerTestView.swift","content":["import SwiftUI","import PlaybackSDK","","struct PlayerTestView: View {"," "," private let entryID = \"ENTRY_ID\""," private let authorizationToken = \"JWT_TOKEN\""," "," var body: some View {"," VStack {"," \/\/ Load player with the playback SDK"," PlayBackSDKManager.shared.loadPlayer(entryID: entryID, authorizationToken: authorizationToken) { error in"," handlePlaybackError(error)"," }"," .onDisappear {"," \/\/ Remove the player here"," }"," Spacer()"," }"," .padding()"," }"," "," private func handlePlaybackError(_ error: PlaybackError) {"," switch error {"," case .apiError(let statusCode, let errorMessage, let reason):"," print(\"\\(errorMessage) Status Code \\(statusCode)\")"," errorMessage = \"\\(errorMessage) Status Code \\(statusCode) Reason \\(reason)\""," default:"," print(\"Error loading HLS stream in PlaybackUIView: \\(error.localizedDescription)\")"," errorMessage = \"Error code and errorrMessage not found: \\(error.localizedDescription)\""," }"," }"," ","}"],"identifier":"PlayerTestView.swift"},"doc://PlaybackSDK/tutorials/Table-Of-Contents":{"url":"\/tutorials\/table-of-contents","title":"Introduction to PlaybackSDK","role":"overview","type":"topic","kind":"overview","identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","abstract":[{"type":"text","text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications."}]},"https://streamamg.stoplight.io/docs/playback-documentation-portal/ec642e6dcbb13-get-video-playback-data":{"identifier":"https:\/\/streamamg.stoplight.io\/docs\/playback-documentation-portal\/ec642e6dcbb13-get-video-playback-data","type":"link","title":"Get Video Playback Data | Playback","titleInlineContent":[{"type":"text","text":"Get Video Playback Data | Playback"}],"url":"https:\/\/streamamg.stoplight.io\/docs\/playback-documentation-portal\/ec642e6dcbb13-get-video-playback-data"},"PlayBackAPIError.swift":{"content":["import Foundation","","public enum PlayBackAPIError: Error {",""," case invalidResponsePlaybackData",""," case invalidPlaybackDataURL",""," case invalidPlayerInformationURL",""," case initializationError",""," case loadHLSStreamError",""," case networkError(Error)",""," case apiError(statusCode: Int, message: String)","}"],"fileType":"swift","identifier":"PlayBackAPIError.swift","syntax":"swift","highlights":[],"type":"file","fileName":"PlayBackAPIError.swift"},"doc://PlaybackSDK/tutorials/Table-Of-Contents/Getting-Started":{"type":"topic","identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/Getting-Started","kind":"article","url":"\/tutorials\/table-of-contents\/getting-started","abstract":[],"title":"Getting Started","role":"article"},"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted":{"title":"Playback SDK Overview","abstract":[{"text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic.","type":"text"}],"url":"\/tutorials\/playbacksdk\/getstarted","type":"topic","kind":"project","estimatedTime":"30min","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","role":"project"}}} \ No newline at end of file +{"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted"},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/tutorials\/playbacksdk\/getstarted"]}],"metadata":{"categoryPathComponent":"Table-Of-Contents","role":"project","title":"Playback SDK Overview","category":"PlaybackSDK Tutorial"},"schemaVersion":{"minor":3,"major":0,"patch":0},"kind":"project","sections":[{"kind":"hero","chapter":"Getting Started","estimatedTimeInMinutes":30,"title":"Playback SDK Overview","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic."}]},{"type":"paragraph","inlineContent":[{"type":"strong","inlineContent":[{"type":"text","text":"Key Features:"}]}]},{"type":"unorderedList","items":[{"content":[{"type":"paragraph","inlineContent":[{"inlineContent":[{"type":"text","text":"Abstraction:"}],"type":"strong"},{"type":"text","text":" Hides the complexities of underlying video APIs, allowing you to focus on the core playback experience."}]}]},{"content":[{"inlineContent":[{"type":"strong","inlineContent":[{"text":"Flexibility:","type":"text"}]},{"text":" Supports different video providers and allows the creation of custom playback plugins for extended functionalities.","type":"text"}],"type":"paragraph"}]},{"content":[{"inlineContent":[{"type":"strong","inlineContent":[{"type":"text","text":"Error Handling:"}]},{"type":"text","text":" Provides mechanisms to handle potential issues during playback and notify your application."}],"type":"paragraph"}]}]}]},{"tasks":[{"title":"Playback SDK","contentSection":[{"kind":"fullWidth","content":[{"type":"paragraph","inlineContent":[{"inlineContent":[{"text":"Explore how to use StreamAMG Playback SDK.","type":"text"}],"type":"strong"}]}]}],"anchor":"Playback-SDK","stepsSection":[{"code":"PlayBackDemoApp.swift","caption":[],"type":"step","runtimePreview":null,"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Initialize the Playback SDK by providing your API key and register the default player plugin."},{"text":" ","type":"text"},{"inlineContent":[{"type":"text","text":"Make sure this step is done when the app starts."}],"type":"strong"}]}],"media":null},{"caption":[{"inlineContent":[{"type":"text","text":"This step is only required for content that needs a token, when using Alamofire or other 3rd party frameworks that overwrite the standard "},{"type":"codeVoice","code":"user-agent"},{"text":" header with their own.","type":"text"},{"type":"text","text":"\n"},{"text":"If the content requires starting a CloudPay session, it’s important that the request to start the session has the same ","type":"text"},{"type":"codeVoice","code":"user-agent"},{"text":" header as the video loading requests from the player. This can be achieved either by disabling the overwriting behaviour in the 3rd party networking framework you’re using, or by passing a ","type":"text"},{"code":"userAgent","type":"codeVoice"},{"type":"text","text":" parameter to the "},{"type":"codeVoice","code":"initialize"},{"type":"text","text":" method, like in this example with Alamofire."}],"type":"paragraph"}],"media":null,"code":"PlayBackDemoAppWithUserAgent.swift","type":"step","runtimePreview":null,"content":[{"type":"paragraph","inlineContent":[{"text":"Add custom ","type":"text"},{"type":"codeVoice","code":"user-agent"},{"type":"text","text":" header."}]}]},{"media":null,"caption":[{"inlineContent":[{"type":"text","text":"In this step, the code utilizes the "},{"inlineContent":[{"text":"loadPlayer","type":"text"}],"type":"strong"},{"type":"text","text":" function provided by the Playback SDK to initialize and load the video player. The function takes the entry ID and authorization token as parameters. Additionally, it includes a closure to handle any potential playback errors that may occur during the loading process."},{"type":"text","text":" "},{"type":"text","text":"The "},{"inlineContent":[{"text":"handlePlaybackError","type":"text"}],"type":"strong"},{"text":" function is called within the closure to handle the playback errors. It switches on the type of error received and provides appropriate error handling based on the type of error encountered.","type":"text"},{"type":"text","text":" "},{"type":"text","text":"The code also includes a placeholder comment to indicate where the removal of the player could be implemented in the "},{"inlineContent":[{"type":"text","text":"onDisappear"}],"type":"strong"},{"type":"text","text":" modifier."},{"type":"text","text":" "},{"text":"If you want to allow users to access free content or if you’re implementing a guest mode, you can pass an empty string or ","type":"text"},{"inlineContent":[{"text":"nil","type":"text"}],"type":"strong"},{"text":" value as the ","type":"text"},{"type":"strong","inlineContent":[{"text":"authorizationToken","type":"text"}]},{"type":"text","text":" when calling the "},{"inlineContent":[{"text":"loadPlayer","type":"text"}],"type":"strong"},{"type":"text","text":" function. This will bypass the need for authentication, enabling unrestricted access to the specified content."}],"type":"paragraph"}],"runtimePreview":null,"type":"step","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Load the player using the Playback SDK and handle any playback errors."}]}],"code":"PlayerTestView.swift"},{"caption":[{"inlineContent":[{"text":"This step describes enum for error handling. Above is the error enum returned by the SDK, where the apiError also has the reason code and message for the API error. The playback API is returning the reason code in the response. For the list of the error codes and reasons, please refer to ","type":"text"},{"isActive":true,"identifier":"https:\/\/streamamg.stoplight.io\/docs\/playback-documentation-portal\/ec642e6dcbb13-get-video-playback-data","type":"reference"}],"type":"paragraph"}],"code":"PlayBackAPIError.swift","media":null,"runtimePreview":null,"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Handle the playback errors from Playback SDK."}]}],"type":"step"}]}],"kind":"tasks"}],"hierarchy":{"paths":[["doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/$volume","doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/Getting-Started"]],"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","modules":[{"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/Getting-Started","projects":[{"reference":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","sections":[{"kind":"task","reference":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted#Playback-SDK"}]}]}]},"references":{"https://streamamg.stoplight.io/docs/playback-documentation-portal/ec642e6dcbb13-get-video-playback-data":{"url":"https:\/\/streamamg.stoplight.io\/docs\/playback-documentation-portal\/ec642e6dcbb13-get-video-playback-data","type":"link","title":"Get Video Playback Data | Playback","titleInlineContent":[{"text":"Get Video Playback Data | Playback","type":"text"}],"identifier":"https:\/\/streamamg.stoplight.io\/docs\/playback-documentation-portal\/ec642e6dcbb13-get-video-playback-data"},"doc://PlaybackSDK/tutorials/Table-Of-Contents/Getting-Started":{"abstract":[],"title":"Getting Started","identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/Getting-Started","type":"topic","kind":"article","role":"article","url":"\/tutorials\/table-of-contents\/getting-started"},"doc://PlaybackSDK/tutorials/Table-Of-Contents":{"identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","kind":"overview","role":"overview","type":"topic","url":"\/tutorials\/table-of-contents","abstract":[{"type":"text","text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications."}],"title":"Introduction to PlaybackSDK"},"PlayBackAPIError.swift":{"highlights":[],"content":["import Foundation","","public enum PlayBackAPIError: Error {",""," case invalidResponsePlaybackData",""," case invalidPlaybackDataURL",""," case invalidPlayerInformationURL",""," case initializationError",""," case loadHLSStreamError",""," case networkError(Error)",""," case apiError(statusCode: Int, message: String)","}"],"fileName":"PlayBackAPIError.swift","type":"file","fileType":"swift","syntax":"swift","identifier":"PlayBackAPIError.swift"},"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted":{"estimatedTime":"30min","abstract":[{"type":"text","text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic."}],"url":"\/tutorials\/playbacksdk\/getstarted","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","kind":"project","type":"topic","title":"Playback SDK Overview","role":"project"},"PlayerTestView.swift":{"syntax":"swift","fileName":"PlayerTestView.swift","highlights":[],"identifier":"PlayerTestView.swift","fileType":"swift","type":"file","content":["import SwiftUI","import PlaybackSDK","","struct PlayerTestView: View {"," "," private let entryID = \"ENTRY_ID\""," private let authorizationToken = \"JWT_TOKEN\""," "," var body: some View {"," VStack {"," \/\/ Load player with the playback SDK"," PlayBackSDKManager.shared.loadPlayer(entryID: entryID, authorizationToken: authorizationToken) { error in"," handlePlaybackError(error)"," }"," .onDisappear {"," \/\/ Remove the player here"," }"," Spacer()"," }"," .padding()"," }"," "," private func handlePlaybackError(_ error: PlaybackError) {"," switch error {"," case .apiError(let statusCode, let errorMessage, let reason):"," print(\"\\(errorMessage) Status Code \\(statusCode)\")"," errorMessage = \"\\(errorMessage) Status Code \\(statusCode) Reason \\(reason)\""," default:"," print(\"Error loading HLS stream in PlaybackUIView: \\(error.localizedDescription)\")"," errorMessage = \"Error code and errorrMessage not found: \\(error.localizedDescription)\""," }"," }"," ","}"]},"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted#Playback-SDK":{"url":"\/tutorials\/playbacksdk\/getstarted#Playback-SDK","abstract":[{"text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic.","type":"text"}],"identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted#Playback-SDK","kind":"section","type":"section","title":"Playback SDK","role":"pseudoSymbol"},"PlayBackDemoApp.swift":{"syntax":"swift","fileName":"PlayBackDemoApp.swift","highlights":[],"identifier":"PlayBackDemoApp.swift","fileType":"swift","type":"file","content":["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)\")",""," }"," }"," }","}",""]},"PlayBackDemoAppWithUserAgent.swift":{"syntax":"swift","fileName":"PlayBackDemoAppWithUserAgent.swift","highlights":[{"line":3},{"line":17},{"line":18},{"line":19},{"line":20},{"line":21}],"identifier":"PlayBackDemoAppWithUserAgent.swift","fileType":"swift","type":"file","content":["import SwiftUI","import PlaybackSDK","import Alamofire","","@main","struct PlayBackDemoApp: App {",""," let sdkManager = PlayBackSDKManager()"," let apiKey = \"API_KEY\""," var body: some Scene {"," WindowGroup {"," HomeView()"," }"," }",""," init() {"," \/\/ Get the user-agent set by Alamofire"," let userAgent = AF.session.configuration.httpAdditionalHeaders?[\"User-Agent\"]",""," \/\/ Initialize the Playback SDK with the provided API key and custom user-agent"," PlayBackSDKManager.shared.initialize(apiKey: apiKey, userAgent: userAgent) { 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)\")",""," }"," }"," }","}"]}}} \ No newline at end of file diff --git a/docs/data/tutorials/table-of-contents.json b/docs/data/tutorials/table-of-contents.json index f9a35ad..2785770 100644 --- a/docs/data/tutorials/table-of-contents.json +++ b/docs/data/tutorials/table-of-contents.json @@ -1 +1 @@ -{"hierarchy":{"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","paths":[]},"identifier":{"url":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","interfaceLanguage":"swift"},"metadata":{"category":"PlaybackSDK Tutorial","estimatedTime":"30min","categoryPathComponent":"Table-Of-Contents","role":"overview","title":"Introduction to PlaybackSDK"},"schemaVersion":{"major":0,"patch":0,"minor":3},"sections":[{"action":{"identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","isActive":true,"overridingTitle":"Get started","overridingTitleInlineContent":[{"type":"text","text":"Get started"}],"type":"reference"},"kind":"hero","title":"Introduction to PlaybackSDK","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications."}]}]},{"content":[],"kind":"volume","chapters":[{"name":"Getting Started","image":"ios-marketing.png","tutorials":["doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted"],"content":[{"inlineContent":[{"text":"In this chapter, we’ll start by setting up the PlaybackSDK from the initialisation to load the PlayBack Player Plugin.","type":"text"}],"type":"paragraph"}]}],"name":null,"image":null},{"kind":"resources","tiles":[{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Browse and search the PlaybackSDK documentation."}]},{"type":"unorderedList","items":[{"content":[{"inlineContent":[{"identifier":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","type":"reference","isActive":true}],"type":"paragraph"}]},{"content":[{"type":"paragraph","inlineContent":[{"identifier":"https:\/\/streamamg.stoplight.io","isActive":true,"type":"reference"}]}]}]}],"identifier":"documentation","title":"Documentation"}],"content":[{"type":"paragraph","inlineContent":[{"text":"Explore more resources for learning about PlaybackSDK.","type":"text"}]}]}],"variants":[{"paths":["\/tutorials\/table-of-contents"],"traits":[{"interfaceLanguage":"swift"}]}],"kind":"overview","references":{"https://github.com/StreamAMG/playback-sdk-ios/tree/main":{"identifier":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","title":"GitHub Repository","url":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","type":"link","titleInlineContent":[{"text":"GitHub Repository","type":"text"}]},"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted":{"title":"Playback SDK Overview","abstract":[{"text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic.","type":"text"}],"url":"\/tutorials\/playbacksdk\/getstarted","type":"topic","kind":"project","estimatedTime":"30min","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","role":"project"},"ios-marketing.png":{"variants":[{"traits":["1x","light"],"url":"\/images\/ios-marketing.png"}],"alt":"Getting Started with PlaybackSDK","identifier":"ios-marketing.png","type":"image"},"doc://PlaybackSDK/tutorials/Table-Of-Contents":{"url":"\/tutorials\/table-of-contents","title":"Introduction to PlaybackSDK","role":"overview","type":"topic","kind":"overview","identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","abstract":[{"type":"text","text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications."}]},"https://streamamg.stoplight.io":{"title":"Stoplight PlayBack API","url":"https:\/\/streamamg.stoplight.io","titleInlineContent":[{"text":"Stoplight PlayBack API","type":"text"}],"identifier":"https:\/\/streamamg.stoplight.io","type":"link"}}} \ No newline at end of file +{"identifier":{"url":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","interfaceLanguage":"swift"},"schemaVersion":{"major":0,"minor":3,"patch":0},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/tutorials\/table-of-contents"]}],"sections":[{"kind":"hero","content":[{"inlineContent":[{"text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications.","type":"text"}],"type":"paragraph"}],"title":"Introduction to PlaybackSDK","action":{"overridingTitle":"Get started","overridingTitleInlineContent":[{"type":"text","text":"Get started"}],"identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","isActive":true,"type":"reference"}},{"name":null,"kind":"volume","content":[],"chapters":[{"content":[{"inlineContent":[{"type":"text","text":"In this chapter, we’ll start by setting up the PlaybackSDK from the initialisation to load the PlayBack Player Plugin."}],"type":"paragraph"}],"tutorials":["doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted"],"name":"Getting Started","image":"ios-marketing.png"}],"image":null},{"kind":"resources","content":[{"inlineContent":[{"text":"Explore more resources for learning about PlaybackSDK.","type":"text"}],"type":"paragraph"}],"tiles":[{"identifier":"documentation","title":"Documentation","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Browse and search the PlaybackSDK documentation."}]},{"items":[{"content":[{"type":"paragraph","inlineContent":[{"type":"reference","identifier":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","isActive":true}]}]},{"content":[{"type":"paragraph","inlineContent":[{"isActive":true,"identifier":"https:\/\/streamamg.stoplight.io","type":"reference"}]}]}],"type":"unorderedList"}]}]}],"hierarchy":{"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","paths":[]},"metadata":{"estimatedTime":"30min","category":"PlaybackSDK Tutorial","title":"Introduction to PlaybackSDK","categoryPathComponent":"Table-Of-Contents","role":"overview"},"kind":"overview","references":{"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted":{"estimatedTime":"30min","abstract":[{"type":"text","text":"Playback SDK simplifies integrating video playback functionalities into OTT applications. It provides a unified interface for interacting with video APIs and managing playback logic."}],"url":"\/tutorials\/playbacksdk\/getstarted","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","kind":"project","type":"topic","title":"Playback SDK Overview","role":"project"},"https://streamamg.stoplight.io":{"type":"link","titleInlineContent":[{"type":"text","text":"Stoplight PlayBack API"}],"url":"https:\/\/streamamg.stoplight.io","identifier":"https:\/\/streamamg.stoplight.io","title":"Stoplight PlayBack API"},"ios-marketing.png":{"type":"image","variants":[{"traits":["1x","light"],"url":"\/images\/ios-marketing.png"}],"identifier":"ios-marketing.png","alt":"Getting Started with PlaybackSDK"},"doc://PlaybackSDK/tutorials/Table-Of-Contents":{"identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","kind":"overview","role":"overview","type":"topic","url":"\/tutorials\/table-of-contents","abstract":[{"type":"text","text":"Welcome to the PlaybackSDK tutorial! In this tutorial, you will learn how to integrate and use the PlaybackSDK in your iOS applications."}],"title":"Introduction to PlaybackSDK"},"https://github.com/StreamAMG/playback-sdk-ios/tree/main":{"titleInlineContent":[{"type":"text","text":"GitHub Repository"}],"type":"link","url":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","title":"GitHub Repository","identifier":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main"}}} \ No newline at end of file diff --git a/docs/metadata.json b/docs/metadata.json index 2820538..6633899 100644 --- a/docs/metadata.json +++ b/docs/metadata.json @@ -1 +1 @@ -{"bundleIdentifier":"PlaybackSDK","bundleDisplayName":"PlaybackSDK","schemaVersion":{"major":0,"patch":0,"minor":1}} \ No newline at end of file +{"schemaVersion":{"patch":0,"major":0,"minor":1},"bundleDisplayName":"PlaybackSDK","bundleIdentifier":"PlaybackSDK"} \ No newline at end of file