NAV Navbar
iOS android javascript


Welcome to Firekast! The best developer tools to bring live video streaming into your app without being a video expert.

Firekast is a Video as a Service platform, we provide iOS and Android SDKs to wrap camera usage, streaming, video encoding and player into something sweet and easy to use. Yes, you are 5 minutes away to make the next Periscope 😎

We obsesses over developer experience and want this documentation to be as clear as possible. If you have any question, suggestion, feature request, feel free to contact us, we would love to hear from you.

Firekast Basics

Before we start, let's introduce some Firekast basics concepts. You may already be familiar with since we designed our service with well known SaaS platforms in mind.

Nothing in life is to be feared, it is only to be understood. Now is the time to understand more, so that we may fear less. -- Marie Curie

API key

The API key allows you to make a restricted set of calls through our REST API. The API only allows calls to get streams for playback, typically for use with our JS Player.


This is your private account key. It is created once you create an account on Firekast dashboard. This key is needed for mobile SDK initialization.

It is available in Firekast dashboard and looks like c8178e40-0ccf-35e7-a17c-5b26c0cf5f87.


On your dashboard, you can create as many applications as you like. An application is identified with its unique applicationId and gathers all the streams you have made using this id.

To create an application, you must specify a name (usually your company name or app name), and specify a plan (free or paying, see pricing). Each of these information can be edited later.

An application can be deleted if you decide so.


The id that uniquely identifies an application.

It is available in the Firekast dashboard and looks like e8078520-0ccf-35e7-8493-034e3c17d8c0.


The id that uniquely identifies a stream in your application. See

It is available in the Firekast dashboard, within your application and looks like d17j39tg4noar25g3.

Active users

Each new device (mobile or web) that reaches our server is counted as a new active user once a month.

Getting Started


1. Edit your podfile

# Set the same version name X.Y.Z. for both Firekast and VideoCore pod.
pod 'Firekast', :podspec => ''
pod 'VideoCore', :git => '', :tag => 'fk-1.4.0'

# Please note, first `pod install` may be long, please be patient :)

2. Run in terminal

pod install

3. Specify camera and microphone usage description in your info.pList

<string>Camera usage description</string>
<string>Microphone usage description</string>

4. Initialize the SDK

import Firekast
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
  Firekast.initialize(clientKey: "YOUR_CLIENT_KEY", applicationId: "YOUR_APPLICATION_ID")

1. Edit your project root build.gradle

