Coder Social home page Coder Social logo

luckykat / cordova-replay Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kaelhem/cordova-replay

0.0 3.0 0.0 11 KB

Experimental plugin to enable use of the ReplayKit iOS framework

License: MIT License

Swift 77.43% Objective-C 0.24% JavaScript 22.32%

cordova-replay's Introduction

cordova-replay

Install

cordova plugin add cordova-replay

Description

This cordova plugin allows to use the ReplayKit framework in iOS. The ReplayKit is a new feature in iOS 9.0, that performs screen / microphone recording. With iOS 10, ReplayKit introduces live streaming as well.

The plugin is referenced by cordova.plugins.Replay.

Methods

- startRecording(isMicrophoneEnabled, successCallback, errorCallback)

  • isRecording [Bool]: does the microphone is enabled Left for legacy. Microphone is always on by default, the user will be prompted to enable microphone or not.
  • successCallback [Function]: callback triggered when succeed
  • errorCallback [Function]: callback triggered when failed

- stopRecording(successCallback, errorCallback)

  • successCallback [Function]: callback triggered when succeed
  • errorCallback [Function]: callback triggered when failed

- isRecording(successCallback, errorCallback)

  • successCallback [Function]: callback triggered when succeed, 1st parameter is true when recording
  • errorCallback [Function]: callback triggered when failed

- isAvailable(successCallback, errorCallback)

  • successCallback [Function]: callback triggered when succeed, 1st parameter is true if recording is available
  • errorCallback [Function]: callback triggered when failed

- startBroadcast(successCallback, errorCallback)

  • successCallback [Function]: callback triggered when succeed
  • errorCallback [Function]: callback triggered when failed

- stopBroadcast(successCallback, errorCallback)

  • successCallback [Function]: callback triggered when succeed
  • errorCallback [Function]: callback triggered when failed

- isBroadcasting(successCallback, errorCallback)

  • successCallback [Function]: callback triggered when succeed, 1st parameter is true when live streaming
  • errorCallback [Function]: callback triggered when failed

- isBroadcastAvailable(successCallback, errorCallback)

  • successCallback [Function]: callback triggered when succeed, 1st parameter is true simply if >iOS 10.0
  • errorCallback [Function]: callback triggered when failed

Usage sample

// start a screen+mic record, and stop it 5sec later

var isRecording = false;
function startRecord(enableMic) {
	cordova.plugins.Replay.startRecording(enableMic,
		function() {
   	 		isRecording = true;
   	 	}, function(err) {
    		console.log(err);
	    }
	);
};
function stopRecording = function() {
    cordova.plugins.Replay.stopRecording(
       	function() {
       		isRecording = false;
          	console.log('ok!');
        }, function(err) {
      		console.log(err);
        }
	);
}
startRecording(true);
setTimeout(function() {
	stopRecording();	
}, 5000)

Supported Platforms

  • iOS

Troubleshouting

  • be sure to target iOS 9.0 minimum
  • in case of error :
dyld: Library not loaded: @rpath/libswiftCore.dylib

maybe to will need to add @executable_path/Frameworks in the Build Settings > Runpath Search Paths of your xcode project.

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.