Skip to content

Commit

Permalink
Added recordrtc@5.3.5 May fixed #127
Browse files Browse the repository at this point in the history
  • Loading branch information
muaz-khan committed May 6, 2016
1 parent 4e6839c commit 0ecec90
Show file tree
Hide file tree
Showing 10 changed files with 250 additions and 67 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Expand Up @@ -3,8 +3,10 @@ node_js:
- "0.11"
install: npm install
before_script:
- npm install grunt-cli
- npm install grunt
- npm install grunt-cli@0.1.13 -g
- npm install grunt@0.4.5
- grunt
after_failure: npm install && grunt
matrix:
fast_finish: true

1 change: 1 addition & 0 deletions Gruntfile.js
Expand Up @@ -26,6 +26,7 @@ module.exports = function(grunt) {
'dev/RecordRTC-Configuration.js',
'dev/GetRecorderType.js',
'dev/MRecordRTC.js',
'dev/amd.js',
'dev/Cross-Browser-Declarations.js',
'dev/Storage.js',
'dev/isMediaRecorderCompatible.js',
Expand Down
81 changes: 52 additions & 29 deletions README.md
Expand Up @@ -61,60 +61,83 @@ You can also try a chrome extension for screen recording:

* https://chrome.google.com/webstore/detail/recordrtc/ndcljioonkecdnaaihodjgiliohngojp

## How to link?
# How to link?

## [NPM](https://www.npmjs.com/package/recordrtc) install

```
npm install recordrtc
# you can use with "require" (browserify/nodejs)
var RecordRTC = require('recordrtc');
var recorder = RecordRTC(mediaStream, { type: 'audio'});
```
or using [Bower](http://bower.io):
var recorder = RecordRTC({}, {
type: 'video',
recorderType: RecordRTC.WhammyRecorder
});
console.log('\n--------\nRecordRTC\n--------\n');
console.log(recorder);
```
bower install recordrtc
console.log('\n--------\nstartRecording\n--------\n');
recorder.startRecording();
console.log('\n--------\nprocess.exit()\n--------\n');
process.exit()
```

To use it:
* https://tonicdev.com/npm/recordrtc

```html
<script src="./node_modules/recordrtc/RecordRTC.js"></script>
Here is how to use `require`:

<!-- or -->
<script src="https://cdn.WebRTC-Experiment.com/RecordRTC.js"></script>
```javascript
var RecordRTC = require('recordrtc');
var Whammy = RecordRTC.Whammy;
var WhammyRecorder = RecordRTC.WhammyRecorder;
var StereoAudioRecorder = RecordRTC.StereoAudioRecorder;
// and so on

<!-- or -->
<script src="https://www.WebRTC-Experiment.com/RecordRTC.js"></script>
var video = new Whammy.Video(100);
var recorder = new StereoAudioRecorder(stream, options);
```

It is suggested to link specific release:
```html
<!-- link npm package scripts -->
<script src="./node_modules/recordrtc/RecordRTC.js"></script>
```

* https://github.com/muaz-khan/RecordRTC/releases
There are some other NPM packages regarding RecordRTC:

* [https://www.npmjs.org/search?q=RecordRTC](https://www.npmjs.org/search?q=RecordRTC)

E.g.
## [bower](http://bower.io) install

```
bower install recordrtc
```

```html
<!-- use 5.2.6 or any other version -->
<script src="https://github.com/muaz-khan/RecordRTC/releases/download/5.3.3/RecordRTC.js"></script>
<!-- link bower package scripts -->
<script src="./bower_components/recordrtc/RecordRTC.js"></script>
```

There are some other NPM packages regarding RecordRTC:
## CDN

* [https://www.npmjs.org/search?q=RecordRTC](https://www.npmjs.org/search?q=RecordRTC)
```html
<!-- CDN -->
<script src="https://cdn.WebRTC-Experiment.com/RecordRTC.js"></script>

Here is how to use `require`:
<!-- non-CDN -->
<script src="https://www.WebRTC-Experiment.com/RecordRTC.js"></script>
```

```javascript
var RecordRTC = require('recordrtc');
var Whammy = RecordRTC.Whammy;
var WhammyRecorder = RecordRTC.WhammyRecorder;
var StereoAudioRecorder = RecordRTC.StereoAudioRecorder;
// and so on
## Releases

var video = new Whammy.Video(100);
var recorder = new StereoAudioRecorder(stream, options);
You can even link specific [releases](https://github.com/muaz-khan/RecordRTC/releases):

```html
<!-- use 5.3.5 or any other version -->
<script src="https://github.com/muaz-khan/RecordRTC/releases/download/5.3.5/RecordRTC.js"></script>
```

## How to capture stream?
Expand Down
100 changes: 85 additions & 15 deletions RecordRTC.js
@@ -1,6 +1,6 @@
'use strict';

// Last time updated: 2016-05-03 8:19:31 AM UTC
// Last time updated: 2016-05-06 5:21:33 PM UTC

// Open-Sourced: https://github.com/muaz-khan/RecordRTC

Expand Down Expand Up @@ -1167,21 +1167,95 @@ if (typeof RecordRTC !== 'undefined') {
RecordRTC.MRecordRTC = MRecordRTC;
}

// _____________________________
// Cross-Browser-Declarations.js
var browserFakeUserAgent = 'Fake/5.0 (FakeOS) AppleWebKit/123 (KHTML, like Gecko) Fake/12.3.4567.89 Fake/123.45';

// animation-frame used in WebM recording
(function(that) {
if (!that) {
return;
}

if (typeof window !== 'undefined') {
return;
}

if (typeof global === 'undefined') {
return;
}

if (typeof window === 'undefined' && typeof global !== 'undefined') {
global.navigator = {
userAgent: ''
userAgent: browserFakeUserAgent,
getUserMedia: function() {}
};

if (!global.console) {
global.console = {};
}

if (typeof global.console.debug === 'undefined') {
global.console.debug = global.console.info = global.console.error = global.console.log = global.console.log || function() {
console.log(arguments);
};
}

if (typeof document === 'undefined') {
/*global document:true */
that.document = {};

document.createElement = document.captureStream = document.mozCaptureStream = function() {
var obj = {
getContext: function() {
return obj;
},
play: function() {},
pause: function() {},
drawImage: function() {},
toDataURL: function() {
return '';
}
};
return obj;
};

that.HTMLVideoElement = function() {};
}

if (typeof location === 'undefined') {
/*global location:true */
that.location = {
protocol: 'file:',
href: '',
hash: ''
};
}

if (typeof screen === 'undefined') {
/*global screen:true */
that.screen = {
width: 0,
height: 0
};
}

if (typeof URL === 'undefined') {
/*global screen:true */
that.URL = {
createObjectURL: function() {
return '';
},
revokeObjectURL: function() {
return '';
}
};
}

/*global window:true */
var window = global;
} else if (typeof window === 'undefined') {
// window = this;
}
that.window = global;
})(typeof global !== 'undefined' ? global : null);

// _____________________________
// Cross-Browser-Declarations.js

// animation-frame used in WebM recording

/*jshint -W079 */
var requestAnimationFrame = window.requestAnimationFrame;
Expand Down Expand Up @@ -1234,18 +1308,14 @@ if (typeof URL === 'undefined' && typeof webkitURL !== 'undefined') {
URL = webkitURL;
}

if (typeof navigator !== 'undefined') {
if (typeof navigator !== 'undefined') { // maybe window.navigator?
if (typeof navigator.webkitGetUserMedia !== 'undefined') {
navigator.getUserMedia = navigator.webkitGetUserMedia;
}

if (typeof navigator.mozGetUserMedia !== 'undefined') {
navigator.getUserMedia = navigator.mozGetUserMedia;
}
} else {
// if you're using NPM or solutions where "navigator" is NOT available,
// just define it globally before loading RecordRTC.js script.
throw 'Please make sure to define a global variable named as "navigator"';
}

var isEdge = navigator.userAgent.indexOf('Edge') !== -1 && (!!navigator.msSaveBlob || !!navigator.msSaveOrOpenBlob);
Expand Down
4 changes: 2 additions & 2 deletions RecordRTC.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions bower.json
@@ -1,6 +1,6 @@
{
"name": "recordrtc",
"version": "5.3.4",
"version": "5.3.5",
"authors": [
{
"name": "Muaz Khan",
Expand All @@ -13,7 +13,7 @@
"type": "git",
"url": "https://github.com/muaz-khan/RecordRTC.git"
},
"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.",
"description": "RecordRTC is a JavaScript library can be used to record WebRTC audio/video media streams.",
"main": "RecordRTC.js",
"keywords": [
"webrtc",
Expand Down
17 changes: 1 addition & 16 deletions dev/Cross-Browser-Declarations.js
Expand Up @@ -3,17 +3,6 @@

// animation-frame used in WebM recording

if (typeof window === 'undefined' && typeof global !== 'undefined') {
global.navigator = {
userAgent: ''
};

/*global window:true */
var window = global;
} else if (typeof window === 'undefined') {
// window = this;
}

/*jshint -W079 */
var requestAnimationFrame = window.requestAnimationFrame;
if (typeof requestAnimationFrame === 'undefined') {
Expand Down Expand Up @@ -65,18 +54,14 @@ if (typeof URL === 'undefined' && typeof webkitURL !== 'undefined') {
URL = webkitURL;
}

if (typeof navigator !== 'undefined') {
if (typeof navigator !== 'undefined') { // maybe window.navigator?
if (typeof navigator.webkitGetUserMedia !== 'undefined') {
navigator.getUserMedia = navigator.webkitGetUserMedia;
}

if (typeof navigator.mozGetUserMedia !== 'undefined') {
navigator.getUserMedia = navigator.mozGetUserMedia;
}
} else {
// if you're using NPM or solutions where "navigator" is NOT available,
// just define it globally before loading RecordRTC.js script.
throw 'Please make sure to define a global variable named as "navigator"';
}

var isEdge = navigator.userAgent.indexOf('Edge') !== -1 && (!!navigator.msSaveBlob || !!navigator.msSaveOrOpenBlob);
Expand Down

0 comments on commit 0ecec90

Please sign in to comment.