allprojects {
    repositories {
        maven { url '' }

2. Edit your app build.gradle

dependencies {
  implementation('io.firekast:firekast:1.4.0') // {
  //   exclude group: ""
  // }
  // ☝️ Uncomment above lines if targeting API 26 and below

3. Add camera, record audio and internet permission in your AndroidManifest.xml

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />

4. Initialize the SDK

Firekast.initialize(this, "YOUR_CLIENT_KEY", "YOUR_APPLICATION_ID");

1a. Import with script tag

<script src=""></script>

1b. Import with Webpack, Browserify...

const Firekast = require('firekast');

1c. Import with AMD module syntax

define(["firekast"], function(Firekast) { 

2. Initialize the SDK

  api_key: 'YOUR_API_KEY'

Firekast iOS SDK is distributed via Cocoapods.

Firekast Android SDK is distributed via Gradle.

Several options are available to import Firekast Javascript SDK in your project.

Note that the JS SDK is not yet available on the public npm registry. Please, let us know if you would love so.

Live stream

let streamer = FKStreamer(usecase: .portrait) // 1. initializes streamer
let camera = streamer.showCamera(.front, in: myView) // 2. open camera inside myView

streamer.requestStream { (stream, error) in // 3. create a stream
    streamer.startStreaming(on: stream, delegate: self) // 4. start streaming firekast
// 1. get fragment from layout
mCameraFragment = (FKCameraFragment) getSupportFragmentManager().findFragmentById(;
mCameraFragment.getCameraAsync(new FKCameraFragment.OnCameraReadyCallback() {
  public void onCameraReady(@Nullable FKCamera camera, @Nullable FKError error) {
    // 2. get camera as soon as it's available
    mCamera = camera; 
mStreamer = mCameraFragment.getStreamer();
// 3. create a stream
mStreamer.requestStream(new FKStreamer.RequestStreamCallback() { 
  public void done(@Nullable FKStream stream, @Nullable FKError error) {
    // 4. start streaming on firekast
    mStreamer.startStreaming(stream, new MyFKStreamingCallback());

The javascript SDK currently only supports live and vod content playback, not publishing.

This is all you need to do to live stream your front camera πŸ‘‰

First, you must request for a stream and then, call start streaming method whenever your User decides to.

Live stream on social networks simultaneously

let fbLive = FKOutput.facebook(accessToken: "YOUR_FACEBOOK_TOKEN")
let ytLive = "YOUR_YOUTUBE_TOKEN", title: "Awesome title")

streamer.requestStream(outputs: [fbLive, ytLive]) { (stream, error) in // 3. create a stream specifying outputs
    streamer.startStreaming(on: stream, delegate: self) // 4. start streaming on facebook, youtube and firekast
FKOutput facebook = FKOutput.facebook("YOUR_TOKEN_FACEBOOK", null);
FKOutput youtube ="YOUR_TOKEN_YOUTUBE", "Awesome title", null);

List outputs = new ArrayList<>();

// 3. create a stream specifying outputs
mStreamer.requestStream(outputs, new MyFKRequestStreamCallback());

Firekast allows to push your stream to several live streaming platform, such as Facebook or Youtube, simultaneously.

Access camera features

camera.position = .back // open back camera

camera.isMicrophoneEnabled = false // mute microphone

if camera.isFlashAvailable {
    camera.isFlashEnabled = true // turn flash on if available for the current camera
mCamera.switchToPosition(Position.BACK); // open back camera

mCamera.setMicrophoneEnabled(false); // mute microphone

if (mCamera.isFlashAvailable()) {
    mCamera.setFlashEnabled(true); // turn flash on if available for the current camera

Adding camera often leads to boilerplate codes, especially on Android where you must pay attention on your Activity or Fragment lifecycle.

Our SDK manages everything for you and provides simple interface to interact with commonly used features.

Watch live or replay as VOD

let player = FKPlayer() // 1. initialize player myView) // 2. display player in myView
player.delegate = self

let stream = FKStream(withoutDataExceptStreamId: "STREAM_ID") // 3. play the video starting - in that example - from the beginning.
// 1. add the player view in your layout
    android:layout_height="110dp" />

// 2. get the player from the view
mPlayer = mPlayerView.getPlayer();
mPlayer.setCallback(new MyPlayerCallback());

// 3. play the stream starting - in that example - from the beginning.
FKStream stream = FKStream.newEmptyInstance("STREAM_ID");

The player wraps around clappr.

<div id="player"></div>
    api_key: 'YOUR_API_KEY'
  const player = new Firekast.Player({
    parent_id:   '#player',
    stream_id:   'THE_STREAM_ID'

The player will figure out whether the stream is live or vod and will adapt the player UI accordingly.

SDK | Stream

Our APIs can be used on your backend to list your streams and manage your applications.

Contact us to discuss your needs.

A stream describes one video content. A stream is unique and is associated to an application.


This is the unique id of the object, see streamId. It is assigned when the Stream object is created.


During its life time, a stream goes though different states:

Stream's lifecycle can be either:

SDK | Streamer

The javascript SDK currently only supports live and vod content playback, not publishing.

The streamer handles the stream creation and let you stream on your application.

Create streams

mStreamer.requestStream(new MyFKRequestStreamCallback());

Before being able to start streaming, you must first create a stream. This will create a stream on Firekast server.

This newly created stream is immediatly visible in your dashboard.

Start and stop streaming

Start streaming

streamer.startStreaming(on: stream, delegate: self)
mStreamer.startStreaming(stream, new MyFKStreamingCallback());

Stop streaming


Once you have created a stream, you can start streaming whenever your User is ready.

Events while streaming

func streamer(_ streamer: FKStreamer, willStart stream: FKStream?, unless error: NSError?) {}
func streamer(_ streamer: FKStreamer, didBecomeLive stream: FKStream) {}
func streamer(_ streamer: FKStreamer, didStop stream: FKStream?, error: NSError?) {}
func streamer(_ streamer: FKStreamer, networkQualityDidUpdate rating: Float) {}
private class MyStreamingCallback implements FKStreamer.StreamingCallback {
  public void onSteamWillStartUnless(@Nullable FKStream stream, @Nullable FKError error) {}

  public void onStreamDidBecomeLive(@NonNullable FKStream stream) {}

  public void onStreamDidStop(@Nullable FKStream stream, FKError error) {}

  public void onStreamingUpdateAvailable(boolean lag) {}

When start streaming you might want to adapt your UI depending on events. You will be notified whether the streaming starts properly, stops normally or prematurely, and streaming conditions.

Restream social

streamer.requestStream(outputs: [])
mStreamer.requestStream(listOfOutputs, new MyFKRequestStreamCallback());

Firekast lets you push your live stream to several live streaming platform, such as Facebook or Youtube, simultaneously.

If you want to repush on social networks, you must provide corresponding information so the server could create a special stream.

Test bandwidth

First, use testBandwidth method to start streaming on a test stream (content is not recorded).

let testDuration: TimeInterval = 10
streamer.testBandwidth(duration: testDuration, delegate: self)
long testDuration = 15000;
mStreamer.testBandwidth(testDuration, this);

Then, watch FKStreamerDelegate and average rating values to estimate whether User streaming condition is good enough.

Then, watch FKStreamer.Callback and count how often lag is `true`. A lag is fired each time the SDK encounters difficulty to send a frame, meaning bad network conditions.

func streamer(_ streamer: FKStreamer, networkQualityDidUpdate rating: Float) {
    // rating from 0 (bad) to 1 (excellent network conditions)
public void onStreamingUpdateAvailable(boolean lag) {
  // check for lag == true occurences. Too often is bad.

Call testBandwidth method to simulate live streaming and estimate User's current bandwidth quality by watching streamer callback.

What's behind the scene?

This method puts User in real streaming conditions by starting streaming camera frames and audio to Firekast servers but nothing is actually recorded.

SDK | Player

The player lets you play any stream of your current application. Whether the stream is live or VOD, the player will figure it out and adapt its UI.


override func viewDidLoad() {
  player = FKPlayer()
  player.delegate = self playerContainerView)

The player is based on ExoPlayer and is wrapped into a simple view.

// In your layout:

  android:layout_width="match parent" 
  android:layout_height="110dp" />

// Then in your code:

mPlayerView = (FKPlayerView) findViewById(;
mPlayer = mPlayerView.getPlayer();

The player wraps around clappr.

<div id="player"></div>
    api_key: 'YOUR_API_KEY'
  const player = new Firekast.Player({
    parent_id:   '#player',
    stream_id:   'THE_STREAM_ID'

For each platform, we wrap the most common player so we expose only methods that count.

Play and stop

let stream = FKStream(withoutDataExceptStreamId: "STREAM_ID")
// import CoreMedia CMTime(seconds: 30, preferredTimescale: 1))
FKStream stream = FKStream.newEmptyInstance("THE_STREAM_ID");
player.on('ready', () => {;

The following methods are also available.


The player aims to be very simple.

Play a stream. The player will fetch the stream (if necessary) and start playing right away.

The playback controller UI automatically adapts whether the player is playing a live or VOD stream.

Once playing, video can be paused and resumed programmatically if needed.

Use seek to set the current playback time to a specified time.

Listen for player events

func player(_ player: FKPlayer, stateDidChanged state: FKPlayer.State) {}
func player(_ player: FKPlayer, videoDurationIsAvailable duration: TimeInterval) {}
func player(_ player: FKPlayer, willPlay stream: FKStream, unless error: NSError?) {}
mPlayer.setCallback(new FKPlayer.Callback() {
  public void onPlayerWillPlay(@NonNull FKStream stream, @Nullable FKError error) {}
  public void onPlayerStateChanged(@NonNull FKPlayer.State state) {}
const events = [

events.forEach( event => {
  player.on('ready', () => console.log(`Player emitted ${event}`));

player.on('ready', () =>;

You may want to listen for player callback so you can adapt adapt your UI accordingly. Indeed, since the stream is fetched internally to determine whether its live, vod, etc... the request can fail. There is no retry strategy so you may notify your user about the failure.

UI Customization

player.videoGravity = .resizeAspectFill
player.showPlaybackControls = false
mPlayer.setShowPlaybackControls(true); // default is true
mPlayer.setPlaybackControlsMargins(...); // default is 8dp
mPlayer.setPlaybackControlsBackground(R.drawable.my_player_controls_background); // default is a 8dp rounded semi-transparent black rectangle
const player = new Firekast.Player({
  clappr_config: {
    mediacontrol: { seekbar: "#E113D3", buttons: "#66B2FF" }

We provide basic customization of the playback controls UI.

Note that AVPlayerViewController provides very little control over the UI. We only wrapped what we found useful.

Please let us know if you need more control over the player UI.

Release Notes

Follow on the right panel what's new in releases.


Built with Swift 4.2.1 (Xcode 10.1).
* Abality to disable video capture while streaming with isVideoCaptureEnabled.
* Renaming isMicrophoneEnabled into isAudioCaptureEnabled.


Built with Swift 4.2.1 (Xcode 10.1).
* Replace internal use of MPMoviePlayerController (deprecated) with AVPlayerViewController. Implementation changes slightly: 
  * FKPlayerDelegate is now set to FKPlayer and no more passed through  
  * Show or hide native playback controls using FKPlayer.showPlaybackControls().
  * While playing, control programmatically the playback with FKPlayer.pause(), FKPlayer.resume() or
  * Get the current playback position with FKPlayer.currentTime.
  * ScalingMode becomes FKPlayer.VideoGravity.


Build with Swift 4.2 (Xcode 10).
* AppStore distribution bug fix.
* Framework includes bitcode.


Build with Swift 4.2 (Xcode 10).
* Add FKStreamerDelegate.streamer(_:didBecomeLive:) that notifies as soon as the stream is LIVE on Firekast Servers, meaning the stream is broadcast and VOD is getting recorded.


Build with Swift 4.2 (Xcode 10).
* Support Swift 4.2
* FKPlayer supports controlStyle and scaleMode options


Build with Swift 4.1.2 (Xcode 9.4.1).
* Call capture() on camera to get a snapshot of the camera preview


Build with Swift 4.1.2 (Xcode 9.4.1).
* Optimizes streaming for portrait or orientation 


Build with Swift 4.1.2 (Xcode 9.4.1).
What's new:
* Objective-C retro-compatible
* FKError replaced by NSError for Objective-C retro-compatibility
* NSError extension method: fk() to convert NSError into FKError 


Built with Swift 4.1 (Xcode 9.3).
What's new:
* Minor fixes


Built with Swift 4.0.3 (Xcode 9.2).
What's new:
* 100% documented.
* Refactoring, Streamer and Player, functions and parameters should be more straight forward.
* Live stream on **Facebook** and/or **Youtube** and Firekast simultaneous. See LiveStreamingPlatform.
* Use **camera features** by enabling torch, microphone, choosing your device's camera. See Camera.


Built with Swift 3.1
First release of FirekastStreamer and FirekastPlayer to stream and play video with its streamId.


* Abality to disable video capture while streaming with setVideoCaptureEnabled.
* Renaming setMicrophoneEnabled into setAudioCaptureEnabled.
* Fix FKPlayer.Callback#onPlayerWillPlay(FKStream, FKError) that used to be called with error null when reaching the end of a live stream.


* FKPlayer refactoring. What's changed:
   * Use play(FKStream stream, long at) to start playing the given stream at a specific time.
   * While playing, use pause() and resume().
   * Call getCurrentPosition() to get the current playback position in time.
   * Call getState() to retrieve the current player state and setCallback(FKPlayer.Callback callback) to track events.
   * Call setPlaybackConstrolsMargins and setPlaybackControlsBackground to customize the playback controls UI.
   * Finally, call release() when the player is no longer required.


* Returns the player's playback position, in milliseconds.
* Bug fixes


* Add FKPlayerView.Callback#onPlayerStateChanged(boolean playWhenReady, int playbackState) callback to notify of player's state changes.


* Add FKStreamer.StreamingCallback#onStreamDidBecomeLive(@NonNull FKStream stream) callback to notify as soon as flagged LIVE on Firekast Servers, meaning the stream is actually live.


* Add support for emulators (Android Virtual Devices) πŸŽ‰. Apps embedding the SDK can run on AVD but note that streaming is only possible for AVD with API 23 and above.


* ExoPlayer`'s PlayerView accessor available in FKPlayerView`


* Specify ExoPlayer dependency is not required anymore in dependencies


* HTTP request bug fix.


What's new:
* Fix aspect ratio issue.
* Fix camera position issue in FKCameraFragment.Builder.
* Retrieve FKStreamer in FKCamera ready callback. 


What's new:
* 100% documented.
* Refactoring, FKStreamer and FKPlayerView, functions and parameters should be more straight forward.
* Introducing FKStream object with its stream id, state and more. 
* Live stream on **Facebook** and/or **Youtube** and Firekast simultaneous. See FKOutput.
* Use **camera features** by enabling torch, microphone, choosing your device's camera. See FKCamera.


First release.


Minor bugfix.
Update player engine.


Inital release.
Play live and VOD videos on your website.