{"name":"recordrtc","preferGlobal":false,"version":"5.3.3","author":{"name":"Muaz Khan","email":"muazkh@gmail.com","url":"http://www.muazkhan.com/"},"description":"RecordRTC is a server-less (entire client-side) JavaScript library can be used to record WebRTC audio/video media streams. It supports cross-browser audio/video recording.","scripts":{"start":"node RecordRTC.js"},"main":"./RecordRTC.js","repository":{"type":"git","url":"git+https://github.com/muaz-khan/RecordRTC.git"},"keywords":["webrtc","recordrtc","audio-recording","video-recording","gif-recording","audio/video recording"],"analyze":false,"license":"MIT","bugs":{"url":"https://github.com/muaz-khan/RecordRTC/issues","email":"muazkh@gmail.com"},"homepage":"http://RecordRTC.org/","_id":"recordrtc@5.3.3","_from":".","_shasum":"cdfcf410b525d4bc21fb26034ec7488d98ca5c2f","_npmVersion":"2.14.2","_nodeVersion":"0.12.7","_npmUser":{"name":"muaz-khan","email":"muazkh@gmail.com"},"dist":{"shasum":"cdfcf410b525d4bc21fb26034ec7488d98ca5c2f","tarball":"http://registry-npm.ywwl.com/recordrtc/download/recordrtc-5.3.3.tgz","integrity":"sha512-sNH8FZMPR8BsjUcQdXlyrm+CGfVKBd9i6JNZWcFujLCj9b1vvsh6VaTYGAKLfeqHRBNvfcx3nucoYy6Dx28U7A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIjjuIE3saiFZSkWrwU7uQZIsrQW1wlC4WaDjspikWVAIgIfQDCCW7u3EJDX04i5y4oqwt6UMX3AqPZnbvtOIMeJE="}],"size":51994,"noattachment":false,"key":"/recordrtc/-/recordrtc-5.3.3.tgz"},"maintainers":[{"name":"muaz-khan","email":"muazkh@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/recordrtc-5.3.3.tgz_1460822095573_0.32030944828875363"},"directories":{},"deprecated":"Use v5.5.0 or higher to fix createObjectURL/srcObjec issues","readme":"# RecordRTC.js | [Live Demo](https://www.webrtc-experiment.com/RecordRTC/)\r\n\r\n**WebRTC JavaScript Library for Audio+Video+Screen+Canvas (2D+3D animation) Recording**\r\n\r\n[Chrome Extension](https://github.com/muaz-khan/Chrome-Extensions/tree/master/screen-recording) or [Dozens of Simple-Demos](https://www.webrtc-experiment.com/RecordRTC/simple-demos/) and [it is Open-Sourced](https://github.com/muaz-khan/RecordRTC) and has [API documentation](https://recordrtc.org/)\r\n\r\n[![npm](https://img.shields.io/npm/v/recordrtc.svg)](https://npmjs.org/package/recordrtc) [![downloads](https://img.shields.io/npm/dm/recordrtc.svg)](https://npmjs.org/package/recordrtc) [![Build Status: Linux](https://travis-ci.org/muaz-khan/RecordRTC.png?branch=master)](https://travis-ci.org/muaz-khan/RecordRTC)\r\n\r\n**A demo using promises:**\r\n\r\n```javascript\r\nlet stream = await navigator.mediaDevices.getUserMedia({video: true, audio: true});\r\nlet recorder = new RecordRTCPromisesHandler(stream, {\r\n    type: 'video'\r\n});\r\nrecorder.startRecording();\r\n\r\nconst sleep = m => new Promise(r => setTimeout(r, m));\r\nawait sleep(3000);\r\n\r\nawait recorder.stopRecording();\r\nlet blob = await recorder.getBlob();\r\ninvokeSaveAsDialog(blob);\r\n```\r\n\r\n**A demo using normal coding:**\r\n\r\n```javascript\r\nnavigator.mediaDevices.getUserMedia({\r\n    video: true,\r\n    audio: true\r\n}).then(async function(stream) {\r\n    let recorder = RecordRTC(stream, {\r\n        type: 'video'\r\n    });\r\n    recorder.startRecording();\r\n\r\n    const sleep = m => new Promise(r => setTimeout(r, m));\r\n    await sleep(3000);\r\n\r\n    recorder.stopRecording(function() {\r\n        let blob = recorder.getBlob();\r\n        invokeSaveAsDialog(blob);\r\n    });\r\n});\r\n```\r\n\r\n* [Watch a YouTube video presentation/tutorial](https://www.youtube.com/watch?v=YrLzTgdJ-Kg)\r\n\r\n## Browsers Support\r\n\r\n| Browser        | Operating System                    | Features               |\r\n| -------------  |-------------                        |---------------------   |\r\n| Google Chrome  | Windows + macOS + Ubuntu + Android  | audio + video + screen |\r\n| Firefox        | Windows + macOS + Ubuntu + Android  | audio + video + screen |\r\n| Opera          | Windows + macOS + Ubuntu + Android  | audio + video + screen |\r\n| Edge (new)     | Windows (7 or 8 or 10) and MacOSX   | audio + video + screen |\r\n| Safari         | macOS + iOS (iPhone/iPad)           | audio + video          |\r\n\r\n## Codecs Support\r\n\r\n| Browser       | Video               | Audio            |\r\n| ------------- |-------------        |-------------     |\r\n| Chrome        | VP8, VP9, H264, MKV | OPUS/VORBIS, PCM |\r\n| Opera         | VP8, VP9, H264, MKV | OPUS/VORBIS, PCM |\r\n| Firefox       | VP8, H264           | OPUS/VORBIS, PCM |\r\n| Safari        | VP8                 | OPUS/VORBIS, PCM |\r\n| Edge (new)    | VP8, VP9, H264, MKV | OPUS/VORBIS, PCM |\r\n\r\n\r\n## CDN\r\n\r\n```html\r\n<!-- recommended -->\r\n<script src=\"https://www.WebRTC-Experiment.com/RecordRTC.js\"></script>\r\n\r\n<!-- use 5.6.2 or any other version on cdnjs -->\r\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/RecordRTC/5.6.2/RecordRTC.js\"></script>\r\n\r\n<!-- NPM i.e. \"npm install recordrtc\" -->\r\n<script src=\"node_modules/recordrtc/RecordRTC.js\"></script>\r\n\r\n<!-- bower -->\r\n<script src=\"bower_components/recordrtc/RecordRTC.js\"></script>\r\n```\r\n\r\n## Configuration\r\n\r\n```javascript\r\nconst recorder = RecordRTC(stream, {\r\n     // audio, video, canvas, gif\r\n    type: 'video',\r\n\r\n    // audio/webm\r\n    // audio/webm;codecs=pcm\r\n    // video/mp4\r\n    // video/webm;codecs=vp9\r\n    // video/webm;codecs=vp8\r\n    // video/webm;codecs=h264\r\n    // video/x-matroska;codecs=avc1\r\n    // video/mpeg -- NOT supported by any browser, yet\r\n    // audio/wav\r\n    // audio/ogg  -- ONLY Firefox\r\n    // demo: simple-demos/isTypeSupported.html\r\n    mimeType: 'video/webm',\r\n\r\n    // MediaStreamRecorder, StereoAudioRecorder, WebAssemblyRecorder\r\n    // CanvasRecorder, GifRecorder, WhammyRecorder\r\n    recorderType: MediaStreamRecorder,\r\n\r\n    // disable logs\r\n    disableLogs: true,\r\n\r\n    // get intervals based blobs\r\n    // value in milliseconds\r\n    timeSlice: 1000,\r\n\r\n    // requires timeSlice above\r\n    // returns blob via callback function\r\n    ondataavailable: function(blob) {},\r\n\r\n    // auto stop recording if camera stops\r\n    checkForInactiveTracks: false,\r\n\r\n    // requires timeSlice above\r\n    onTimeStamp: function(timestamp) {},\r\n\r\n    // both for audio and video tracks\r\n    bitsPerSecond: 128000,\r\n\r\n    // only for audio track\r\n    // ignored when codecs=pcm\r\n    audioBitsPerSecond: 128000,\r\n\r\n    // only for video track\r\n    videoBitsPerSecond: 128000,\r\n\r\n    // used by CanvasRecorder and WhammyRecorder\r\n    // it is kind of a \"frameRate\"\r\n    frameInterval: 90,\r\n\r\n    // if you are recording multiple streams into single file\r\n    // this helps you see what is being recorded\r\n    previewStream: function(stream) {},\r\n\r\n    // used by CanvasRecorder and WhammyRecorder\r\n    // you can pass {width:640, height: 480} as well\r\n    video: HTMLVideoElement,\r\n\r\n    // used by CanvasRecorder and WhammyRecorder\r\n    canvas: {\r\n        width: 640,\r\n        height: 480\r\n    },\r\n\r\n    // used by StereoAudioRecorder\r\n    // the range 22050 to 96000.\r\n    sampleRate: 96000,\r\n\r\n    // used by StereoAudioRecorder\r\n    // the range 22050 to 96000.\r\n    // let us force 16khz recording:\r\n    desiredSampRate: 16000,\r\n\r\n    // used by StereoAudioRecorder\r\n    // Legal values are (256, 512, 1024, 2048, 4096, 8192, 16384).\r\n    bufferSize: 16384,\r\n\r\n    // used by StereoAudioRecorder\r\n    // 1 or 2\r\n    numberOfAudioChannels: 2,\r\n\r\n    // used by WebAssemblyRecorder\r\n    frameRate: 30,\r\n\r\n    // used by WebAssemblyRecorder\r\n    bitrate: 128000,\r\n\r\n    // used by MultiStreamRecorder - to access HTMLCanvasElement\r\n    elementClass: 'multi-streams-mixer'\r\n});\r\n```\r\n\r\n## MediaStream parameter\r\n\r\nMediaStream parameter accepts following values:\r\n\r\n```javascript\r\nlet recorder = RecordRTC(MediaStream || HTMLCanvasElement || HTMLVideoElement || HTMLElement, {});\r\n```\r\n\r\n## API\r\n\r\n```javascript\r\nRecordRTC.prototype = {\r\n    // start the recording\r\n    startRecording: function() {},\r\n\r\n    // stop the recording\r\n    // getBlob inside callback function\r\n    stopRecording: function(blobURL) {},\r\n\r\n    // pause the recording\r\n    pauseRecording: function() {},\r\n\r\n    // resume the recording\r\n    resumeRecording: function() {},\r\n\r\n    // auto stop recording after specific duration\r\n    setRecordingDuration: function() {},\r\n\r\n    // reset recorder states and remove the data\r\n    reset: function() {},\r\n\r\n    // invoke save as dialog\r\n    save: function(fileName) {},\r\n\r\n    // returns recorded Blob\r\n    getBlob: function() {},\r\n\r\n    // returns Blob-URL\r\n    toURL: function() {},\r\n\r\n    // returns Data-URL\r\n    getDataURL: function(dataURL) {},\r\n\r\n    // returns internal recorder\r\n    getInternalRecorder: function() {},\r\n\r\n    // initialize the recorder [deprecated]\r\n    initRecorder: function() {},\r\n\r\n    // fired if recorder's state changes\r\n    onStateChanged: function(state) {},\r\n\r\n    // write recorded blob into indexed-db storage\r\n    writeToDisk: function(audio: Blob, video: Blob, gif: Blob) {},\r\n\r\n    // get recorded blob from indexded-db storage\r\n    getFromDisk: function(dataURL, type) {},\r\n\r\n    // [deprecated]\r\n    setAdvertisementArray: function([webp1, webp2]) {},\r\n\r\n    // [deprecated] clear recorded data\r\n    clearRecordedData: function() {},\r\n\r\n    // clear memory; clear everything\r\n    destroy: function() {},\r\n\r\n    // get recorder's state\r\n    getState: function() {},\r\n\r\n    // [readonly] property: recorder's state\r\n    state: string,\r\n\r\n    // recorded blob [readonly] property\r\n    blob: Blob,\r\n\r\n    // [readonly] array buffer; useful only for StereoAudioRecorder\r\n    buffer: ArrayBuffer,\r\n\r\n    // RecordRTC version [readonly]\r\n    version: string,\r\n\r\n    // [readonly] useful only for StereoAudioRecorder\r\n    bufferSize: integer,\r\n\r\n    // [readonly] useful only for StereoAudioRecorder\r\n    sampleRate: integer\r\n}\r\n```\r\n\r\nPlease check documentation here: [https://recordrtc.org/](https://recordrtc.org/)\r\n\r\n## Global APIs\r\n\r\n```javascript\r\n// \"bytesToSize\" returns human-readable size (in MB or GB)\r\nlet size = bytesToSize(recorder.getBlob().size);\r\n\r\n// to fix video seeking issues\r\ngetSeekableBlob(recorder.getBlob(), function(seekableBlob) {\r\n    invokeSaveAsDialog(seekableBlob);\r\n});\r\n\r\n// this function invokes save-as dialog\r\ninvokeSaveAsDialog(recorder.getBlob(), 'video.webm');\r\n\r\n// use these global variables to detect browser\r\nlet browserInfo = {isSafari, isChrome, isFirefox, isEdge, isOpera};\r\n\r\n// use this to store blobs into IndexedDB storage\r\nDiskStorage = {\r\n    init: function() {},\r\n    Fetch: function({audioBlob: Blob, videoBlob: Blob, gifBlob: Blob}) {},\r\n    Store: function({audioBlob: Blob, videoBlob: Blob, gifBlob: Blob}) {},\r\n    onError: function() {},\r\n    dataStoreName: function() {}\r\n};\r\n```\r\n\r\n## How to fix echo issues?\r\n\r\n1. Set `<video>.muted=true` and `<video>.volume=0`\r\n2. Pass `audio: {echoCancellation:true}` on getUserMedia\r\n\r\n## Wiki\r\n\r\n* [https://github.com/muaz-khan/RecordRTC/wiki](https://github.com/muaz-khan/RecordRTC/wiki)\r\n\r\n## Releases\r\n\r\n* [https://github.com/muaz-khan/RecordRTC/releases](https://github.com/muaz-khan/RecordRTC/releases)\r\n\r\n## Unit Tests\r\n\r\n* [https://travis-ci.org/muaz-khan/RecordRTC](https://travis-ci.org/muaz-khan/RecordRTC)\r\n\r\n## Issues/Questions?\r\n\r\n* Github: [https://github.com/muaz-khan/RecordRTC/issues](https://github.com/muaz-khan/RecordRTC/issues)\r\n* Disqus: [https://www.webrtc-experiment.com/RecordRTC/#ask](https://www.webrtc-experiment.com/RecordRTC/#ask)\r\n* Stackoverflow: [http://stackoverflow.com/questions/tagged/recordrtc](http://stackoverflow.com/questions/tagged/recordrtc)\r\n* Email: `muazkh => gmail`\r\n\r\n## Credits\r\n\r\n| Library     | Usage |\r\n| ------------- |------------|\r\n| [Recorderjs](https://github.com/mattdiamond/Recorderjs) | StereoAudioRecorder |\r\n| [webm-wasm](https://github.com/GoogleChromeLabs/webm-wasm) | WebAssemblyRecorder |\r\n| [jsGif](https://github.com/antimatter15/jsgif) | GifRecorder |\r\n| [whammy](https://github.com/antimatter15/whammy) | WhammyRecorder |\r\n\r\n## Spec & Reference\r\n\r\n1. [MediaRecorder API](https://w3c.github.io/mediacapture-record/MediaRecorder.html)\r\n2. [Web Audio API](https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html)\r\n3. [Canvas2D](http://www.w3.org/html/wg/drafts/2dcontext/html5_canvas/)\r\n4. [Media Capture and Streams](http://www.w3.org/TR/mediacapture-streams/)\r\n\r\n## Who is using RecordRTC?\r\n\r\n| Framework     | Github               | Article            |\r\n| ------------- |-------------        |-------------     |\r\n| Angular2      | [github](https://github.com/ShankarSumanth/Angular2-RecordRTC) | [article](https://medium.com/@SumanthShankar/integrate-recordrtc-with-angular-2-typescript-942c9c4ca93f#.7x5yf2nr5) |\r\n| React.js       | [github](https://github.com/szwang/recordrtc-react) | [article](http://suzannewang.com/recordrtc/) |\r\n| Video.js      | [github](https://github.com/collab-project/videojs-record) | None |\r\n| Meteor        | [github](https://github.com/launchbricklabs/recordrtc-meteor-demo) | None |\r\n\r\n## License\r\n\r\n[RecordRTC.js](https://github.com/muaz-khan/RecordRTC) is released under [MIT license](https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE) . Copyright (c) [Muaz Khan](https://MuazKhan.com).\r\n","publish_time":1460822098229,"_cnpm_publish_time":1460822098229,"dist-tags":{"latest":"5.6.2"}}