Giter Club home page Giter Club logo

castify-api-docs's Introduction

API Documentation and Demos for Screencastify API.

About

The Screencastify API allows users to share recordings with third-party Applications/Sites from within Screencastify or (optionally) control recording from the site.

Sharing from within Screencastify

Apps are shown as an additional upload target in Screencastify's share dialog.

Screencastify can also be configured to "Record for an App". This automatically shares all new recordings with the configured App. It's the responsibility of the App to handle and store such recordings. Record for App Flow Demo Video

This is a pure client-side API, recordings are passed to Apps as regular File objects (like from a file picker) locally.

Controlling recording form the site

The recording API allows to initiate and control record from a site. To get an idea how this works, try the In-Site Recorder Demo.

The resulting video is shared in the same way as recordings made with the "Record for an App" feature.

Getting started

  • Configure a new App in the API Console to get an AppId. If you only want to control recording from your App directly and don't want your App to appear as a share option inside Screencastify, leave the share Url empty.
  • Add the API library to your page:
<script src="https://www.screencastify.com/libs-api/castify-api.js"></script>
  • Set your AppId before using any other library function:
screencastify.setAppId(YOUR_APP_ID);
  • Check if the user has your App connected/added to Screencastify:
screencastify.isAppConnected().then(function(isConnected) {
  console.log('App is ' + (isConnected ? 'connected' : 'not connected'));
});
  • To connect your App, call screencastify.connectApp(); it returns a Promise that resolves on success. This opens a popup window, so only call this in event handlers. It takes care of installing Screencastify first, if it is not installed yet.

  • When a user shares a recording with an App, Screencastify opens the share URL configured for the App in a new tab and passes the shared file ids in a JSON-encoded state query parameter:

// Decode the 'state' query parameter yourself or use this helper:
screencastify.decodeStateQuery();
> {ids: ['shared-file-id']}
  • Retrive shared file from Screencastify:
screencastify.getFile('shared-file-id').then(function(fileInfo) {
  // fileInfo = {
  //   duration: 150.4,  // in seconds, undefined if unknown
  //   file: File,
  //   height: 600,  // undefined if unknown
  //   width: 800,  // undefined if unknown
  //   id: 'shared-file-id',
  //   title: 'Test Name'  // file title set by user
  //   payload: 'some string '  // string set with recorder.start()
  // };
});
  • Process file like any regular file upload.

See demos for working examples.

Handling shared files in a single tab.

By default Screencastify opens the configured share URL when a file is shared with an App. In some cases you might want to avoid having a separate tab opened each time a file is shared with your app, but handle the files in an already loaded instance of your App instead. This can be achieved by returning true from the onSharedFiles handler. In this case Screencastify will not open a new tab but focus your Apps' tab that is already loaded instead.

screencastify.onSharedFiles = function(fileIds) {
  // fileIds = ['shared-file-id'];
  // Return true (or a Promise that resolves to true) from this handler to
  // indicate that you handle the shared files here.
  return true;
}

Controlling recording

Initiating recording is only available for desktop recording mode (not for cam or tab recording).

var recorder = new screencastify.Recorder();
recorder.start({
  recordConfig: {  // optional
    captureSource: 'desktop',  // for window picker, use 'screen' for screen picker
    audio: {
      mic: true,
      system: false
    }
  },
  shareUrl: 'https://your page',  // URL of your page that handles shared files.
  payload: 'optional arbitrary string'  // Can be retrieved in share handler.
}).then(function() {
  // recording has been started
});

For more details, please refer to the API reference or in site recorder demo.

Pricing

This API can be used for free. For recordings made by users that did not purchase Screencastify, restrictions of Screencastify Lite apply (max recording length 10 min., branded videos).

Flat pricing

The restrictions of Screencastify Lite can be removed for a flat fee for all your users. Contact [email protected] for details.

Demos:

castify-api-docs's People

Contributors

schibum 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.