Live Broadcast Quickstart - Mac

Step 1: Obtain the SDK

Download the latest SDK from downloads or contact sales-us@agora.io.

Agora Native SDK for Mac package structure is listed as follows:

  • ./libs: including the required libraries
  • ./samples: including the sample codes
    • Communication: Agora-macOS-Tutorial-Swift-1to1
    • Live Broadcast: Open Live

Step 2: Prepare the Environments

  1. Be sure that the following development environment requirements are satisfied.

    • Apple XCode version 6.0 or later
    • OS X 10.0 or later
    • Prepare an App ID. Refer to Obtaining an App ID
  2. Be sure that the following libraries are ready.

    1. If you use the sample code downloaded in Step 1: Obtain the SDK , then no extra operation is required for this step.
    2. If you use the sample code downloaded from https://github.com/AgoraIO/OpenLive-macOS , follow the README.md file within the package.

Step 3: Demonstrate the Live Broadcast

Agora provides a sample code called Open Live. Follow this section to compile and run it.

Compile the Sample Code

  1. Open OpenLive.xcodeproj using Xcode.
  2. Fill your own App ID in KeyCenter.swift.
../../_images/mac-live-demo-1.png
  1. Click the build and run button to compile the demo.
../../_images/mac-live-demo-2.png

Execute the Sample Code

You can demonstrate the OpenLive sample code after the compilation. The demonstration requires at least two Mac devices:

  1. Open Open Live on the Mac device.
  2. Set the Host Mode.
  1. Enter a channel name in the field of Input Name of Live.
  2. Click the Join as Broadcaster button to enter the host page.

After joining the channel, the host mode includes the following functions:

  • End the Live Broadcast
    • Mute/Unmute
    • Switch to Audience Mode
../../_images/mac-live-1.png
  1. Set the Audience Mode.
  1. Enter the channel name set by the host.
  2. Click Join as Audience on the keyboard.