Giter VIP home page Giter VIP logo

api.video-ios-live-stream's Introduction

badge   badge   badge

iOS RTMP live stream client

api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.

Table of contents

Project description

This module is an easy way to broadcast RTMP live stream to api.video platform

Getting started

Installation

With Cocoapods

  1. Add the following entry to your Podfile:
pod 'ApiVideoLiveStream', '1.2.2'
  1. Then run pod install
  2. Don’t forget to import ApiVideoLiveStream in every file you’d like to use api.video livestream library

With Carthage

github "apivideo/ApiVideoLiveStream.swift" ~> 1.2.2

Permissions

To be able to broadcast, you must update Info.plist with a usage description for camera and microphone

...
<key>NSCameraUsageDescription</key>
<string>Your own description of the purpose</string>
<key>NSMicrophoneUsageDescription</key>
<string>Your own description of the purpose</string>
...

Code sample

  1. In ViewController.swift import the library
import ApiVideoLiveStream
  1. Create a ApiVideoLiveStream object with your default audio and video configuration
class ViewController: UIViewController {
    var liveStream:  ApiVideoLiveStream?
    @IBOutlet var viewCamera: UIView!
    override func viewDidLoad() {
        super.viewDidLoad()
        let audioConfig = AudioConfig(bitrate: 32 * 1000)
        let videoConfig = VideoConfig(bitrate: 2 * 1024 * 1024, resolution: Resolutions.RESOLUTION_720, fps: 30)
        do {
            liveStream = try ApiVideoLiveStream(initialAudioConfig: audioConfig, initialVideoConfig: videoConfig, preview: preview)
        } catch {
            print (error)
        }
    }
}
  1. Start your live stream with startStreaming
liveStream?.startStreaming(streamKey: "YOUR_STREAM_KEY")

Alternatively, you can use startStreaming url parameter to set the URL of your RTMP server.

Plugins

API.Video sdk is using external library

Plugin README
HaishinKit https://github.com/shogo4405/HaishinKit.swift

FAQ

If you have any questions, ask us here: https://community.api.video . Or use Issues.

Also feel free to test our Sample app.

api.video-ios-live-stream's People

Contributors

anthony-dantard avatar bluebazze avatar cedricmontet avatar dougsillars avatar erikkai avatar olivierapivideo avatar romainpetit1 avatar thibaultbee avatar titozzz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.