Skip to content

Commit

Permalink
Added recordrtc@5.3.1 Fixed GifRecorder issues. Fixed #119
Browse files Browse the repository at this point in the history
Now GifRecorder can record CanvasRenderingContext2D as well.
  • Loading branch information
muaz-khan committed Apr 15, 2016
1 parent 85613d0 commit 1551d95
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 14 deletions.
9 changes: 8 additions & 1 deletion README.md
Expand Up @@ -91,7 +91,7 @@ E.g.

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

There are some other NPM packages regarding RecordRTC:
Expand Down Expand Up @@ -734,6 +734,13 @@ The domain www.RecordRTC.org is open-sourced here:

* https://github.com/muaz-khan/RecordRTC/tree/gh-pages

## Issues/Questions?

* Stackoverflow: http://stackoverflow.com/questions/tagged/recordrtc
* Github: https://github.com/muaz-khan/RecordRTC/issues
* Disqus: https://www.webrtc-experiment.com/RecordRTC/#ask
* Email: muazkh@gmail.com

## License

[RecordRTC.js](https://github.com/muaz-khan/RecordRTC) is released under [MIT licence](https://www.webrtc-experiment.com/licence/) . Copyright (c) [Muaz Khan](http://www.MuazKhan.com).
13 changes: 9 additions & 4 deletions RecordRTC.js
@@ -1,6 +1,6 @@
'use strict';

// Last time updated: 2016-03-25 12:41:43 PM UTC
// Last time updated: 2016-04-15 3:06:46 PM UTC

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

Expand Down Expand Up @@ -1729,6 +1729,9 @@ function MediaStreamRecorder(mediaStream, config) {
}

if (isMediaStreamActive() === false) {
if (!config.disableLogs) {
console.log('MediaStream seems stopped.');
}
self.stop();
return;
}
Expand Down Expand Up @@ -2215,7 +2218,7 @@ function StereoAudioRecorder(mediaStream, config) {

if (isMediaStreamActive() === false) {
if (!config.disableLogs) {
console.error('MediaStream seems stopped.');
console.log('MediaStream seems stopped.');
}
jsAudioNode.disconnect();
recording = false;
Expand Down Expand Up @@ -3658,9 +3661,9 @@ function GifRecorder(mediaStream, config) {
// via: https://github.com/muaz-khan/WebRTC-Experiment/pull/316
// Tweak for Android Chrome
video.play();
}

context.drawImage(video, 0, 0, canvas.width, canvas.height);
context.drawImage(video, 0, 0, canvas.width, canvas.height);
}

if (config.onGifPreview) {
config.onGifPreview(canvas.toDataURL('image/png'));
Expand Down Expand Up @@ -3757,8 +3760,10 @@ function GifRecorder(mediaStream, config) {
if (isHTMLObject) {
if (mediaStream instanceof CanvasRenderingContext2D) {
context = mediaStream;
canvas = context.canvas;
} else if (mediaStream instanceof HTMLCanvasElement) {
context = mediaStream.getContext('2d');
canvas = mediaStream;
}
}

Expand Down
6 changes: 3 additions & 3 deletions RecordRTC.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "recordrtc",
"version": "5.3.0",
"version": "5.3.1",
"authors": [
{
"name": "Muaz Khan",
Expand Down
6 changes: 4 additions & 2 deletions dev/GifRecorder.js
Expand Up @@ -118,9 +118,9 @@ function GifRecorder(mediaStream, config) {
// via: https://github.com/muaz-khan/WebRTC-Experiment/pull/316
// Tweak for Android Chrome
video.play();
}

context.drawImage(video, 0, 0, canvas.width, canvas.height);
context.drawImage(video, 0, 0, canvas.width, canvas.height);
}

if (config.onGifPreview) {
config.onGifPreview(canvas.toDataURL('image/png'));
Expand Down Expand Up @@ -217,8 +217,10 @@ function GifRecorder(mediaStream, config) {
if (isHTMLObject) {
if (mediaStream instanceof CanvasRenderingContext2D) {
context = mediaStream;
canvas = context.canvas;
} else if (mediaStream instanceof HTMLCanvasElement) {
context = mediaStream.getContext('2d');
canvas = mediaStream;
}
}

Expand Down
3 changes: 3 additions & 0 deletions dev/MediaStreamRecorder.js
Expand Up @@ -304,6 +304,9 @@ function MediaStreamRecorder(mediaStream, config) {
}

if (isMediaStreamActive() === false) {
if (!config.disableLogs) {
console.log('MediaStream seems stopped.');
}
self.stop();
return;
}
Expand Down
2 changes: 1 addition & 1 deletion dev/StereoAudioRecorder.js
Expand Up @@ -476,7 +476,7 @@ function StereoAudioRecorder(mediaStream, config) {

if (isMediaStreamActive() === false) {
if (!config.disableLogs) {
console.error('MediaStream seems stopped.');
console.log('MediaStream seems stopped.');
}
jsAudioNode.disconnect();
recording = false;
Expand Down
2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -924,7 +924,7 @@ <h2 class="header" id="updates" style="color: red; padding-bottom: .1em;"><a hre
<div id="github-issues"></div>
</section>

<section class="experiment">
<section id="ask" class="experiment">
<h2 class="header" id="feedback">Feedback</h2>
<div>
<textarea id="message" style="border: 1px solid rgb(189, 189, 189); height: 8em; margin: .2em; outline: none; resize: vertical; width: 98%;" placeholder="Have any message? Suggestions or something went wrong?"></textarea>
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "recordrtc",
"preferGlobal": false,
"version": "5.3.0",
"version": "5.3.1",
"author": {
"name": "Muaz Khan",
"email": "muazkh@gmail.com",
Expand Down

0 comments on commit 1551d95

Please sign in to comment.