-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from StreamAMG/feature/ZEUS-4449-update-docs-o…
…n-user-agent-issue [ZEUS-4449] Improve documentation around the user-agent issue
- Loading branch information
Showing
15 changed files
with
98 additions
and
704 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
Sources/PlaybackSDK/Documentation.docc/Resources/InitializeSdkExample.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
Sources/PlaybackSDK/Documentation.docc/Resources/InstallPlayerPluginTutorial.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
Sources/PlaybackSDK/Documentation.docc/Resources/LoadHlsStreamTutorial.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
// | ||
// LoadHlsStreamTutorial.swift | ||
// | ||
// | ||
// Created by Franco Driansetti on 27/02/2024. | ||
// | ||
|
||
Swift | ||
|
||
|
7 changes: 0 additions & 7 deletions
7
Sources/PlaybackSDK/Documentation.docc/Resources/LoadPlayerViewTutorial.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackAPIError.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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) | ||
} |
18 changes: 6 additions & 12 deletions
18
Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackDemoApp.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,35 @@ | ||
// | ||
// 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)") | ||
|
||
} | ||
} | ||
} | ||
} | ||
|
38 changes: 38 additions & 0 deletions
38
Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackDemoAppWithUserAgent.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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)") | ||
|
||
} | ||
} | ||
} | ||
} |
7 changes: 0 additions & 7 deletions
7
Sources/PlaybackSDK/Documentation.docc/Resources/PlayerTestView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"}}} | ||
{"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"}}} |
Oops, something went wrong.