From 9d41cb3e3c44d7445d8ca80ffe9caed5daeb72f3 Mon Sep 17 00:00:00 2001 From: Oleksandr Kharchenko Date: Thu, 18 Jul 2024 15:43:16 +0300 Subject: [PATCH 1/5] [ZEUS-4472] Updated documentation for reason code returned by SDK --- .../Resources/PlayBackAPIError.swift | 59 ++++++++++++++----- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackAPIError.swift b/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackAPIError.swift index 3bfb27d..947b819 100644 --- a/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackAPIError.swift +++ b/Sources/PlaybackSDK/Documentation.docc/Resources/PlayBackAPIError.swift @@ -1,18 +1,47 @@ 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) +// Define reason codes returned by Playback SDK +public enum PlaybackErrorReason: Equatable { + // Http error 400 + case headerError + case badRequestError + case siteNotFound + case configurationError + case apiKeyError + case mpPartnerError + + // Http error 401 + case tokenError + case tooManyDevices + case tooManyRequests + case noEntitlement + case noSubscription + case noActiveSession + case notAuthenticated + + // Http error 404 + case noEntityExist + + // Unknown error with associated custom message + case unknownError(String) + + init(fromString value: String) { + switch value.uppercased() { + case "HEADER_ERROR": self = .headerError + case "BAD_REQUEST_ERROR": self = .badRequestError + case "SITE_NOT_FOUND": self = .siteNotFound + case "CONFIGURATION_ERROR": self = .configurationError + case "API_KEY_ERROR": self = .apiKeyError + case "MP_PARTNER_ERROR": self = .mpPartnerError + case "TOKEN_ERROR": self = .tokenError + case "TOO_MANY_DEVICES": self = .tooManyDevices + case "TOO_MANY_REQUESTS": self = .tooManyRequests + case "NO_ENTITLEMENT": self = .noEntitlement + case "NO_SUBSCRIPTION": self = .noSubscription + case "NO_ACTIVE_SESSION": self = .noActiveSession + case "NOT_AUTHENTICATED": self = .notAuthenticated + case "NO_ENTITY_EXIST": self = .noEntityExist + default: self = .unknownError(value) + } + } } From 1c52dddf0c91046db03e498ef0ea6359b81132aa Mon Sep 17 00:00:00 2001 From: "Artem Y." <160732886+artem-y-pamediagroup@users.noreply.github.com> Date: Fri, 19 Jul 2024 12:35:14 +0300 Subject: [PATCH 2/5] Update the link to GitHub Pages generation docs in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5186c5d..2039af7 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,6 @@ By default the SDK uses system user agent, so if your app uses native URL Sessio To update the documentation, follow these steps: 1. Make changes to the documentation code. -2. Build the documentation following the instructions in [this URL](https://apple.github.io/swift-docc-plugin/documentation/swiftdoccplugin/publishing-to-github-pages/). +2. Build the documentation following the instructions in [this URL](https://swiftlang.github.io/swift-docc-plugin/documentation/swiftdoccplugin/publishing-to-github-pages/). 3. Merge the code into the `gh-pages` branch. From 8a593a221e7c761f7f6b7f19133a61c5bc7d3675 Mon Sep 17 00:00:00 2001 From: Artem Yelizarov Date: Fri, 19 Jul 2024 13:18:18 +0300 Subject: [PATCH 3/5] [ZEUS-4472] Re-generate documentation after update --- docs/data/documentation/playbacksdk.json | 2 +- docs/data/documentation/playbacksdk/playbackconfig.json | 1 + .../playbacksdk/playbackconfig/autoplayenabled.json | 1 + .../playbacksdk/playbackconfig/backgroundplaybackenabled.json | 1 + docs/data/documentation/playbacksdk/videoplayerconfig.json | 1 + .../documentation/playbacksdk/videoplayerconfig/init().json | 1 + .../playbacksdk/videoplayerconfig/playbackconfig.json | 1 + docs/data/tutorials/playbacksdk/getstarted.json | 2 +- docs/data/tutorials/table-of-contents.json | 2 +- .../playbacksdk/playbackconfig/autoplayenabled/index.html | 1 + .../playbackconfig/backgroundplaybackenabled/index.html | 1 + docs/documentation/playbacksdk/playbackconfig/index.html | 1 + docs/documentation/playbacksdk/videoplayerconfig/index.html | 1 + .../playbacksdk/videoplayerconfig/init()/index.html | 1 + .../playbacksdk/videoplayerconfig/playbackconfig/index.html | 1 + docs/index/index.json | 2 +- docs/metadata.json | 2 +- 17 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 docs/data/documentation/playbacksdk/playbackconfig.json create mode 100644 docs/data/documentation/playbacksdk/playbackconfig/autoplayenabled.json create mode 100644 docs/data/documentation/playbacksdk/playbackconfig/backgroundplaybackenabled.json create mode 100644 docs/data/documentation/playbacksdk/videoplayerconfig.json create mode 100644 docs/data/documentation/playbacksdk/videoplayerconfig/init().json create mode 100644 docs/data/documentation/playbacksdk/videoplayerconfig/playbackconfig.json create mode 100644 docs/documentation/playbacksdk/playbackconfig/autoplayenabled/index.html create mode 100644 docs/documentation/playbacksdk/playbackconfig/backgroundplaybackenabled/index.html create mode 100644 docs/documentation/playbacksdk/playbackconfig/index.html create mode 100644 docs/documentation/playbacksdk/videoplayerconfig/index.html create mode 100644 docs/documentation/playbacksdk/videoplayerconfig/init()/index.html create mode 100644 docs/documentation/playbacksdk/videoplayerconfig/playbackconfig/index.html diff --git a/docs/data/documentation/playbacksdk.json b/docs/data/documentation/playbacksdk.json index 8f340b2..c52f8ec 100644 --- a/docs/data/documentation/playbacksdk.json +++ b/docs/data/documentation/playbacksdk.json @@ -1 +1 @@ -{"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 +{"metadata":{"role":"collection","modules":[{"name":"PlaybackSDK"}],"roleHeading":"Framework","title":"PlaybackSDK","externalID":"PlaybackSDK","symbolKind":"module"},"hierarchy":{"paths":[[]]},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/playbacksdk"]}],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK"},"sections":[],"schemaVersion":{"minor":3,"major":0,"patch":0},"kind":"symbol","topicSections":[{"title":"Structures","identifiers":["doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig","doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/VideoPlayerConfig"]}],"references":{"doc://PlaybackSDK/documentation/PlaybackSDK":{"type":"topic","title":"PlaybackSDK","url":"\/documentation\/playbacksdk","abstract":[],"identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","kind":"symbol","role":"collection"},"doc://PlaybackSDK/documentation/PlaybackSDK/PlaybackConfig":{"url":"\/documentation\/playbacksdk\/playbackconfig","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig","navigatorTitle":[{"kind":"identifier","text":"PlaybackConfig"}],"role":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"identifier","text":"PlaybackConfig"}],"abstract":[],"type":"topic","title":"PlaybackConfig","kind":"symbol"},"doc://PlaybackSDK/documentation/PlaybackSDK/VideoPlayerConfig":{"role":"symbol","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/VideoPlayerConfig","kind":"symbol","url":"\/documentation\/playbacksdk\/videoplayerconfig","navigatorTitle":[{"kind":"identifier","text":"VideoPlayerConfig"}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"VideoPlayerConfig","kind":"identifier"}],"abstract":[],"type":"topic","title":"VideoPlayerConfig"}}} \ No newline at end of file diff --git a/docs/data/documentation/playbacksdk/playbackconfig.json b/docs/data/documentation/playbacksdk/playbackconfig.json new file mode 100644 index 0000000..b80001a --- /dev/null +++ b/docs/data/documentation/playbacksdk/playbackconfig.json @@ -0,0 +1 @@ +{"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig"},"sections":[],"kind":"symbol","primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"struct","kind":"keyword"},{"kind":"text","text":" "},{"kind":"identifier","text":"PlaybackConfig"}],"platforms":["macOS"],"languages":["swift"]}]}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/playbacksdk\/playbackconfig"]}],"schemaVersion":{"minor":3,"major":0,"patch":0},"metadata":{"fragments":[{"text":"struct","kind":"keyword"},{"kind":"text","text":" "},{"kind":"identifier","text":"PlaybackConfig"}],"title":"PlaybackConfig","modules":[{"name":"PlaybackSDK"}],"roleHeading":"Structure","navigatorTitle":[{"kind":"identifier","text":"PlaybackConfig"}],"role":"symbol","externalID":"s:11PlaybackSDK0A6ConfigV","symbolKind":"struct"},"hierarchy":{"paths":[["doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK"]]},"topicSections":[{"identifiers":["doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig\/autoplayEnabled","doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig\/backgroundPlaybackEnabled"],"title":"Instance Properties"}],"references":{"doc://PlaybackSDK/documentation/PlaybackSDK":{"type":"topic","title":"PlaybackSDK","url":"\/documentation\/playbacksdk","abstract":[],"identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","kind":"symbol","role":"collection"},"doc://PlaybackSDK/documentation/PlaybackSDK/PlaybackConfig/backgroundPlaybackEnabled":{"type":"topic","title":"backgroundPlaybackEnabled","url":"\/documentation\/playbacksdk\/playbackconfig\/backgroundplaybackenabled","abstract":[],"identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig\/backgroundPlaybackEnabled","kind":"symbol","fragments":[{"kind":"keyword","text":"var"},{"kind":"text","text":" "},{"text":"backgroundPlaybackEnabled","kind":"identifier"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:Sb","text":"Bool"}],"role":"symbol"},"doc://PlaybackSDK/documentation/PlaybackSDK/PlaybackConfig/autoplayEnabled":{"type":"topic","role":"symbol","fragments":[{"kind":"keyword","text":"var"},{"text":" ","kind":"text"},{"text":"autoplayEnabled","kind":"identifier"},{"kind":"text","text":": "},{"preciseIdentifier":"s:Sb","text":"Bool","kind":"typeIdentifier"}],"kind":"symbol","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig\/autoplayEnabled","title":"autoplayEnabled","url":"\/documentation\/playbacksdk\/playbackconfig\/autoplayenabled","abstract":[]},"doc://PlaybackSDK/documentation/PlaybackSDK/PlaybackConfig":{"url":"\/documentation\/playbacksdk\/playbackconfig","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig","navigatorTitle":[{"kind":"identifier","text":"PlaybackConfig"}],"role":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"identifier","text":"PlaybackConfig"}],"abstract":[],"type":"topic","title":"PlaybackConfig","kind":"symbol"}}} \ No newline at end of file diff --git a/docs/data/documentation/playbacksdk/playbackconfig/autoplayenabled.json b/docs/data/documentation/playbacksdk/playbackconfig/autoplayenabled.json new file mode 100644 index 0000000..5200e03 --- /dev/null +++ b/docs/data/documentation/playbacksdk/playbackconfig/autoplayenabled.json @@ -0,0 +1 @@ +{"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig\/autoplayEnabled"},"schemaVersion":{"major":0,"minor":3,"patch":0},"variants":[{"paths":["\/documentation\/playbacksdk\/playbackconfig\/autoplayenabled"],"traits":[{"interfaceLanguage":"swift"}]}],"hierarchy":{"paths":[["doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig"]]},"primaryContentSections":[{"declarations":[{"platforms":["macOS"],"languages":["swift"],"tokens":[{"text":"var","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"identifier","text":"autoplayEnabled"},{"text":": ","kind":"text"},{"kind":"typeIdentifier","text":"Bool","preciseIdentifier":"s:Sb"}]}],"kind":"declarations"}],"kind":"symbol","sections":[],"metadata":{"symbolKind":"property","modules":[{"name":"PlaybackSDK"}],"fragments":[{"text":"var","kind":"keyword"},{"kind":"text","text":" "},{"text":"autoplayEnabled","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:Sb","text":"Bool","kind":"typeIdentifier"}],"roleHeading":"Instance Property","externalID":"s:11PlaybackSDK0A6ConfigV15autoplayEnabledSbvp","role":"symbol","title":"autoplayEnabled"},"references":{"doc://PlaybackSDK/documentation/PlaybackSDK/PlaybackConfig":{"abstract":[],"url":"\/documentation\/playbacksdk\/playbackconfig","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"text":"PlaybackConfig","kind":"identifier"}],"kind":"symbol","title":"PlaybackConfig","type":"topic","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig","role":"symbol","navigatorTitle":[{"text":"PlaybackConfig","kind":"identifier"}]},"doc://PlaybackSDK/documentation/PlaybackSDK/PlaybackConfig/autoplayEnabled":{"type":"topic","role":"symbol","fragments":[{"kind":"keyword","text":"var"},{"text":" ","kind":"text"},{"text":"autoplayEnabled","kind":"identifier"},{"kind":"text","text":": "},{"preciseIdentifier":"s:Sb","text":"Bool","kind":"typeIdentifier"}],"kind":"symbol","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig\/autoplayEnabled","title":"autoplayEnabled","url":"\/documentation\/playbacksdk\/playbackconfig\/autoplayenabled","abstract":[]},"doc://PlaybackSDK/documentation/PlaybackSDK":{"type":"topic","title":"PlaybackSDK","url":"\/documentation\/playbacksdk","abstract":[],"identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","kind":"symbol","role":"collection"}}} \ No newline at end of file diff --git a/docs/data/documentation/playbacksdk/playbackconfig/backgroundplaybackenabled.json b/docs/data/documentation/playbacksdk/playbackconfig/backgroundplaybackenabled.json new file mode 100644 index 0000000..a6883a4 --- /dev/null +++ b/docs/data/documentation/playbacksdk/playbackconfig/backgroundplaybackenabled.json @@ -0,0 +1 @@ +{"identifier":{"url":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig\/backgroundPlaybackEnabled","interfaceLanguage":"swift"},"sections":[],"metadata":{"role":"symbol","fragments":[{"kind":"keyword","text":"var"},{"text":" ","kind":"text"},{"text":"backgroundPlaybackEnabled","kind":"identifier"},{"text":": ","kind":"text"},{"text":"Bool","preciseIdentifier":"s:Sb","kind":"typeIdentifier"}],"symbolKind":"property","roleHeading":"Instance Property","title":"backgroundPlaybackEnabled","modules":[{"name":"PlaybackSDK"}],"externalID":"s:11PlaybackSDK0A6ConfigV010backgroundA7EnabledSbvp"},"kind":"symbol","variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/playbacksdk\/playbackconfig\/backgroundplaybackenabled"]}],"hierarchy":{"paths":[["doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig"]]},"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"var"},{"kind":"text","text":" "},{"kind":"identifier","text":"backgroundPlaybackEnabled"},{"text":": ","kind":"text"},{"kind":"typeIdentifier","preciseIdentifier":"s:Sb","text":"Bool"}],"languages":["swift"],"platforms":["macOS"]}]}],"schemaVersion":{"minor":3,"patch":0,"major":0},"references":{"doc://PlaybackSDK/documentation/PlaybackSDK/PlaybackConfig/backgroundPlaybackEnabled":{"type":"topic","url":"\/documentation\/playbacksdk\/playbackconfig\/backgroundplaybackenabled","role":"symbol","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig\/backgroundPlaybackEnabled","abstract":[],"title":"backgroundPlaybackEnabled","kind":"symbol","fragments":[{"text":"var","kind":"keyword"},{"kind":"text","text":" "},{"text":"backgroundPlaybackEnabled","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:Sb","text":"Bool","kind":"typeIdentifier"}]},"doc://PlaybackSDK/documentation/PlaybackSDK":{"type":"topic","title":"PlaybackSDK","url":"\/documentation\/playbacksdk","abstract":[],"identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","kind":"symbol","role":"collection"},"doc://PlaybackSDK/documentation/PlaybackSDK/PlaybackConfig":{"url":"\/documentation\/playbacksdk\/playbackconfig","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig","navigatorTitle":[{"kind":"identifier","text":"PlaybackConfig"}],"role":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"identifier","text":"PlaybackConfig"}],"abstract":[],"type":"topic","title":"PlaybackConfig","kind":"symbol"}}} \ No newline at end of file diff --git a/docs/data/documentation/playbacksdk/videoplayerconfig.json b/docs/data/documentation/playbacksdk/videoplayerconfig.json new file mode 100644 index 0000000..a6c9403 --- /dev/null +++ b/docs/data/documentation/playbacksdk/videoplayerconfig.json @@ -0,0 +1 @@ +{"kind":"symbol","metadata":{"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"VideoPlayerConfig","kind":"identifier"}],"title":"VideoPlayerConfig","externalID":"s:11PlaybackSDK17VideoPlayerConfigV","roleHeading":"Structure","navigatorTitle":[{"kind":"identifier","text":"VideoPlayerConfig"}],"modules":[{"name":"PlaybackSDK"}],"role":"symbol","symbolKind":"struct"},"sections":[],"schemaVersion":{"patch":0,"major":0,"minor":3},"topicSections":[{"identifiers":["doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/VideoPlayerConfig\/init()"],"title":"Initializers"},{"title":"Instance Properties","identifiers":["doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/VideoPlayerConfig\/playbackConfig"]}],"identifier":{"url":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/VideoPlayerConfig","interfaceLanguage":"swift"},"variants":[{"paths":["\/documentation\/playbacksdk\/videoplayerconfig"],"traits":[{"interfaceLanguage":"swift"}]}],"hierarchy":{"paths":[["doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK"]]},"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"languages":["swift"],"tokens":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"text":"VideoPlayerConfig","kind":"identifier"}]}]}],"references":{"doc://PlaybackSDK/documentation/PlaybackSDK/VideoPlayerConfig":{"role":"symbol","title":"VideoPlayerConfig","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/VideoPlayerConfig","abstract":[],"type":"topic","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"VideoPlayerConfig","kind":"identifier"}],"kind":"symbol","url":"\/documentation\/playbacksdk\/videoplayerconfig","navigatorTitle":[{"kind":"identifier","text":"VideoPlayerConfig"}]},"doc://PlaybackSDK/documentation/PlaybackSDK/VideoPlayerConfig/playbackConfig":{"url":"\/documentation\/playbacksdk\/videoplayerconfig\/playbackconfig","kind":"symbol","role":"symbol","fragments":[{"kind":"keyword","text":"var"},{"text":" ","kind":"text"},{"text":"playbackConfig","kind":"identifier"},{"text":": ","kind":"text"},{"kind":"typeIdentifier","text":"PlaybackConfig","preciseIdentifier":"s:11PlaybackSDK0A6ConfigV"}],"type":"topic","title":"playbackConfig","abstract":[],"identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/VideoPlayerConfig\/playbackConfig"},"doc://PlaybackSDK/documentation/PlaybackSDK":{"type":"topic","title":"PlaybackSDK","url":"\/documentation\/playbacksdk","abstract":[],"identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","kind":"symbol","role":"collection"},"doc://PlaybackSDK/documentation/PlaybackSDK/VideoPlayerConfig/init()":{"title":"init()","role":"symbol","fragments":[{"text":"init","kind":"identifier"},{"kind":"text","text":"()"}],"type":"topic","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/VideoPlayerConfig\/init()","abstract":[],"url":"\/documentation\/playbacksdk\/videoplayerconfig\/init()","kind":"symbol"}}} \ No newline at end of file diff --git a/docs/data/documentation/playbacksdk/videoplayerconfig/init().json b/docs/data/documentation/playbacksdk/videoplayerconfig/init().json new file mode 100644 index 0000000..8070d43 --- /dev/null +++ b/docs/data/documentation/playbacksdk/videoplayerconfig/init().json @@ -0,0 +1 @@ +{"primaryContentSections":[{"declarations":[{"tokens":[{"text":"init","kind":"keyword"},{"kind":"text","text":"()"}],"languages":["swift"],"platforms":["macOS"]}],"kind":"declarations"}],"identifier":{"url":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/VideoPlayerConfig\/init()","interfaceLanguage":"swift"},"variants":[{"paths":["\/documentation\/playbacksdk\/videoplayerconfig\/init()"],"traits":[{"interfaceLanguage":"swift"}]}],"kind":"symbol","schemaVersion":{"patch":0,"major":0,"minor":3},"sections":[],"hierarchy":{"paths":[["doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/VideoPlayerConfig"]]},"metadata":{"title":"init()","role":"symbol","fragments":[{"text":"init","kind":"identifier"},{"text":"()","kind":"text"}],"externalID":"s:11PlaybackSDK17VideoPlayerConfigVACycfc","symbolKind":"init","roleHeading":"Initializer","modules":[{"name":"PlaybackSDK"}]},"references":{"doc://PlaybackSDK/documentation/PlaybackSDK/VideoPlayerConfig/init()":{"title":"init()","role":"symbol","fragments":[{"text":"init","kind":"identifier"},{"kind":"text","text":"()"}],"type":"topic","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/VideoPlayerConfig\/init()","abstract":[],"url":"\/documentation\/playbacksdk\/videoplayerconfig\/init()","kind":"symbol"},"doc://PlaybackSDK/documentation/PlaybackSDK":{"type":"topic","title":"PlaybackSDK","url":"\/documentation\/playbacksdk","abstract":[],"identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","kind":"symbol","role":"collection"},"doc://PlaybackSDK/documentation/PlaybackSDK/VideoPlayerConfig":{"role":"symbol","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/VideoPlayerConfig","kind":"symbol","url":"\/documentation\/playbacksdk\/videoplayerconfig","navigatorTitle":[{"kind":"identifier","text":"VideoPlayerConfig"}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"VideoPlayerConfig","kind":"identifier"}],"abstract":[],"type":"topic","title":"VideoPlayerConfig"}}} \ No newline at end of file diff --git a/docs/data/documentation/playbacksdk/videoplayerconfig/playbackconfig.json b/docs/data/documentation/playbacksdk/videoplayerconfig/playbackconfig.json new file mode 100644 index 0000000..bec96b6 --- /dev/null +++ b/docs/data/documentation/playbacksdk/videoplayerconfig/playbackconfig.json @@ -0,0 +1 @@ +{"variants":[{"paths":["\/documentation\/playbacksdk\/videoplayerconfig\/playbackconfig"],"traits":[{"interfaceLanguage":"swift"}]}],"hierarchy":{"paths":[["doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/VideoPlayerConfig"]]},"kind":"symbol","schemaVersion":{"minor":3,"major":0,"patch":0},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/VideoPlayerConfig\/playbackConfig"},"sections":[],"metadata":{"modules":[{"name":"PlaybackSDK"}],"externalID":"s:11PlaybackSDK17VideoPlayerConfigV08playbackE0AA0aE0Vvp","role":"symbol","fragments":[{"kind":"keyword","text":"var"},{"text":" ","kind":"text"},{"kind":"identifier","text":"playbackConfig"},{"text":": ","kind":"text"},{"text":"PlaybackConfig","kind":"typeIdentifier","preciseIdentifier":"s:11PlaybackSDK0A6ConfigV"}],"symbolKind":"property","roleHeading":"Instance Property","title":"playbackConfig"},"primaryContentSections":[{"kind":"declarations","declarations":[{"languages":["swift"],"platforms":["macOS"],"tokens":[{"text":"var","kind":"keyword"},{"text":" ","kind":"text"},{"text":"playbackConfig","kind":"identifier"},{"text":": ","kind":"text"},{"text":"PlaybackConfig","kind":"typeIdentifier","preciseIdentifier":"s:11PlaybackSDK0A6ConfigV","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig"}]}]}],"references":{"doc://PlaybackSDK/documentation/PlaybackSDK/PlaybackConfig":{"url":"\/documentation\/playbacksdk\/playbackconfig","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/PlaybackConfig","navigatorTitle":[{"kind":"identifier","text":"PlaybackConfig"}],"role":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"identifier","text":"PlaybackConfig"}],"abstract":[],"type":"topic","title":"PlaybackConfig","kind":"symbol"},"doc://PlaybackSDK/documentation/PlaybackSDK/VideoPlayerConfig/playbackConfig":{"url":"\/documentation\/playbacksdk\/videoplayerconfig\/playbackconfig","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/VideoPlayerConfig\/playbackConfig","role":"symbol","fragments":[{"text":"var","kind":"keyword"},{"text":" ","kind":"text"},{"text":"playbackConfig","kind":"identifier"},{"kind":"text","text":": "},{"preciseIdentifier":"s:11PlaybackSDK0A6ConfigV","text":"PlaybackConfig","kind":"typeIdentifier"}],"abstract":[],"type":"topic","title":"playbackConfig","kind":"symbol"},"doc://PlaybackSDK/documentation/PlaybackSDK":{"type":"topic","title":"PlaybackSDK","url":"\/documentation\/playbacksdk","abstract":[],"identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK","kind":"symbol","role":"collection"},"doc://PlaybackSDK/documentation/PlaybackSDK/VideoPlayerConfig":{"role":"symbol","identifier":"doc:\/\/PlaybackSDK\/documentation\/PlaybackSDK\/VideoPlayerConfig","kind":"symbol","url":"\/documentation\/playbacksdk\/videoplayerconfig","navigatorTitle":[{"kind":"identifier","text":"VideoPlayerConfig"}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"VideoPlayerConfig","kind":"identifier"}],"abstract":[],"type":"topic","title":"VideoPlayerConfig"}}} \ No newline at end of file diff --git a/docs/data/tutorials/playbacksdk/getstarted.json b/docs/data/tutorials/playbacksdk/getstarted.json index 608854a..3497103 100644 --- a/docs/data/tutorials/playbacksdk/getstarted.json +++ b/docs/data/tutorials/playbacksdk/getstarted.json @@ -1 +1 @@ -{"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 +{"identifier":{"url":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","interfaceLanguage":"swift"},"kind":"project","sections":[{"kind":"hero","title":"Playback SDK Overview","chapter":"Getting Started","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":[{"type":"text","text":"Key Features:"}]}],"type":"paragraph"},{"type":"unorderedList","items":[{"content":[{"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."}],"type":"paragraph"}]},{"content":[{"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"}],"type":"paragraph"}]},{"content":[{"type":"paragraph","inlineContent":[{"type":"strong","inlineContent":[{"text":"Error Handling:","type":"text"}]},{"type":"text","text":" Provides mechanisms to handle potential issues during playback and notify your application."}]}]}]}]},{"kind":"tasks","tasks":[{"title":"Playback SDK","anchor":"Playback-SDK","stepsSection":[{"content":[{"type":"paragraph","inlineContent":[{"text":"Initialize the Playback SDK by providing your API key and register the default player plugin.","type":"text"},{"text":" ","type":"text"},{"type":"strong","inlineContent":[{"text":"Make sure this step is done when the app starts.","type":"text"}]}]}],"code":"PlayBackDemoApp.swift","type":"step","media":null,"runtimePreview":null,"caption":[]},{"media":null,"content":[{"inlineContent":[{"text":"Add custom ","type":"text"},{"type":"codeVoice","code":"user-agent"},{"type":"text","text":" header."}],"type":"paragraph"}],"runtimePreview":null,"code":"PlayBackDemoAppWithUserAgent.swift","type":"step","caption":[{"type":"paragraph","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"},{"type":"text","text":" header with their own."},{"text":"\n","type":"text"},{"text":"If the content requires starting a CloudPay session, it’s important that the request to start the session has the same ","type":"text"},{"code":"user-agent","type":"codeVoice"},{"type":"text","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 "},{"code":"userAgent","type":"codeVoice"},{"type":"text","text":" parameter to the "},{"type":"codeVoice","code":"initialize"},{"text":" method, like in this example with Alamofire.","type":"text"}]}]},{"code":"PlayerTestView.swift","media":null,"caption":[{"inlineContent":[{"type":"text","text":"In this step, the code utilizes the "},{"type":"strong","inlineContent":[{"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.","type":"text"},{"type":"text","text":" "},{"text":"The ","type":"text"},{"type":"strong","inlineContent":[{"text":"handlePlaybackError","type":"text"}]},{"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."},{"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":"text"},{"inlineContent":[{"type":"text","text":"onDisappear"}],"type":"strong"},{"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 "},{"type":"strong","inlineContent":[{"type":"text","text":"nil"}]},{"text":" value as the ","type":"text"},{"inlineContent":[{"text":"authorizationToken","type":"text"}],"type":"strong"},{"text":" when calling the ","type":"text"},{"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."}],"type":"paragraph"}],"type":"step","runtimePreview":null,"content":[{"inlineContent":[{"text":"Load the player using the Playback SDK and handle any playback errors.","type":"text"}],"type":"paragraph"}]},{"content":[{"type":"paragraph","inlineContent":[{"text":"Handle the playback errors from Playback SDK.","type":"text"}]}],"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}]}],"runtimePreview":null,"type":"step","code":"PlayBackAPIError.swift","media":null}],"contentSection":[{"kind":"fullWidth","content":[{"type":"paragraph","inlineContent":[{"inlineContent":[{"type":"text","text":"Explore how to use StreamAMG Playback SDK."}],"type":"strong"}]}]}]}]}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/tutorials\/playbacksdk\/getstarted"]}],"schemaVersion":{"minor":3,"major":0,"patch":0},"metadata":{"category":"PlaybackSDK Tutorial","title":"Playback SDK Overview","role":"project","categoryPathComponent":"Table-Of-Contents"},"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"}]}],"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"},"references":{"doc://PlaybackSDK/tutorials/Table-Of-Contents":{"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","identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","title":"Introduction to PlaybackSDK","role":"overview","kind":"overview","type":"topic"},"PlayBackDemoAppWithUserAgent.swift":{"syntax":"swift","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)\")",""," }"," }"," }","}"],"identifier":"PlayBackDemoAppWithUserAgent.swift","fileName":"PlayBackDemoAppWithUserAgent.swift","highlights":[{"line":3},{"line":17},{"line":18},{"line":19},{"line":20},{"line":21}],"type":"file","fileType":"swift"},"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","identifier":"https:\/\/streamamg.stoplight.io\/docs\/playback-documentation-portal\/ec642e6dcbb13-get-video-playback-data","title":"Get Video Playback Data | Playback","titleInlineContent":[{"type":"text","text":"Get Video Playback Data | Playback"}]},"PlayerTestView.swift":{"syntax":"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)\""," }"," }"," ","}"],"fileName":"PlayerTestView.swift","identifier":"PlayerTestView.swift","highlights":[],"type":"file","fileType":"swift"},"PlayBackAPIError.swift":{"identifier":"PlayBackAPIError.swift","syntax":"swift","fileType":"swift","fileName":"PlayBackAPIError.swift","type":"file","content":["import Foundation","","\/\/ Define reason codes returned by Playback SDK","public enum PlaybackErrorReason: Equatable {"," \/\/ Http error 400"," case headerError"," case badRequestError"," case siteNotFound"," case configurationError"," case apiKeyError"," case mpPartnerError"," "," \/\/ Http error 401"," case tokenError"," case tooManyDevices"," case tooManyRequests"," case noEntitlement"," case noSubscription"," case noActiveSession"," case notAuthenticated"," "," \/\/ Http error 404"," case noEntityExist"," "," \/\/ Unknown error with associated custom message"," case unknownError(String)",""," init(fromString value: String) {"," switch value.uppercased() {"," case \"HEADER_ERROR\": self = .headerError"," case \"BAD_REQUEST_ERROR\": self = .badRequestError"," case \"SITE_NOT_FOUND\": self = .siteNotFound"," case \"CONFIGURATION_ERROR\": self = .configurationError"," case \"API_KEY_ERROR\": self = .apiKeyError"," case \"MP_PARTNER_ERROR\": self = .mpPartnerError"," case \"TOKEN_ERROR\": self = .tokenError"," case \"TOO_MANY_DEVICES\": self = .tooManyDevices"," case \"TOO_MANY_REQUESTS\": self = .tooManyRequests"," case \"NO_ENTITLEMENT\": self = .noEntitlement"," case \"NO_SUBSCRIPTION\": self = .noSubscription"," case \"NO_ACTIVE_SESSION\": self = .noActiveSession"," case \"NOT_AUTHENTICATED\": self = .notAuthenticated"," case \"NO_ENTITY_EXIST\": self = .noEntityExist"," default: self = .unknownError(value)"," }"," }","}"],"highlights":[]},"doc://PlaybackSDK/tutorials/Table-Of-Contents/Getting-Started":{"url":"\/tutorials\/table-of-contents\/getting-started","type":"topic","role":"article","title":"Getting Started","identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents\/Getting-Started","kind":"article","abstract":[]},"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted":{"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"}],"role":"project","kind":"project","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","title":"Playback SDK Overview","estimatedTime":"30min","type":"topic","url":"\/tutorials\/playbacksdk\/getstarted"},"doc://PlaybackSDK/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."}],"title":"Playback SDK","type":"section","kind":"section","url":"\/tutorials\/playbacksdk\/getstarted#Playback-SDK","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted#Playback-SDK","role":"pseudoSymbol"},"PlayBackDemoApp.swift":{"identifier":"PlayBackDemoApp.swift","syntax":"swift","type":"file","fileName":"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)\")",""," }"," }"," }","}",""],"fileType":"swift","highlights":[]}}} \ 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 2785770..118d233 100644 --- a/docs/data/tutorials/table-of-contents.json +++ b/docs/data/tutorials/table-of-contents.json @@ -1 +1 @@ -{"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 +{"kind":"overview","identifier":{"url":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","interfaceLanguage":"swift"},"schemaVersion":{"patch":0,"minor":3,"major":0},"hierarchy":{"reference":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","paths":[]},"sections":[{"action":{"identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","isActive":true,"overridingTitleInlineContent":[{"type":"text","text":"Get started"}],"type":"reference","overridingTitle":"Get started"},"kind":"hero","title":"Introduction to PlaybackSDK","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"}]},{"content":[],"kind":"volume","name":null,"chapters":[{"image":"ios-marketing.png","name":"Getting Started","tutorials":["doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted"],"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"}]}],"image":null},{"kind":"resources","tiles":[{"title":"Documentation","identifier":"documentation","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Browse and search the PlaybackSDK documentation."}]},{"type":"unorderedList","items":[{"content":[{"type":"paragraph","inlineContent":[{"type":"reference","identifier":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","isActive":true}]}]},{"content":[{"inlineContent":[{"type":"reference","isActive":true,"identifier":"https:\/\/streamamg.stoplight.io"}],"type":"paragraph"}]}]}]}],"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Explore more resources for learning about PlaybackSDK."}]}]}],"metadata":{"estimatedTime":"30min","role":"overview","title":"Introduction to PlaybackSDK","categoryPathComponent":"Table-Of-Contents","category":"PlaybackSDK Tutorial"},"variants":[{"paths":["\/tutorials\/table-of-contents"],"traits":[{"interfaceLanguage":"swift"}]}],"references":{"ios-marketing.png":{"alt":"Getting Started with PlaybackSDK","variants":[{"url":"\/images\/ios-marketing.png","traits":["1x","light"]}],"type":"image","identifier":"ios-marketing.png"},"https://github.com/StreamAMG/playback-sdk-ios/tree/main":{"type":"link","titleInlineContent":[{"text":"GitHub Repository","type":"text"}],"url":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main","title":"GitHub Repository","identifier":"https:\/\/github.com\/StreamAMG\/playback-sdk-ios\/tree\/main"},"doc://PlaybackSDK/tutorials/PlaybackSDK/GetStarted":{"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"}],"role":"project","kind":"project","identifier":"doc:\/\/PlaybackSDK\/tutorials\/PlaybackSDK\/GetStarted","title":"Playback SDK Overview","estimatedTime":"30min","type":"topic","url":"\/tutorials\/playbacksdk\/getstarted"},"doc://PlaybackSDK/tutorials/Table-Of-Contents":{"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","identifier":"doc:\/\/PlaybackSDK\/tutorials\/Table-Of-Contents","title":"Introduction to PlaybackSDK","role":"overview","kind":"overview","type":"topic"},"https://streamamg.stoplight.io":{"type":"link","identifier":"https:\/\/streamamg.stoplight.io","title":"Stoplight PlayBack API","url":"https:\/\/streamamg.stoplight.io","titleInlineContent":[{"text":"Stoplight PlayBack API","type":"text"}]}}} \ No newline at end of file diff --git a/docs/documentation/playbacksdk/playbackconfig/autoplayenabled/index.html b/docs/documentation/playbacksdk/playbackconfig/autoplayenabled/index.html new file mode 100644 index 0000000..c25d820 --- /dev/null +++ b/docs/documentation/playbacksdk/playbackconfig/autoplayenabled/index.html @@ -0,0 +1 @@ +Documentation
\ No newline at end of file diff --git a/docs/documentation/playbacksdk/playbackconfig/backgroundplaybackenabled/index.html b/docs/documentation/playbacksdk/playbackconfig/backgroundplaybackenabled/index.html new file mode 100644 index 0000000..c25d820 --- /dev/null +++ b/docs/documentation/playbacksdk/playbackconfig/backgroundplaybackenabled/index.html @@ -0,0 +1 @@ +Documentation
\ No newline at end of file diff --git a/docs/documentation/playbacksdk/playbackconfig/index.html b/docs/documentation/playbacksdk/playbackconfig/index.html new file mode 100644 index 0000000..c25d820 --- /dev/null +++ b/docs/documentation/playbacksdk/playbackconfig/index.html @@ -0,0 +1 @@ +Documentation
\ No newline at end of file diff --git a/docs/documentation/playbacksdk/videoplayerconfig/index.html b/docs/documentation/playbacksdk/videoplayerconfig/index.html new file mode 100644 index 0000000..c25d820 --- /dev/null +++ b/docs/documentation/playbacksdk/videoplayerconfig/index.html @@ -0,0 +1 @@ +Documentation
\ No newline at end of file diff --git a/docs/documentation/playbacksdk/videoplayerconfig/init()/index.html b/docs/documentation/playbacksdk/videoplayerconfig/init()/index.html new file mode 100644 index 0000000..c25d820 --- /dev/null +++ b/docs/documentation/playbacksdk/videoplayerconfig/init()/index.html @@ -0,0 +1 @@ +Documentation
\ No newline at end of file diff --git a/docs/documentation/playbacksdk/videoplayerconfig/playbackconfig/index.html b/docs/documentation/playbacksdk/videoplayerconfig/playbackconfig/index.html new file mode 100644 index 0000000..c25d820 --- /dev/null +++ b/docs/documentation/playbacksdk/videoplayerconfig/playbackconfig/index.html @@ -0,0 +1 @@ +Documentation
\ No newline at end of file diff --git a/docs/index/index.json b/docs/index/index.json index ab598fb..738ae7c 100644 --- a/docs/index/index.json +++ b/docs/index/index.json @@ -1 +1 @@ -{"interfaceLanguages":{"swift":[{"children":[{"title":"Getting Started","type":"groupMarker"},{"path":"\/tutorials\/playbacksdk\/getstarted","title":"Playback SDK Overview","type":"project"}],"path":"\/tutorials\/table-of-contents","title":"Introduction to PlaybackSDK","type":"overview"},{"path":"\/documentation\/playbacksdk","title":"PlaybackSDK","type":"module"}]},"schemaVersion":{"major":0,"minor":1,"patch":1}} \ No newline at end of file +{"interfaceLanguages":{"swift":[{"children":[{"title":"Getting Started","type":"groupMarker"},{"path":"\/tutorials\/playbacksdk\/getstarted","title":"Playback SDK Overview","type":"project"}],"path":"\/tutorials\/table-of-contents","title":"Introduction to PlaybackSDK","type":"overview"},{"children":[{"title":"Structures","type":"groupMarker"},{"children":[{"title":"Instance Properties","type":"groupMarker"},{"path":"\/documentation\/playbacksdk\/playbackconfig\/autoplayenabled","title":"var autoplayEnabled: Bool","type":"property"},{"path":"\/documentation\/playbacksdk\/playbackconfig\/backgroundplaybackenabled","title":"var backgroundPlaybackEnabled: Bool","type":"property"}],"path":"\/documentation\/playbacksdk\/playbackconfig","title":"PlaybackConfig","type":"struct"},{"children":[{"title":"Initializers","type":"groupMarker"},{"path":"\/documentation\/playbacksdk\/videoplayerconfig\/init()","title":"init()","type":"init"},{"title":"Instance Properties","type":"groupMarker"},{"path":"\/documentation\/playbacksdk\/videoplayerconfig\/playbackconfig","title":"var playbackConfig: PlaybackConfig","type":"property"}],"path":"\/documentation\/playbacksdk\/videoplayerconfig","title":"VideoPlayerConfig","type":"struct"}],"path":"\/documentation\/playbacksdk","title":"PlaybackSDK","type":"module"}]},"schemaVersion":{"major":0,"minor":1,"patch":1}} \ No newline at end of file diff --git a/docs/metadata.json b/docs/metadata.json index 6633899..08f5b83 100644 --- a/docs/metadata.json +++ b/docs/metadata.json @@ -1 +1 @@ -{"schemaVersion":{"patch":0,"major":0,"minor":1},"bundleDisplayName":"PlaybackSDK","bundleIdentifier":"PlaybackSDK"} \ No newline at end of file +{"bundleIdentifier":"PlaybackSDK","schemaVersion":{"major":0,"patch":0,"minor":1},"bundleDisplayName":"PlaybackSDK"} \ No newline at end of file From 4fe37f30e3acc4fed92409dd53dea69c8dbf5af4 Mon Sep 17 00:00:00 2001 From: Artem Yelizarov Date: Fri, 19 Jul 2024 13:36:21 +0300 Subject: [PATCH 4/5] [ZEUS-4472] Add convenience script to rebuild documentation --- generate_docc | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 generate_docc diff --git a/generate_docc b/generate_docc new file mode 100755 index 0000000..8c537f2 --- /dev/null +++ b/generate_docc @@ -0,0 +1,11 @@ +#!/bin/bash + +# This is a convenience script to re-generate Swift DocC documentation to prepare for GitHub Pages publishing +# Source: https://swiftlang.github.io/swift-docc-plugin/documentation/swiftdoccplugin/publishing-to-github-pages/ + +swift package --allow-writing-to-directory docs \ + generate-documentation --target PlaybackSDK \ + --disable-indexing \ + --transform-for-static-hosting \ + --hosting-base-path playback-sdk-ios \ + --output-path docs From 3e8bec9a301d50c06aaceec9d3387b2693b2a9b6 Mon Sep 17 00:00:00 2001 From: "Artem Y." <160732886+artem-y-pamediagroup@users.noreply.github.com> Date: Fri, 19 Jul 2024 13:46:22 +0300 Subject: [PATCH 5/5] Update README with correct steps to rebuild documentation --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2039af7..994f7fe 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,15 @@ By default the SDK uses system user agent, so if your app uses native URL Sessio To update the documentation, follow these steps: 1. Make changes to the documentation code. -2. Build the documentation following the instructions in [this URL](https://swiftlang.github.io/swift-docc-plugin/documentation/swiftdoccplugin/publishing-to-github-pages/). -3. Merge the code into the `gh-pages` branch. - +2. Build the documentation by running the convenience script from the root of this repository. + ```sh + ./generate_docc + ``` + or + ```sh + sh generate_docc + ``` + Alternatively, follow the instructions at [this URL](https://swiftlang.github.io/swift-docc-plugin/documentation/swiftdoccplugin/publishing-to-github-pages/). +3. Commit and push the changes onto your branch. +4. Go to [GitHub Pages settings](https://github.com/StreamAMG/playback-sdk-ios/settings/pages), change the Branch in `Build and deployment` section to your branch and press "Save". +5. After merging, redo step 4 to re-deploy the documentation from the branch where it was merged to.