├── .github
└── workflows
│ ├── build.yml
│ ├── create-documentation-pr.yml
│ ├── create-release-from-changelog.yml
│ ├── release.yml
│ └── update-documentation.yml
├── .gitignore
├── .openapi-generator-ignore
├── .openapi-generator
├── FILES
├── VERSION
└── oas_apivideo.yaml-defaut-cli.sha256
├── .travis.yml
├── ApiVideoUploader.podspec
├── CHANGELOG.md
├── CONTRIBUTING.md
├── Cartfile
├── Example
├── Example.xcodeproj
│ ├── Example.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── swiftpm
│ │ └── Package.resolved
└── Example
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AccentColor.colorset
│ │ └── Contents.json
│ ├── AppIcon.appiconset
│ │ ├── 1024.png
│ │ ├── 120 1.png
│ │ ├── 120 2.png
│ │ ├── 152.png
│ │ ├── 167.png
│ │ ├── 180.png
│ │ ├── 20.png
│ │ ├── 29.png
│ │ ├── 40 1.png
│ │ ├── 40 2.png
│ │ ├── 40.png
│ │ ├── 58 1.png
│ │ ├── 58.png
│ │ ├── 60.png
│ │ ├── 76.png
│ │ ├── 80 1.png
│ │ ├── 80.png
│ │ ├── 87.png
│ │ └── Contents.json
│ └── Contents.json
│ ├── Base.lproj
│ ├── Assets.xcassets
│ │ ├── AccentColor.colorset
│ │ │ └── Contents.json
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ └── Contents.json
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ ├── MainViewController.swift
│ ├── Models
│ ├── CancellableApiTask.swift
│ ├── ClientAppError.swift
│ └── TaskManager.swift
│ ├── SceneDelegate.swift
│ ├── Settings.bundle
│ ├── Root.plist
│ └── en.lproj
│ │ └── Root.strings
│ └── Utils
│ ├── AlertUtils.swift
│ ├── AsyncApiUtils.swift
│ ├── SettingsManager.swift
│ └── UIColorExtensions.swift
├── LICENSE
├── Package.swift
├── README.md
├── Sources
├── APIHelper.swift
├── APIs.swift
├── APIs
│ ├── AdvancedAuthenticationAPI.swift
│ └── VideosAPI.swift
├── AlamofireImplementations.swift
├── Auth
│ ├── ApiVideoAuthenticator.swift
│ └── ApiVideoCredential.swift
├── CodableHelper.swift
├── Configuration.swift
├── Extensions.swift
├── JSONDataEncoding.swift
├── JSONEncodingHelper.swift
├── Models.swift
├── Models
│ ├── AccessToken.swift
│ ├── AdditionalBadRequestErrors.swift
│ ├── AuthenticatePayload.swift
│ ├── BadRequest.swift
│ ├── Environment.swift
│ ├── Metadata.swift
│ ├── NotFound.swift
│ ├── RefreshTokenPayload.swift
│ ├── TooManyRequests.swift
│ ├── Video.swift
│ ├── VideoAssets.swift
│ ├── VideoSource.swift
│ ├── VideoSourceLiveStream.swift
│ └── VideoSourceLiveStreamLink.swift
├── OpenISO8601DateFormatter.swift
├── SynchronizedDictionary.swift
└── Upload
│ ├── FileChunkInputStream.swift
│ ├── ProgressiveUploadSessionProtocol.swift
│ ├── RequestTaskQueue.swift
│ └── UploadChunkRequestTaskQueue.swift
├── Tests
└── TestResources
│ └── payloads
│ ├── advancedauthentication
│ ├── authenticate
│ │ └── responses
│ │ │ ├── 200.json
│ │ │ └── 400.json
│ └── refresh
│ │ └── responses
│ │ ├── 200.json
│ │ └── 400.json
│ └── videos
│ ├── upload
│ └── responses
│ │ ├── 201.json
│ │ ├── 400.json
│ │ ├── 404.json
│ │ └── 429.json
│ └── uploadWithUploadToken
│ └── responses
│ ├── 201.json
│ └── 429.json
├── docs
├── AccessToken.md
├── AdditionalBadRequestErrors.md
├── AdvancedAuthenticationAPI.md
├── AuthenticatePayload.md
├── BadRequest.md
├── Metadata.md
├── NotFound.md
├── RefreshTokenPayload.md
├── TooManyRequests.md
├── Video.md
├── VideoAssets.md
├── VideoSource.md
├── VideoSourceLiveStream.md
├── VideoSourceLiveStreamLink.md
└── VideosAPI.md
├── git_push.sh
├── post-generate.sh
└── project.yml
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 |
3 | on: [push]
4 |
5 | jobs:
6 | build-swift:
7 | name: Build with swift
8 | runs-on: macos-latest
9 |
10 | steps:
11 | - name: Checkout
12 | uses: actions/checkout@v3
13 | - name: xcode version
14 | uses: maxim-lobanov/setup-xcode@v1
15 | with:
16 | xcode-version: latest-stable
17 | - name: Build Package with swift
18 | run: swift build
19 |
20 | build-xcodebuild:
21 | name: Build with xcodebuild
22 | runs-on: macos-latest
23 |
24 | steps:
25 | - name: Checkout
26 | uses: actions/checkout@v3
27 | - name: xcode version
28 | uses: maxim-lobanov/setup-xcode@v1
29 | with:
30 | xcode-version: latest-stable
31 | - name: Build Package with xcodebuild
32 | run: xcodebuild -scheme ApiVideoUploader -destination 'platform=iOS Simulator,name=iPhone 16'
33 | - name: Build Example
34 | run: xcodebuild clean build -project Example/Example.xcodeproj -scheme ApiVideoUploader -sdk iphoneos
35 |
36 | cocoapods:
37 | name: Verify cocopods podspec
38 | needs: [ build-xcodebuild ]
39 | runs-on: macos-13
40 |
41 | steps:
42 | - name: Checkout
43 | uses: actions/checkout@v3
44 | - name: xcode version
45 | uses: maxim-lobanov/setup-xcode@v1
46 | with:
47 | xcode-version: '14.2.0'
48 | - name: Verify cocoapods
49 | run: pod lib lint --allow-warnings
50 |
--------------------------------------------------------------------------------
/.github/workflows/create-documentation-pr.yml:
--------------------------------------------------------------------------------
1 | name: Create documentation PR
2 | on:
3 | # Trigger the workflow on pull requests targeting the main branch
4 | pull_request:
5 | types: [assigned, unassigned, opened, reopened, synchronize, edited, labeled, unlabeled, edited, closed]
6 | branches:
7 | - main
8 |
9 | jobs:
10 | create_documentation_pr:
11 | if: github.event.action != 'closed'
12 |
13 | runs-on: ubuntu-latest
14 |
15 | steps:
16 | - name: Check out current repository code
17 | uses: actions/checkout@v2
18 |
19 | - name: Create the documentation pull request
20 | uses: apivideo/api.video-create-readme-file-pull-request-action@main
21 | with:
22 | source-file-path: "README.md"
23 | destination-repository: apivideo/api.video-documentation
24 | destination-path: sdks/vod
25 | destination-filename: apivideo-swift-uploader.md
26 | pat: "${{ secrets.PAT }}"
27 |
--------------------------------------------------------------------------------
/.github/workflows/create-release-from-changelog.yml:
--------------------------------------------------------------------------------
1 | name: Create draft release from CHANGELOG.md
2 |
3 | on:
4 | push:
5 | paths:
6 | - 'CHANGELOG.md'
7 |
8 | jobs:
9 | update-documentation:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@v4
13 | - name: Create draft release if needed
14 | uses: apivideo/api.video-release-from-changelog-action@main
15 | with:
16 | github-auth-token: ${{ secrets.GITHUB_TOKEN }}
17 | prefix: v
18 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release to Cocoapods
2 | on:
3 | release:
4 | types: [published]
5 | jobs:
6 | deploy:
7 | runs-on: macos-13
8 | steps:
9 | - uses: actions/checkout@v4
10 | - name: xcode version
11 | uses: maxim-lobanov/setup-xcode@v1
12 | with:
13 | xcode-version: '14.2.0'
14 |
15 | - name: Install Cocoapods
16 | run: gem install cocoapods
17 |
18 | - name: Deploy to Cocoapods
19 | run: |
20 | set -eo pipefail
21 | pod lib lint --allow-warnings
22 | pod trunk push --allow-warnings
23 | env:
24 | COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
--------------------------------------------------------------------------------
/.github/workflows/update-documentation.yml:
--------------------------------------------------------------------------------
1 | name: Update readme.io documentation
2 | on:
3 | push:
4 | branches:
5 | - main
6 | jobs:
7 | update-documentation:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - uses: actions/checkout@v2
11 | - name: Update readme.io documentation
12 | uses: apivideo/readmeio-document-sync-action@1.0
13 | with:
14 | document-slug: ios-video-uploader
15 | markdown-file-path: README.md
16 | readme-io-api-key: ${{ secrets.README_IO_API_KEY }}
17 | make-relative-links-absolute: true
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.toptal.com/developers/gitignore/api/swift,xcode
2 | # Edit at https://www.toptal.com/developers/gitignore?templates=swift,xcode
3 |
4 | ### Swift ###
5 | # Xcode
6 | #
7 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
8 |
9 | ## User settings
10 | xcuserdata/
11 |
12 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
13 | *.xcscmblueprint
14 | *.xccheckout
15 |
16 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
17 | build/
18 | DerivedData/
19 | *.moved-aside
20 | *.pbxuser
21 | !default.pbxuser
22 | *.mode1v3
23 | !default.mode1v3
24 | *.mode2v3
25 | !default.mode2v3
26 | *.perspectivev3
27 | !default.perspectivev3
28 |
29 | ## Obj-C/Swift specific
30 | *.hmap
31 |
32 | ## App packaging
33 | *.ipa
34 | *.dSYM.zip
35 | *.dSYM
36 |
37 | ## Playgrounds
38 | timeline.xctimeline
39 | playground.xcworkspace
40 |
41 | # Swift Package Manager
42 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
43 | # Packages/
44 | # Package.pins
45 | # Package.resolved
46 | # *.xcodeproj
47 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
48 | # hence it is not needed unless you have added a package configuration file to your project
49 | # .swiftpm
50 |
51 | .build/
52 |
53 | # CocoaPods
54 | # We recommend against adding the Pods directory to your .gitignore. However
55 | # you should judge for yourself, the pros and cons are mentioned at:
56 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
57 | # Pods/
58 | # Add this line if you want to avoid checking in source code from the Xcode workspace
59 | # *.xcworkspace
60 |
61 | # Carthage
62 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
63 | # Carthage/Checkouts
64 |
65 | Carthage/Build/
66 |
67 | # Add this lines if you are using Accio dependency management (Deprecated since Xcode 12)
68 | # Dependencies/
69 | # .accio/
70 |
71 | # fastlane
72 | # It is recommended to not store the screenshots in the git repo.
73 | # Instead, use fastlane to re-generate the screenshots whenever they are needed.
74 | # For more information about the recommended setup visit:
75 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
76 |
77 | fastlane/report.xml
78 | fastlane/Preview.html
79 | fastlane/screenshots/**/*.png
80 | fastlane/test_output
81 |
82 | # Code Injection
83 | # After new code Injection tools there's a generated folder /iOSInjectionProject
84 | # https://github.com/johnno1962/injectionforxcode
85 |
86 | iOSInjectionProject/
87 |
88 | ### Xcode ###
89 | # Xcode
90 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
91 |
92 |
93 |
94 |
95 | ## Gcc Patch
96 | /*.gcno
97 |
98 | ### Xcode Patch ###
99 | *.xcodeproj/*
100 | !*.xcodeproj/project.pbxproj
101 | !*.xcodeproj/xcshareddata/
102 | !*.xcworkspace/contents.xcworkspacedata
103 | **/xcshareddata/WorkspaceSettings.xcsettings
104 |
105 | # End of https://www.toptal.com/developers/gitignore/api/swift,xcode
--------------------------------------------------------------------------------
/.openapi-generator-ignore:
--------------------------------------------------------------------------------
1 | # OpenAPI Generator Ignore
2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3 |
4 | # Use this file to prevent files from being overwritten by the generator.
5 | # The patterns follow closely to .gitignore or .dockerignore.
6 |
7 | # As an example, the C# client generator defines ApiClient.cs.
8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9 | #ApiClient.cs
10 |
11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12 | #foo/*/qux
13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14 |
15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16 | #foo/**/qux
17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18 |
19 | # You can also negate patterns with an exclamation (!).
20 | # For example, you can ignore all files in a docs folder with the file extension .md:
21 | #docs/*.md
22 | # Then explicitly reverse the ignore rule for a single file:
23 | #!docs/README.md
24 |
--------------------------------------------------------------------------------
/.openapi-generator/FILES:
--------------------------------------------------------------------------------
1 | .gitignore
2 | ApiVideoUploader.podspec
3 | Cartfile
4 | Package.swift
5 | README.md
6 | Sources/APIHelper.swift
7 | Sources/APIs.swift
8 | Sources/APIs/AdvancedAuthenticationAPI.swift
9 | Sources/APIs/VideosAPI.swift
10 | Sources/AlamofireImplementations.swift
11 | Sources/Auth/ApiVideoAuthenticator.swift
12 | Sources/Auth/ApiVideoCredential.swift
13 | Sources/CodableHelper.swift
14 | Sources/Configuration.swift
15 | Sources/Extensions.swift
16 | Sources/JSONDataEncoding.swift
17 | Sources/JSONEncodingHelper.swift
18 | Sources/Models.swift
19 | Sources/Models/AccessToken.swift
20 | Sources/Models/AdditionalBadRequestErrors.swift
21 | Sources/Models/AuthenticatePayload.swift
22 | Sources/Models/BadRequest.swift
23 | Sources/Models/Environment.swift
24 | Sources/Models/Metadata.swift
25 | Sources/Models/NotFound.swift
26 | Sources/Models/RefreshTokenPayload.swift
27 | Sources/Models/TooManyRequests.swift
28 | Sources/Models/Video.swift
29 | Sources/Models/VideoAssets.swift
30 | Sources/Models/VideoSource.swift
31 | Sources/Models/VideoSourceLiveStream.swift
32 | Sources/Models/VideoSourceLiveStreamLink.swift
33 | Sources/OpenISO8601DateFormatter.swift
34 | Sources/SynchronizedDictionary.swift
35 | Sources/Upload/FileChunkInputStream.swift
36 | Sources/Upload/ProgressiveUploadSessionProtocol.swift
37 | Sources/Upload/RequestTaskQueue.swift
38 | Sources/Upload/UploadChunkRequestTaskQueue.swift
39 | docs/AccessToken.md
40 | docs/AdditionalBadRequestErrors.md
41 | docs/AdvancedAuthenticationAPI.md
42 | docs/AuthenticatePayload.md
43 | docs/BadRequest.md
44 | docs/Metadata.md
45 | docs/NotFound.md
46 | docs/RefreshTokenPayload.md
47 | docs/TooManyRequests.md
48 | docs/Video.md
49 | docs/VideoAssets.md
50 | docs/VideoSource.md
51 | docs/VideoSourceLiveStream.md
52 | docs/VideoSourceLiveStreamLink.md
53 | docs/VideosAPI.md
54 | git_push.sh
55 | post-generate.sh
56 | project.yml
57 |
--------------------------------------------------------------------------------
/.openapi-generator/VERSION:
--------------------------------------------------------------------------------
1 | 5.3.0
--------------------------------------------------------------------------------
/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256:
--------------------------------------------------------------------------------
1 | 5f3de7eed3d5a2900fd1d2d119c814cf00ac4e957ba0388f06acaf22f51e8e62
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | # references:
2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/
3 | # * https://github.com/supermarin/xcpretty#usage
4 |
5 | osx_image: xcode7.3
6 | language: objective-c
7 | # cache: cocoapods
8 | # podfile: Example/Podfile
9 | # before_install:
10 | # - gem install cocoapods # Since Travis is not always on latest version
11 | # - pod install --project-directory=Example
12 | script:
13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/VideoUploaderIos.xcworkspace -scheme VideoUploaderIos-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
14 | - pod lib lint
15 |
--------------------------------------------------------------------------------
/ApiVideoUploader.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = 'ApiVideoUploader'
3 | s.ios.deployment_target = '10.0'
4 | s.osx.deployment_target = '10.12'
5 | s.tvos.deployment_target = '10.0'
6 | # Add back when CocoaPods/CocoaPods#11558 is released
7 | #s.watchos.deployment_target = '3.0'
8 | s.version = '1.2.5'
9 | s.source = { :git => 'https://github.com/apivideo/api.video-swift-uploader', :tag => 'v1.2.5' }
10 | s.authors = { 'Ecosystem Team' => 'ecosystem@api.video' }
11 | s.license = { :type => 'MIT' }
12 | s.homepage = 'https://docs.api.video'
13 | s.summary = 'The official Swift api.video uploader for iOS, macOS and tvOS'
14 | s.source_files = 'Sources/**/*.swift'
15 | s.dependency 'AnyCodable-FlightSchool', '~> 0.6.1'
16 | s.dependency 'Alamofire', '~> 5.4.3'
17 | end
18 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 | All changes to this project will be documented in this file.
3 |
4 | ## [1.2.5] - 2024-10-21
5 | - Add support for Alamofire 5.10
6 |
7 | ## [1.2.4] - 2024-10-08
8 | - Add transcript feature
9 |
10 | ## [1.2.3] - 2024-04-25
11 | - Add API to get rate limiting headers
12 |
13 | ## [1.2.2] - 2023-08-25
14 | - Fix progressive upload with upload token and video id
15 |
16 | ## [1.2.1] - 2023-08-10
17 | - Add an API to upload with upload token and video id
18 | - Fix Models in documentation
19 |
20 | ## [1.1.1] - 2022-12-09
21 | - Fix on upload by chunk and progressive upload.
22 | - Add test on progressive upload.
23 | - Add a `build.yml` CI workflow.
24 |
25 | ## [1.1.0] - 2022-12-06
26 | - Refactor upload by chunk and progressive upload. It is now possible to cancel an upload.
27 | - Add timeout API
28 |
29 | ## [1.0.1] - 2022-09-13
30 | - period parameter is now mandatory in analytics endpoints
31 |
32 | ## [1.0.0] - 2022-07-05
33 | - Add SDK origin header
34 |
35 | ## [0.1.5] - 2022-04-21
36 | - Fix `video.publishedAt` type
37 |
38 | ## [0.1.4] - 2022-03-11
39 | - Add Origin identification headers
40 |
41 | ## [0.1.3] - 2022-01-24
42 | - Add applicationName parameter (to allow user agent extension)
43 |
44 | ## [0.1.2] - 2021-12-14
45 | - Set protocol for progressive upload session visibility to public
46 |
47 | ## [0.1.1] - 2021-12-14
48 | - Add a protocol for progressive upload session
49 |
50 | ## [0.1.0] - 2021-12-06
51 | - Initial release of generated version
52 |
53 | ## [0.0.3] - 2021-11-22
54 | - Fix large upload request time out
55 | - Fix callback on wrong token
56 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to api.video
2 |
3 | :movie_camera::+1::tada: Thank you for taking the time to contribute and participate in the implementation of a Video First World! :tada::+1::movie_camera:
4 |
5 | The following is a set of guidelines for contributing to api.video and its packages, which are hosted in the [api.video Organization](https://github.com/apivideo) on GitHub.
6 |
7 | #### Table of contents
8 |
9 | - [Contributing to api.video](#contributing-to-apivideo)
10 | - [Table of contents](#table-of-contents)
11 | - [Code of conduct](#code-of-conduct)
12 | - [I just have a question!](#i-just-have-a-question)
13 | - [How can I contribute?](#how-can-i-contribute)
14 | - [Reporting bugs](#reporting-bugs)
15 | - [Before submitting a bug report](#before-submitting-a-bug-report)
16 | - [How do I submit a (good) bug report?](#how-do-i-submit-a-good-bug-report)
17 | - [Suggesting enhancements](#suggesting-enhancements)
18 | - [How do I submit a (good) enhancement suggestion?](#how-do-i-submit-a-good-enhancement-suggestion)
19 | - [Pull requests](#pull-requests)
20 | - [Additional notes](#additional-notes)
21 | - [Issue labels](#issue-labels)
22 | - [Type of issue and issue state](#type-of-issue-and-issue-state)
23 | - [Topic categories](#topic-categories)
24 |
25 | ## Code of conduct
26 |
27 | This project and everyone participating in it is governed by the [api.video Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [help@api.video](mailto:help@api.video).
28 |
29 | ## I just have a question!
30 |
31 | > **Note:** [Please don't file an issue to ask a question.] You'll get faster results by using the resources below.
32 |
33 | We have an official message board with a detailed FAQ and where the community chimes in with helpful advice if you have questions.
34 |
35 | * [The official api.video's Community](https://community.api.video/)
36 | * [api.video FAQ](https://community.api.video/c/faq/)
37 |
38 |
39 | ## How can I contribute?
40 |
41 | ### Reporting bugs
42 |
43 | This section guides you through submitting a bug report for api.video. Following these guidelines helps maintainers and the community understand your report :pencil:, reproduce the behavior :computer:, and find related reports :mag_right:.
44 |
45 | Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out [the required template](https://github.com/apivideo/.github/blob/main/.github/ISSUE_TEMPLATE/bug_report.yml), the information it asks for helps us resolve issues faster.
46 |
47 | > **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
48 |
49 | #### Before submitting a bug report
50 |
51 | * **Check the [The official api.video's Community](https://community.api.video/)** for a list of common questions and problems.
52 | * **Determine which repository the problem should be reported in**.
53 | * **Perform a [cursory search](https://github.com/search?q=is%3Aissue+user%3Aapivideo)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one.
54 |
55 | #### How do I submit a (good) bug report?
56 |
57 | Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined which repository your bug is related to, create an issue on that repository and provide the following information by filling in [the template](https://github.com/apivideo/.github/blob/main/.github/ISSUE_TEMPLATE/bug_report.yml).
58 |
59 | Explain the problem and include additional details to help maintainers reproduce the problem:
60 |
61 | * **Use a clear and descriptive title** for the issue to identify the problem.
62 | * **Describe the exact steps which reproduce the problem** in as many details as possible. When listing steps, **don't just say what you did, but explain how you did it**.
63 | * **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
64 | * **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
65 | * **Explain which behavior you expected to see instead and why.**
66 | * **Include screenshots or videos** which show you following the described steps and clearly demonstrate the problem.
67 | * **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below.
68 |
69 | Provide more context by answering these questions:
70 |
71 | * **Did the problem start happening recently** (e.g. after updating to a new version of api.video) or was this always a problem?
72 | * If the problem started happening recently.**
73 | * **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
74 |
75 | Include details about your configuration and environment:
76 |
77 | * **Which version of the api.video package are you using?**
78 | * **What's the name and version of the OS you're using?**
79 |
80 | ### Suggesting enhancements
81 |
82 | This section guides you through submitting an enhancement suggestion for api.video project, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion :pencil: and find related suggestions :mag_right:.
83 |
84 | When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion). Fill in [the template](https://github.com/apivideo/.github/blob/main/.github/ISSUE_TEMPLATE/feature_request.yml), including the steps that you imagine you would take if the feature you're requesting existed.
85 |
86 |
87 | #### How do I submit a (good) enhancement suggestion?
88 |
89 | Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined which repository your enhancement suggestion is related to, create an issue on that repository and provide the following information:
90 |
91 | * **Use a clear and descriptive title** for the issue to identify the suggestion.
92 | * **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
93 | * **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
94 | * **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
95 | * **Include screenshots** which help you demonstrate the steps or point out the part of api.video which the suggestion is related to.
96 | * **Explain why this enhancement would be useful** to most api.video users and isn't something that can or should be implemented as a community package.
97 | * **Specify which version of the api.video package you're using.**
98 | * **Specify the name and version of the OS you're using.**
99 |
100 |
101 | ### Pull requests
102 |
103 | Since this API client is generated from an OpenAPI description, we cannot accept pull requests made directly to the repository.
104 | If you want to contribute, you can open a pull request on the repository of our [client generator](https://github.com/apivideo/api.video-api-client-generator).
105 | Otherwise, you can also simply open an issue detailing your need on this repository.
106 |
107 | ## Additional notes
108 |
109 | ### Issue labels
110 |
111 | This section lists the labels we use to help us track and manage issues on all api.video repositories.
112 |
113 | [GitHub search](https://help.github.com/articles/searching-issues/) makes it easy to use labels for finding groups of issues or pull requests you're interested in. We encourage you to read about [other search filters](https://help.github.com/articles/searching-issues/) which will help you write more focused queries.
114 |
115 |
116 | #### Type of issue and issue state
117 |
118 | | Label name | `apivideo` :mag_right: | Description |
119 | | --- | --- | --- |
120 | | `enhancement` | [search][search-apivideo-org-label-enhancement] | Feature requests. |
121 | | `bug` | [search][search-apivideo-org-label-bug] | Confirmed bugs or reports that are very likely to be bugs. |
122 | | `question` | [search][search-apivideo-org-label-question] | Questions more than bug reports or feature requests (e.g. how do I do X). |
123 | | `feedback` | [search][search-apivideo-org-label-feedback] | General feedback more than bug reports or feature requests. |
124 | | `help-wanted` | [search][search-apivideo-org-label-help-wanted] | The api.video team would appreciate help from the community in resolving these issues. |
125 | | `more-information-needed` | [search][search-apivideo-org-label-more-information-needed] | More information needs to be collected about these problems or feature requests (e.g. steps to reproduce). |
126 | | `needs-reproduction` | [search][search-apivideo-org-label-needs-reproduction] | Likely bugs, but haven't been reliably reproduced. |
127 | | `blocked` | [search][search-apivideo-org-label-blocked] | Issues blocked on other issues. |
128 | | `duplicate` | [search][search-apivideo-org-label-duplicate] | Issues which are duplicates of other issues, i.e. they have been reported before. |
129 | | `wontfix` | [search][search-apivideo-org-label-wontfix] | The api.video team has decided not to fix these issues for now, either because they're working as intended or for some other reason. |
130 | | `invalid` | [search][search-apivideo-org-label-invalid] | Issues which aren't valid (e.g. user errors). |
131 | | `package-idea` | [search][search-apivideo-org-label-package-idea] | Feature request which might be good candidates for new packages, instead of extending api.video packages. |
132 | | `wrong-repo` | [search][search-apivideo-org-label-wrong-repo] | Issues reported on the wrong repository. |
133 |
134 | #### Topic categories
135 |
136 | | Label name | `apivideo` :mag_right: | Description |
137 | | --- | --- | --- |
138 | | `windows` | [search][search-apivideo-org-label-windows] | Related to api.video running on Windows. |
139 | | `linux` | [search][search-apivideo-org-label-linux] | Related to api.video running on Linux. |
140 | | `mac` | [search][search-apivideo-org-label-mac] | Related to api.video running on macOS. |
141 | | `documentation` | [search][search-apivideo-org-label-documentation] | Related to any type of documentation. |
142 | | `performance` | [search][search-apivideo-org-label-performance] | Related to performance. |
143 | | `security` | [search][search-apivideo-org-label-security] | Related to security. |
144 | | `ui` | [search][search-apivideo-org-label-ui] | Related to visual design. |
145 | | `api` | [search][search-apivideo-org-label-api] | Related to api.video's public APIs. |
146 |
147 |
148 | [search-apivideo-org-label-enhancement]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Aenhancement
149 | [search-apivideo-org-label-bug]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Abug
150 | [search-apivideo-org-label-question]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Aquestion
151 | [search-apivideo-org-label-feedback]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Afeedback
152 | [search-apivideo-org-label-help-wanted]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Ahelp-wanted
153 | [search-apivideo-org-label-more-information-needed]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Amore-information-needed
154 | [search-apivideo-org-label-needs-reproduction]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Aneeds-reproduction
155 | [search-apivideo-org-label-windows]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Awindows
156 | [search-apivideo-org-label-linux]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Alinux
157 | [search-apivideo-org-label-mac]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Amac
158 | [search-apivideo-org-label-documentation]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Adocumentation
159 | [search-apivideo-org-label-performance]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Aperformance
160 | [search-apivideo-org-label-security]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Asecurity
161 | [search-apivideo-org-label-ui]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Aui
162 | [search-apivideo-org-label-api]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Aapi
163 | [search-apivideo-org-label-blocked]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Ablocked
164 | [search-apivideo-org-label-duplicate]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Aduplicate
165 | [search-apivideo-org-label-wontfix]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Awontfix
166 | [search-apivideo-org-label-invalid]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Ainvalid
167 | [search-apivideo-org-label-package-idea]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Apackage-idea
168 | [search-apivideo-org-label-wrong-repo]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3Aapivideo+label%3Awrong-repo
169 | [search-apivideo-org-label-work-in-progress]: https://github.com/search?q=is%3Aopen+is%3Apr+repo%3Aapivideo%2Fapivideo+label%3Awork-in-progress
170 | [search-apivideo-org-label-needs-review]: https://github.com/search?q=is%3Aopen+is%3Apr+repo%3Aapivideo%2Fapivideo+label%3Aneeds-review
171 | [search-apivideo-org-label-under-review]: https://github.com/search?q=is%3Aopen+is%3Apr+repo%3Aapivideo%2Fapivideo+label%3Aunder-review
172 | [search-apivideo-org-label-requires-changes]: https://github.com/search?q=is%3Aopen+is%3Apr+repo%3Aapivideo%2Fapivideo+label%3Arequires-changes
173 | [search-apivideo-org-label-needs-testing]: https://github.com/search?q=is%3Aopen+is%3Apr+repo%3Aapivideo%2Fapivideo+label%3Aneeds-testing
174 |
175 | [help-wanted]:https://github.com/search?q=is%3Aopen+is%3Aissue+label%3Ahelp-wanted+user%3Aapivideo+sort%3Acomments-desc
--------------------------------------------------------------------------------
/Cartfile:
--------------------------------------------------------------------------------
1 | github "Flight-School/AnyCodable" ~> 0.6.1
2 | github "Alamofire/Alamofire" ~> 5.4.3
3 |
--------------------------------------------------------------------------------
/Example/Example.xcodeproj/Example.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Example/Example.xcodeproj/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved:
--------------------------------------------------------------------------------
1 | {
2 | "pins" : [
3 | {
4 | "identity" : "alamofire",
5 | "kind" : "remoteSourceControl",
6 | "location" : "https://github.com/Alamofire/Alamofire",
7 | "state" : {
8 | "revision" : "d120af1e8638c7da36c8481fd61a66c0c08dc4fc",
9 | "version" : "5.4.4"
10 | }
11 | },
12 | {
13 | "identity" : "anycodable",
14 | "kind" : "remoteSourceControl",
15 | "location" : "https://github.com/Flight-School/AnyCodable",
16 | "state" : {
17 | "revision" : "b1a7a8a6186f2fcb28f7bda67cfc545de48b3c80",
18 | "version" : "0.6.2"
19 | }
20 | },
21 | {
22 | "identity" : "inappsettingskit",
23 | "kind" : "remoteSourceControl",
24 | "location" : "https://github.com/futuretap/InAppSettingsKit.git",
25 | "state" : {
26 | "revision" : "08ab93cd15759eed534b821c2ea789d97a0fdca0",
27 | "version" : "3.4.2"
28 | }
29 | }
30 | ],
31 | "version" : 2
32 | }
33 |
--------------------------------------------------------------------------------
/Example/Example/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // Example
4 | //
5 |
6 | import UIKit
7 |
8 | @main
9 | class AppDelegate: UIResponder, UIApplicationDelegate {
10 | func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
11 | // Override point for customization after application launch.
12 | return true
13 | }
14 |
15 | // MARK: UISceneSession Lifecycle
16 |
17 | func application(_: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options _: UIScene.ConnectionOptions) -> UISceneConfiguration {
18 | // Called when a new scene session is being created.
19 | // Use this method to select a configuration to create the new scene with.
20 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
21 | }
22 |
23 | func application(_: UIApplication, didDiscardSceneSessions _: Set) {
24 | // Called when the user discards a scene session.
25 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
26 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AccentColor.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "colors" : [
3 | {
4 | "idiom" : "universal"
5 | }
6 | ],
7 | "info" : {
8 | "author" : "xcode",
9 | "version" : 1
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/1024.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/120 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/120 1.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/120 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/120 2.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/152.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/167.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/180.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/20.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/29.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/40 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/40 1.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/40 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/40 2.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/40.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/58 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/58 1.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/58.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/60.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/76.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/80 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/80 1.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/80.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apivideo/api.video-swift-uploader/51c020bc0aaa1e350f3c8b960c3811401e330bcc/Example/Example/Assets.xcassets/AppIcon.appiconset/87.png
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "40.png",
5 | "idiom" : "iphone",
6 | "scale" : "2x",
7 | "size" : "20x20"
8 | },
9 | {
10 | "filename" : "60.png",
11 | "idiom" : "iphone",
12 | "scale" : "3x",
13 | "size" : "20x20"
14 | },
15 | {
16 | "filename" : "58 1.png",
17 | "idiom" : "iphone",
18 | "scale" : "2x",
19 | "size" : "29x29"
20 | },
21 | {
22 | "filename" : "87.png",
23 | "idiom" : "iphone",
24 | "scale" : "3x",
25 | "size" : "29x29"
26 | },
27 | {
28 | "filename" : "80 1.png",
29 | "idiom" : "iphone",
30 | "scale" : "2x",
31 | "size" : "40x40"
32 | },
33 | {
34 | "filename" : "120 2.png",
35 | "idiom" : "iphone",
36 | "scale" : "3x",
37 | "size" : "40x40"
38 | },
39 | {
40 | "filename" : "120 1.png",
41 | "idiom" : "iphone",
42 | "scale" : "2x",
43 | "size" : "60x60"
44 | },
45 | {
46 | "filename" : "180.png",
47 | "idiom" : "iphone",
48 | "scale" : "3x",
49 | "size" : "60x60"
50 | },
51 | {
52 | "filename" : "20.png",
53 | "idiom" : "ipad",
54 | "scale" : "1x",
55 | "size" : "20x20"
56 | },
57 | {
58 | "filename" : "40 1.png",
59 | "idiom" : "ipad",
60 | "scale" : "2x",
61 | "size" : "20x20"
62 | },
63 | {
64 | "filename" : "29.png",
65 | "idiom" : "ipad",
66 | "scale" : "1x",
67 | "size" : "29x29"
68 | },
69 | {
70 | "filename" : "58.png",
71 | "idiom" : "ipad",
72 | "scale" : "2x",
73 | "size" : "29x29"
74 | },
75 | {
76 | "filename" : "40 2.png",
77 | "idiom" : "ipad",
78 | "scale" : "1x",
79 | "size" : "40x40"
80 | },
81 | {
82 | "filename" : "80.png",
83 | "idiom" : "ipad",
84 | "scale" : "2x",
85 | "size" : "40x40"
86 | },
87 | {
88 | "filename" : "76.png",
89 | "idiom" : "ipad",
90 | "scale" : "1x",
91 | "size" : "76x76"
92 | },
93 | {
94 | "filename" : "152.png",
95 | "idiom" : "ipad",
96 | "scale" : "2x",
97 | "size" : "76x76"
98 | },
99 | {
100 | "filename" : "167.png",
101 | "idiom" : "ipad",
102 | "scale" : "2x",
103 | "size" : "83.5x83.5"
104 | },
105 | {
106 | "filename" : "1024.png",
107 | "idiom" : "ios-marketing",
108 | "scale" : "1x",
109 | "size" : "1024x1024"
110 | }
111 | ],
112 | "info" : {
113 | "author" : "xcode",
114 | "version" : 1
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/Example/Example/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Example/Base.lproj/Assets.xcassets/AccentColor.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "colors" : [
3 | {
4 | "idiom" : "universal"
5 | }
6 | ],
7 | "info" : {
8 | "author" : "xcode",
9 | "version" : 1
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Example/Example/Base.lproj/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "scale" : "2x",
6 | "size" : "20x20"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "scale" : "3x",
11 | "size" : "20x20"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "scale" : "2x",
16 | "size" : "29x29"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "scale" : "3x",
21 | "size" : "29x29"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "scale" : "2x",
26 | "size" : "40x40"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "scale" : "3x",
31 | "size" : "40x40"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "scale" : "2x",
36 | "size" : "60x60"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "scale" : "3x",
41 | "size" : "60x60"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "scale" : "1x",
46 | "size" : "20x20"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "scale" : "2x",
51 | "size" : "20x20"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "scale" : "1x",
56 | "size" : "29x29"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "scale" : "2x",
61 | "size" : "29x29"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "scale" : "1x",
66 | "size" : "40x40"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "scale" : "2x",
71 | "size" : "40x40"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "scale" : "1x",
76 | "size" : "76x76"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "scale" : "2x",
81 | "size" : "76x76"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "scale" : "2x",
86 | "size" : "83.5x83.5"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "scale" : "1x",
91 | "size" : "1024x1024"
92 | }
93 | ],
94 | "info" : {
95 | "author" : "xcode",
96 | "version" : 1
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/Example/Example/Base.lproj/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Example/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Example/Example/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Example/Example/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIApplicationSceneManifest
6 |
7 | UIApplicationSupportsMultipleScenes
8 |
9 | UISceneConfigurations
10 |
11 | UIWindowSceneSessionRoleApplication
12 |
13 |
14 | UISceneConfigurationName
15 | Default Configuration
16 | UISceneDelegateClassName
17 | $(PRODUCT_MODULE_NAME).SceneDelegate
18 | UISceneStoryboardFile
19 | Main
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Example/Example/MainViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewController.swift
3 | // Example
4 | //
5 |
6 | import ApiVideoUploader
7 | import AVKit
8 | import InAppSettingsKit
9 | import SwiftUI
10 | import UIKit
11 |
12 | class MainViewController: UIViewController {
13 | let imagePickerController = UIImagePickerController()
14 |
15 | /// Handle multiple upload tasks to cancel them easily
16 | /// It also runs them sequentially. We upload the file sequentially to simplify the upload progress bar.
17 | let taskManager = TaskManager()
18 |
19 | /// Manage configuration
20 | let iaskViewController: IASKAppSettingsViewController = {
21 | let iaskViewController = IASKAppSettingsViewController()
22 | iaskViewController.showCreditsFooter = false
23 | iaskViewController.view.tintColor = UIColor.orange
24 | return iaskViewController
25 | }()
26 |
27 | let videoPickerButton: UIButton = {
28 | let btn = UIButton(type: .system)
29 | btn.setTitle("Pick a video", for: .normal)
30 | btn.tintColor = UIColor.orange
31 | return btn
32 | }()
33 |
34 | let progressView: UIProgressView = {
35 | let view = UIProgressView()
36 | view.progressTintColor = UIColor.orange
37 | view.isHidden = true
38 | return view
39 | }()
40 |
41 | let cancelButton: UIButton = {
42 | let btn = UIButton(type: .system)
43 | btn.setTitle("Cancel all uploads", for: .normal)
44 | btn.tintColor = UIColor.orange
45 | btn.isHidden = true
46 | return btn
47 | }()
48 |
49 | override func viewDidLoad() {
50 | super.viewDidLoad()
51 |
52 | title = "Uploader"
53 | // Increasing timeout to 120s
54 | ApiVideoUploader.timeout = 120
55 |
56 | addChild(iaskViewController)
57 | view.addSubview(iaskViewController.view)
58 |
59 | view.addSubview(videoPickerButton)
60 | view.addSubview(progressView)
61 | view.addSubview(cancelButton)
62 |
63 | videoPickerButton.addTarget(self, action: #selector(pickVideo), for: .touchUpInside)
64 | cancelButton.addTarget(self, action: #selector(cleanUploadQueue), for: .touchUpInside)
65 |
66 | constraints()
67 | }
68 |
69 | func constraints() {
70 | iaskViewController.view.translatesAutoresizingMaskIntoConstraints = false
71 | videoPickerButton.translatesAutoresizingMaskIntoConstraints = false
72 | progressView.translatesAutoresizingMaskIntoConstraints = false
73 | cancelButton.translatesAutoresizingMaskIntoConstraints = false
74 |
75 | iaskViewController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
76 | iaskViewController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
77 | iaskViewController.view.heightAnchor.constraint(equalToConstant: 300).isActive = true
78 | iaskViewController.view.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
79 | iaskViewController.view.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 10).isActive = true
80 |
81 | videoPickerButton.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
82 | videoPickerButton.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
83 | videoPickerButton.heightAnchor.constraint(equalToConstant: 40).isActive = true
84 | videoPickerButton.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
85 | videoPickerButton.topAnchor.constraint(equalTo: iaskViewController.view.bottomAnchor, constant: 20).isActive = true
86 |
87 | progressView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
88 | progressView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
89 | progressView.heightAnchor.constraint(equalToConstant: 10).isActive = true
90 | progressView.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
91 | progressView.topAnchor.constraint(equalTo: videoPickerButton.bottomAnchor, constant: 10).isActive = true
92 |
93 | cancelButton.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
94 | cancelButton.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
95 | cancelButton.heightAnchor.constraint(equalToConstant: 40).isActive = true
96 | cancelButton.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
97 | cancelButton.topAnchor.constraint(equalTo: progressView.bottomAnchor, constant: 10).isActive = true
98 | }
99 |
100 | @objc func cleanUploadQueue() {
101 | taskManager.cancelAll()
102 | }
103 |
104 | @objc func pickVideo() {
105 | imagePickerController.sourceType = .photoLibrary
106 | imagePickerController.delegate = self
107 | imagePickerController.mediaTypes = ["public.movie"]
108 | imagePickerController.allowsEditing = false
109 | imagePickerController.videoQuality = .typeHigh
110 |
111 | // for IOS 11 and more
112 | if #available(iOS 11.0, *) {
113 | // disable video compressing to get the highest video quality
114 | imagePickerController.videoExportPreset = AVAssetExportPresetPassthrough
115 | }
116 |
117 | present(imagePickerController, animated: true, completion: nil)
118 | }
119 |
120 | /// Adds the upload task to the ``TaskManager``
121 | func addToUploadQueue(videoUrl: URL) {
122 | taskManager.add {
123 | do {
124 | return try await self.upload(fileUrl: videoUrl, progress: { progress in
125 | print("Progress: \(progress.fractionCompleted)")
126 | DispatchQueue.main.async {
127 | self.progressView.progress = Float(progress.fractionCompleted)
128 | }
129 | })
130 | } catch {
131 | print("Upload error: \(error)")
132 | AlertUtils.show(error.localizedDescription, title: "Error", vc: self)
133 | throw error
134 | }
135 | }
136 | }
137 |
138 | /// Creates and uploads a video with async/await
139 | private func upload(fileUrl: URL, progress: ((Progress) -> Void)? = nil) async throws {
140 | let uploadedVideo = try await AsyncApiUtils.uploadVideoWithUploadToken(uploadToken: SettingsManager.uploadToken, url: fileUrl, progress: progress)
141 |
142 | print("Video uploaded: \(uploadedVideo)")
143 | AlertUtils.show("File has been successfully uploaded at video ID: \(uploadedVideo.videoId)", title: "Success", vc: self)
144 | }
145 | }
146 |
147 | extension MainViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
148 | func imagePickerController(_: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) {
149 | guard let url = info[.mediaURL] as? URL else {
150 | AlertUtils.show("No video selected", vc: self)
151 | return
152 | }
153 |
154 | imagePickerController.dismiss(animated: true, completion: nil)
155 | cancelButton.isHidden = false
156 | progressView.isHidden = false
157 |
158 | // Set client configuration
159 | ApiVideoUploader.basePath = SettingsManager.environment.rawValue
160 |
161 | // Upload
162 | addToUploadQueue(videoUrl: url)
163 | }
164 | }
165 |
--------------------------------------------------------------------------------
/Example/Example/Models/CancellableApiTask.swift:
--------------------------------------------------------------------------------
1 | import ApiVideoUploader
2 | import Foundation
3 |
4 | /// A wrapper around ``RequestTask`` to make it cancellable
5 | class CancellableTask {
6 | internal var task: RequestTask?
7 |
8 | /// Execute the task
9 | func execute() async throws -> T {
10 | fatalError("Not implemented")
11 | }
12 |
13 | /// Cancel the task
14 | func cancel() {
15 | task?.cancel()
16 | }
17 | }
18 |
19 | /// An async/await wrapper around ``VideosAPI.upload`` to make it cancellable
20 | class CancellableUploadWithUploadTokenVideoTask: CancellableTask