Skip to content

Commit

Permalink
Merge pull request #25 from StreamAMG/feature/ZEUS-4472-iOS-document-…
Browse files Browse the repository at this point in the history
…reason-codes-return-via-the-playback-SDK

[ZEUS-4472] Updated documentation for reason code returned by SDK
  • Loading branch information
artem-y-pamediagroup authored Jul 19, 2024
2 parents 781bf4a + 3e8bec9 commit 6c0bf18
Show file tree
Hide file tree
Showing 20 changed files with 84 additions and 23 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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://apple.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.
Original file line number Diff line number Diff line change
@@ -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)
}
}
}
2 changes: 1 addition & 1 deletion docs/data/documentation/playbacksdk.json
Original file line number Diff line number Diff line change
@@ -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"}}}
{"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"}}}
1 change: 1 addition & 0 deletions docs/data/documentation/playbacksdk/playbackconfig.json
Original file line number Diff line number Diff line change
@@ -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"}}}
Original file line number Diff line number Diff line change
@@ -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"}}}
Original file line number Diff line number Diff line change
@@ -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"}}}
1 change: 1 addition & 0 deletions docs/data/documentation/playbacksdk/videoplayerconfig.json
Original file line number Diff line number Diff line change
@@ -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"}}}
Original file line number Diff line number Diff line change
@@ -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"}}}
Loading

0 comments on commit 6c0bf18

Please sign in to comment.