All Projects → SKrotkih → YTLiveStreaming

SKrotkih / YTLiveStreaming

Licence: MIT License
YTLiveStreaming is a framework for creating live broadcasts and video streams on YouTube using the YouTube Live Streaming API (YouTube Data API v3) in Swift 5 with Xcode 11 and later

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to YTLiveStreaming

vscode-linter
Extension for code linting, all in one package. New linters can be easily added through an extension framework.
Stars: ✭ 47 (-42.68%)
Mutual labels:  swiftlint
search-youtube
An Android App used for searching and playing videos from YouTube. Used: Youtube Data API v3, YouTube Player API
Stars: ✭ 24 (-70.73%)
Mutual labels:  youtube-api-v3
GitTime
GitTime is GitHub Tracking App. Using ReactorKit, RxSwift, Moya.
Stars: ✭ 55 (-32.93%)
Mutual labels:  moya
Swift-Viper-Weather-App
iOS app with Clean Architecture
Stars: ✭ 20 (-75.61%)
Mutual labels:  moya
youtube-chat-for-minecraft
A plugin for Minecraft Forge that provides an API for YouTube live chat services
Stars: ✭ 53 (-35.37%)
Mutual labels:  youtube-api-v3
YouP3
Android app for downloading media from YouTube with 4K Support (Beta)
Stars: ✭ 51 (-37.8%)
Mutual labels:  youtube-api-v3
phpvibe-lite
PHPVibe Open source video CMS / Video Sharing CMS / Youtube Api v3 / Video Embeds
Stars: ✭ 71 (-13.41%)
Mutual labels:  youtube-api-v3
GitHubSearch
GitHub iOS client with minimum third-party dependencies.
Stars: ✭ 34 (-58.54%)
Mutual labels:  swiftlint
dnn-object-detection
Analyze real-time CCTV images with Convolutional Neural Networks
Stars: ✭ 93 (+13.41%)
Mutual labels:  video-stream
RxSwiftMVVM
RxSwift MVVM Moya HandyJSON
Stars: ✭ 58 (-29.27%)
Mutual labels:  moya
Serverless-Saturdays
A repo that contains all the resources from the Serverless Saturdays series
Stars: ✭ 16 (-80.49%)
Mutual labels:  video-stream
videostream
Video Streaming site using Laravel and WebTorrent
Stars: ✭ 36 (-56.1%)
Mutual labels:  video-stream
danger-plugin-lint-report
No description or website provided.
Stars: ✭ 17 (-79.27%)
Mutual labels:  swiftlint
iOS Started Kit
iOS Started Kit: Clean Architecture + RxSwift + Moya
Stars: ✭ 12 (-85.37%)
Mutual labels:  moya
youtube-deno
A Deno client library of the YouTube Data API.
Stars: ✭ 30 (-63.41%)
Mutual labels:  youtube-api-v3
swiftlint-config
Good starter config for SwiftLint
Stars: ✭ 34 (-58.54%)
Mutual labels:  swiftlint
Moya-Gloss
Gloss bindings for Moya
Stars: ✭ 37 (-54.88%)
Mutual labels:  moya
ToDo-App
Manage your chores with this ToDo-App in Swift
Stars: ✭ 27 (-67.07%)
Mutual labels:  swiftlint
SwiftMoyaCodeGenerator
This is a Paw Extension that generates Moya code.
Stars: ✭ 14 (-82.93%)
Mutual labels:  moya
Home-Monitoring-Raspberry-Pi-Node
Raspberry Pi & Node.js diy Home Monitoring & Intruder Alert system
Stars: ✭ 46 (-43.9%)
Mutual labels:  video-stream

YTLiveStreaming

YTLiveStreaming is an iOS framework which can be used for creating live broadcasts and video streams on YouTube using YouTube Live Streaming API (YouTube Data API v3)

Requirements

  • Xcode 11+
  • Swift 5.0

Introduction

OAuth consent screen

  • fill Application Homepage link and Application Privacy Policy link. Submit for verification

  • as result you will have API_KEY and CLIENT_ID which will be used in info.plist your iOS app later.

Google API Manager

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1.0+ is required to build YTLiveStreaming

To integrate YTLiveStreaming into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '12.1'
use_frameworks!

target '<Your Target Name>' do
    pod 'YTLiveStreaming'
end

Then, run the following command:

$ pod install

Prepare and launch an example

As an example used iOS app Live Events

Live Events Logo

  • Download or clone the repository.

  • Select Sample folder

  • Launch pod install

  • Open LiveEvents.xcworkspace.

  • Change current bundle id on your

  • Create Config.plist. Copy content Config.plist.example.plist into new Config.plist. Change current values of the client ID and API key on yours.

  • Put CLIENT_ID and API_KEY into the plist.info:

Credentials

  • In Sample/Info.plist edit the CFBundleURLSchemes. Change the value that starts with "com.googleusercontent.apps." based on your API key. It should be set to the reversed API key. The API key has the format XXXXXXXX.apps.googleusercontent.com and the allowed URL should be com.googleusercontent.apps.XXXXXXXX

User guide

import YTLiveStreaming

...

let input: YTLiveStreaming = YTLiveStreaming

...

// Get all events in different arrays of the LiveBroadcastStreamModel type
input.getAllBroadcasts(){ (upcomingEvents, liveNowEvents, completedEvents) in
   ...
}

// Get events separately:

// Get Ready to broadcast events
input.getUpcomingBroadcasts() { result in
      switch result {
          case .success(let upcomingEvents):
            ...
          case .failure(let error):
            ...
      }    
} 

// Get Live now broadcasts
input.getLiveNowBroadcasts() ( result in
      switch result {
          case .success(let  liveNowEvents):
              ...
          case .failure(let error):
              ...
      }
} 

// Get Completed broadcasts
input.getCompletedBroadcasts() ( result in
         switch result {
             case .success(let completedEvents):
                 ...
             case .failure(let error):
                 ...
         }
   } 

// Create Broadcast
input.createBroadcast(title, description: description, startTime: startDate, completion: { liveBroadcast in
   if let liveBroadcast = liveBroadcast {
      ...
   }
})

// Update of the existing broadcast: LiveBroadcastStreamModel
input.updateBroadcast(broadcast, completion: { success in
    if success {
       ...
    }      
})

// Start broadcast streaming video
input.startBroadcast(broadcast, delegate: self, completion: { streamName, streamUrl, _ in
   if let streamName = streamName, let streamUrl = streamUrl {
     completion(streamUrl, streamName)
   }
})

// Finish broadcast streaming video
input.completeBroadcast(broadcast, completion: { success in
   if success {
      ...
   }
})

// Delete broadcast video from YouTube
input.deleteBroadcast(id: broadcastId, completion: { success in
    if success {
       ...
    }
})

And some other public methods of the YTLiveStreaming class

Libraries Used

Note. Here were used the following things:

Author Serhii Krotkykh

The project was created 11-11-2016

Changes history: 29-04-2020

  • build 0.2.17
  • Sample app was redesigned
  • GoogleSignIn (used in the Sample app): up to 5.0.2 15-03-2021
  • added Swiftlint
  • fixed Swiftlint warnings
  • Sample app was renamed to LiveEvents 04-05-2021
  • added youtube-ios-player-helper as an video player
  • added Xcode unit test 18-05-2021
  • added SwuftUI based content view for the YouTube video player
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].