{"id":13750002,"url":"https://github.com/SKrotkih/YTLiveStreaming","last_synced_at":"2025-05-09T13:31:44.492Z","repository":{"id":38689497,"uuid":"73482618","full_name":"SKrotkih/YTLiveStreaming","owner":"SKrotkih","description":"iOS open source framework to create live broadcasts and video streams on YouTube with YouTube Data API v3","archived":false,"fork":false,"pushed_at":"2024-05-29T08:05:36.000Z","size":895,"stargazers_count":103,"open_issues_count":15,"forks_count":47,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-20T08:05:12.099Z","etag":null,"topics":["cocoapod","cocoapods","googlesignin","moya","swift","swiftlint","swiftpackagemanager","swiftui","video-stream","xcode","xcode-unit-tests","youtube","youtube-api-v3"],"latest_commit_sha":null,"homepage":"","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/SKrotkih.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-11-11T14:08:00.000Z","updated_at":"2025-01-27T09:19:10.000Z","dependencies_parsed_at":"2024-01-22T17:08:03.748Z","dependency_job_id":null,"html_url":"https://github.com/SKrotkih/YTLiveStreaming","commit_stats":{"total_commits":169,"total_committers":7,"mean_commits":"24.142857142857142","dds":0.3254437869822485,"last_synced_commit":"8d29169d634b12b51937b839a19d34fa68abdd5a"},"previous_names":[],"tags_count":55,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKrotkih%2FYTLiveStreaming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKrotkih%2FYTLiveStreaming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKrotkih%2FYTLiveStreaming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKrotkih%2FYTLiveStreaming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SKrotkih","download_url":"https://codeload.github.com/SKrotkih/YTLiveStreaming/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253258275,"owners_count":21879619,"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":["cocoapod","cocoapods","googlesignin","moya","swift","swiftlint","swiftpackagemanager","swiftui","video-stream","xcode","xcode-unit-tests","youtube","youtube-api-v3"],"created_at":"2024-08-03T07:01:21.638Z","updated_at":"2025-05-09T13:31:44.095Z","avatar_url":"https://github.com/SKrotkih.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# YTLiveStreaming\n\nYTLiveStreaming is an open source iOS framework to create live broadcasts and video streams on YouTube using YouTube Live Streaming API\n(YouTube Data API v3)\n\n## Requirements\n\n- Xcode 13+\n- Swift 5.0\n\n## Introduction\n\n- First of all enable YouTube LIVE on your account.\n- Go to your Google account https://console.developers.google.com\n- Create a new application.\n- Go to the new application\n- Select Library\n- Select \"YouTube Data API v3\"\n- Select Credentials\n- Create Api key (API_KEY) ; In Key restriction select iOS, enter your iOS app bundle id; Save\n- Create Oauth 2.0 Cient ID (CLIENT_ID)\n\n- add three scopes for Google APIs: \"https://www.googleapis.com/auth/youtube\", \"https://www.googleapis.com/auth/youtube.readonly\",  \"https://www.googleapis.com/auth/youtube.force-ssl\"\n\n![](Assets/80702066-23271b80-8ae9-11ea-99e8-314ee1ae1c27.png)\n\n- fill Application Homepage link and Application Privacy Policy link. Submit for verification\n\n- as result you will have API_KEY and CLIENT_ID which will be used in Config.plist your iOS app later.\n\n![](Assets/173214138-adc9ca4b-33d6-4781-9f9b-d6ba6038527d.png)\n\n## Installation\n\n### CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\n\u003e CocoaPods 1.1.0+ is required to build YTLiveStreaming\n\nTo integrate YTLiveStreaming into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '13.0'\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\n    pod 'YTLiveStreaming'\nend\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n### Swift Package Manager\n\nTo integrate YTLiveStreaming package using Apple's Swift package manager\n- open your Xcode project\n- select File - Add packages...\n- in the Apple Swift Packages screen select 'Search or Enter Package URL'\n- enter https://github.com/SKrotkih/YTLiveStreaming.git\n- make sure YTLiveStreaming is opened\n- press 'Add Package' \n- Xcode creates 'Package Pependencies' group with YTLiveStreaming package with last version \n- open your Xcode project settings - PROJECT section on the Package Dependencies tab\n- make sure the YTLiveStreaming package name is presented there \n\n## User guide\n\n    [YouTube Live Streaming API Reference](https://developers.google.com/youtube/v3/live/docs) \n\n\timport YTLiveStreaming\n\n\t...\n\n\tlet input: YTLiveStreaming = YTLiveStreaming\n\n\t...\n\n    // Get broadcasts list\n    let broadcastList = await input.getBroadcastListAsync()\n\n\t// Get all events in different arrays of the LiveBroadcastStreamModel type\n\tinput.getAllBroadcasts(){ (upcomingEvents, liveNowEvents, completedEvents) in\n\t   ...\n\t}\n\n\t// Get events separately:\n\n\t// Get Ready to broadcast events\n\tinput.getUpcomingBroadcasts() { result in\n          switch result {\n              case .success(let upcomingEvents):\n                ...\n              case .failure(let error):\n                ...\n          }    \n\t} \n\n\t// Get Live now broadcasts\n\tinput.getLiveNowBroadcasts() ( result in\n          switch result {\n              case .success(let  liveNowEvents):\n                  ...\n              case .failure(let error):\n                  ...\n          }\n\t} \n\n\t// Get Completed broadcasts\n\tinput.getCompletedBroadcasts() ( result in\n             switch result {\n                 case .success(let completedEvents):\n                     ...\n                 case .failure(let error):\n                     ...\n             }\n       } \n\n\t// Create Broadcast\n\tinput.createBroadcast(title, description: description, startTime: startDate, completion: { liveBroadcast in\n\t   if let liveBroadcast = liveBroadcast {\n\t      ...\n\t   }\n\t})\n\n\t// Update of the existing broadcast: LiveBroadcastStreamModel\n\tinput.updateBroadcast(broadcast, completion: { success in\n\t    if success {\n\t       ...\n\t    }      \n\t})\n\n\t// Start broadcast streaming video\n\tinput.startBroadcast(broadcast, delegate: self, completion: { streamName, streamUrl, _ in\n\t   if let streamName = streamName, let streamUrl = streamUrl {\n\t     completion(streamUrl, streamName)\n\t   }\n\t})\n\n\t// Finish broadcast streaming video\n\tinput.completeBroadcast(broadcast, completion: { success in\n\t   if success {\n\t      ...\n\t   }\n\t})\n\n\t// Delete all broadcast from the USER's account\n    if await input.deleteAllBroadcastsAsync() {\n        // all broadcasts are deleted\n    }\n    \n    // Delete broadcasts by IDs\n    if await input.deleteBroadcastsAsync(broadcastIDs) {\n        // all broadcasts by IDs are deleted\n    }\n    \n    // Delete broadcast by ID   \n\tinput.deleteBroadcast(id: broadcastId, completion: { success in\n\t    if success {\n\t       ...\n\t    }\n\t})\n\t\n\nAnd some other public methods of the YTLiveStreaming class  \n\n## Example of using YTLiveStreaming Framework\n\n[LiveEvents](https://github.com/SKrotkih/LiveEvents) is an example of using the framework \n\n## Libraries Used\n\n- SwiftyJSON\n- Moya\n- KeychainAccess\n\nNote. Here were used the following things:\n- Podspec ( https://guides.cocoapods.org/syntax/podspec.html )\n- Swiftlint\n- Xcode unit tests\n- Objective-C + Swift code example\n\nThe project was created\n11-11-2016\n\nChanges history:\n27.12.2022\n- added async function to get broadcasts list\n- added async functions for deleting broadcasts \n24.12.2022\n- build 0.2.36\n- create new public structure PostLiveBroadcastBody as insert broadcast request body\n20-12-2022\n- build 0.2.29\n- update the project structure\n- add methods descriptions\n19-12-2022\n- build 0.2.28\n- up to date all data structures\n- add descriptions for fields, requests, responses\n25-07-2022 \n- build 0.2.27\n16-07-2022\n- build 0.2.26\n- package.swift was added\n08-07-2022 Add ability to integrate the framework as a package\n29-06-2022 Example project (LiveEvents) was removed from the project into a separate repo\n14-06-2022\n - added Combine based method apart from RxSwift publisher subject to handle Google Sign-in results;\n - updated Google Sign-In according actual framework version;\n - implemented Google SignIn screen with using SwiftUI.\n18-05-2021\n- added SwuftUI based content view for the YouTube video player \n04-05-2021\n- added youtube-ios-player-helper as an video player\n- added Xcode unit test \n 15-03-2021\n- added Swiftlint \n- fixed Swiftlint warnings\n- Sample app was renamed to LiveEvents\n29-04-2020 \n -  build 0.2.17\n - Sample app was redesigned\n -  GoogleSignIn (used in the Sample app): up to 5.0.2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSKrotkih%2FYTLiveStreaming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSKrotkih%2FYTLiveStreaming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSKrotkih%2FYTLiveStreaming/lists"}