{"id":18498057,"url":"https://github.com/apivideo/api.video-swift-live-stream","last_synced_at":"2025-12-12T06:28:31.445Z","repository":{"id":44762110,"uuid":"362790417","full_name":"apivideo/api.video-swift-live-stream","owner":"apivideo","description":"Swift RTMP live stream client for iOS. Made with ♥ by api.video","archived":false,"fork":false,"pushed_at":"2024-04-08T09:33:36.000Z","size":512,"stargazers_count":28,"open_issues_count":0,"forks_count":12,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-08T10:48:52.556Z","etag":null,"topics":["h264","h264-encoder","ios","library","live-streaming","live-streaming-videos","livestream","swift","video"],"latest_commit_sha":null,"homepage":"https://api.video","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apivideo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-29T11:15:47.000Z","updated_at":"2024-06-05T17:42:52.315Z","dependencies_parsed_at":"2022-08-12T11:21:50.321Z","dependency_job_id":"df33d4d2-37ca-4384-a652-17f37beaaf16","html_url":"https://github.com/apivideo/api.video-swift-live-stream","commit_stats":null,"previous_names":["apivideo/livestreamios","apivideo/api.video-ios-live-stream"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apivideo%2Fapi.video-swift-live-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apivideo%2Fapi.video-swift-live-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apivideo%2Fapi.video-swift-live-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apivideo%2Fapi.video-swift-live-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apivideo","download_url":"https://codeload.github.com/apivideo/api.video-swift-live-stream/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247949744,"owners_count":21023377,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["h264","h264-encoder","ios","library","live-streaming","live-streaming-videos","livestream","swift","video"],"created_at":"2024-11-06T13:37:25.963Z","updated_at":"2025-12-12T06:28:31.382Z","avatar_url":"https://github.com/apivideo.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\u003cdocumentation_excluded\u003e--\u003e\n[![badge](https://img.shields.io/twitter/follow/api_video?style=social)](https://twitter.com/intent/follow?screen_name=api_video) \u0026nbsp; [![badge](https://img.shields.io/github/stars/apivideo/api.video-swift-live-stream?style=social)](https://github.com/apivideo/api.video-swift-live-stream) \u0026nbsp; [![badge](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.api.video)](https://community.api.video)\n![](https://github.com/apivideo/.github/blob/main/assets/apivideo_banner.png)\n\u003ch1 align=\"center\"\u003eSwift RTMP live stream client for iOS\u003c/h1\u003e\n\n[api.video](https://api.video) is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand \u0026 low latency live streaming features in your app.\n\n## Table of contents\n\n- [Table of contents](#table-of-contents)\n- [Project description](#project-description)\n- [Getting started](#getting-started)\n  - [Installation](#installation)\n    - [With Cocoapods](#with-cocoapods)\n  - [Permissions](#permissions)\n  - [Code sample](#code-sample)\n- [Plugins](#plugins)\n- [FAQ](#faq)\n\n\u003c!--\u003c/documentation_excluded\u003e--\u003e\n\u003c!--\u003cdocumentation_only\u003e\n---\ntitle: Swift live stream library\nmeta: \n  description: The official Swift live stream library for api.video. [api.video](https://api.video/) is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand \u0026 low latency live streaming features in your app.\n---\n\n# Swift Live stream library\n\n[api.video](https://api.video/) is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand \u0026 low latency live streaming features in your app.\n\n\u003c/documentation_only\u003e--\u003e\n## Project description\n\nThis module is an easy way to broadcast RTMP live stream to [api.video](https://api.video) platform\n\n## Getting started\n\n### Installation\n\n#### Swift Package Manager\n\nIn the Project Navigator select your own project. Then select the project in the Project section and click on the Package Dependencies tab. Click on the \"+\" button at the bottom. Paste the below url on the search bar on the top right. Finaly click on \"Add package\" button.\n\n```\nhttps://github.com/api.video-swift-live-stream\n```\nOr add this in your Package.swift\n```\n  dependencies: [\n        .package(url: \"https://github.com/api.video-swift-live-stream.git\", from: \"1.4.6\"),\n    ],\n```\n\n#### Cocoapods\n\n1. Add the following entry to your Podfile:\n```swift\npod 'ApiVideoLiveStream', '1.4.6'\n```\n2. Then run `pod install`\n3. Don’t forget to import `ApiVideoLiveStream` in every file you’d like to use api.video live stream library\n\n#### Carthage\n```\ngithub \"apivideo/ApiVideoLiveStream.swift\" ~\u003e 1.4.6\n```\n\n### Permissions\nTo be able to broadcast, you must update Info.plist with a usage description for camera and microphone\n\n```xml\n...\n\u003ckey\u003eNSCameraUsageDescription\u003c/key\u003e\n\u003cstring\u003eYour own description of the purpose\u003c/string\u003e\n\u003ckey\u003eNSMicrophoneUsageDescription\u003c/key\u003e\n\u003cstring\u003eYour own description of the purpose\u003c/string\u003e\n...\n```\n\n### Code sample\n1. In ViewController.swift import the library\n```swift\nimport ApiVideoLiveStream\n```\n2. Create a `ApiVideoLiveStream` object with your default audio and video configuration\n```swift\nclass ViewController: UIViewController {\n    var liveStream:  ApiVideoLiveStream?\n    @IBOutlet var viewCamera: UIView!\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        let audioConfig = AudioConfig(bitrate: 32 * 1000)\n        let videoConfig = VideoConfig(bitrate: 2 * 1024 * 1024, resolution: Resolutions.RESOLUTION_720, fps: 30)\n        do {\n            liveStream = try ApiVideoLiveStream(initialAudioConfig: audioConfig, initialVideoConfig: videoConfig, preview: preview)\n        } catch {\n            print (error)\n        }\n    }\n}\n```\n3. Start your live stream with `startStreaming`\n```swift\nliveStream?.startStreaming(streamKey: \"YOUR_STREAM_KEY\")\n```\nAlternatively, you can use `startStreaming` `url` parameter to set the URL of your RTMP server.\n\n## Plugins\n\napi.video sdk is using external library\n\n| Plugin | README |\n| ------ | ------ |\n| HaishinKit | [https://github.com/shogo4405/HaishinKit.swift][HaishinKit] |\n\n## FAQ\nIf you have any questions, ask us here:  https://community.api.video .\nOr use [Issues].\n\nAlso feel free to test our [Sample app].\n\n[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax)\n\n[Issues]: \u003chttps://github.com/apivideo/api.video-swift-live-stream/issues\u003e\n[HaishinKit]: \u003chttps://github.com/shogo4405/HaishinKit.swift\u003e\n[Sample app]: \u003chttps://github.com/apivideo/api.video-swift-live-stream/Example\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapivideo%2Fapi.video-swift-live-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapivideo%2Fapi.video-swift-live-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapivideo%2Fapi.video-swift-live-stream/lists"}