Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
muaz-khan committed Mar 3, 2017
1 parent 41c93ba commit cb3b807
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 15 deletions.
2 changes: 2 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ module.exports = function(grunt) {
webkitCancelAnimationFrame: true,
mozRequestAnimationFrame: true,
mozCancelAnimationFrame: true,
msRequestAnimationFrame: true,
msCancelAnimationFrame: true,
MediaStream: true,
webkitMediaStream: true,
html2canvas: true,
Expand Down
35 changes: 28 additions & 7 deletions RecordRTC.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Last time updated: 2017-03-01 11:03:24 AM UTC
// Last time updated: 2017-03-03 3:48:00 AM UTC

// ________________
// RecordRTC v5.4.1
Expand Down Expand Up @@ -1370,11 +1370,26 @@ if (typeof requestAnimationFrame === 'undefined') {
if (typeof webkitRequestAnimationFrame !== 'undefined') {
/*global requestAnimationFrame:true */
requestAnimationFrame = webkitRequestAnimationFrame;
}

if (typeof mozRequestAnimationFrame !== 'undefined') {
} else if (typeof mozRequestAnimationFrame !== 'undefined') {
/*global requestAnimationFrame:true */
requestAnimationFrame = mozRequestAnimationFrame;
} else if (typeof msRequestAnimationFrame !== 'undefined') {
/*global requestAnimationFrame:true */
requestAnimationFrame = msRequestAnimationFrame;
} else if (typeof requestAnimationFrame === 'undefined') {
// via: https://gist.github.com/paulirish/1579671
var lastTime = 0;

/*global requestAnimationFrame:true */
requestAnimationFrame = function(callback, element) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = setTimeout(function() {
callback(currTime + timeToCall);
}, timeToCall);
lastTime = currTime + timeToCall;
return id;
};
}
}

Expand All @@ -1384,11 +1399,17 @@ if (typeof cancelAnimationFrame === 'undefined') {
if (typeof webkitCancelAnimationFrame !== 'undefined') {
/*global cancelAnimationFrame:true */
cancelAnimationFrame = webkitCancelAnimationFrame;
}

if (typeof mozCancelAnimationFrame !== 'undefined') {
} else if (typeof mozCancelAnimationFrame !== 'undefined') {
/*global cancelAnimationFrame:true */
cancelAnimationFrame = mozCancelAnimationFrame;
} else if (typeof msCancelAnimationFrame !== 'undefined') {
/*global cancelAnimationFrame:true */
cancelAnimationFrame = msCancelAnimationFrame;
} else if (typeof cancelAnimationFrame === 'undefined') {
/*global cancelAnimationFrame:true */
cancelAnimationFrame = function(id) {
clearTimeout(id);
};
}
}

Expand Down
4 changes: 2 additions & 2 deletions RecordRTC.min.js

Large diffs are not rendered by default.

33 changes: 27 additions & 6 deletions dev/Cross-Browser-Declarations.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,26 @@ if (typeof requestAnimationFrame === 'undefined') {
if (typeof webkitRequestAnimationFrame !== 'undefined') {
/*global requestAnimationFrame:true */
requestAnimationFrame = webkitRequestAnimationFrame;
}

if (typeof mozRequestAnimationFrame !== 'undefined') {
} else if (typeof mozRequestAnimationFrame !== 'undefined') {
/*global requestAnimationFrame:true */
requestAnimationFrame = mozRequestAnimationFrame;
} else if (typeof msRequestAnimationFrame !== 'undefined') {
/*global requestAnimationFrame:true */
requestAnimationFrame = msRequestAnimationFrame;
} else if (typeof requestAnimationFrame === 'undefined') {
// via: https://gist.github.com/paulirish/1579671
var lastTime = 0;

/*global requestAnimationFrame:true */
requestAnimationFrame = function(callback, element) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = setTimeout(function() {
callback(currTime + timeToCall);
}, timeToCall);
lastTime = currTime + timeToCall;
return id;
};
}
}

Expand All @@ -23,11 +38,17 @@ if (typeof cancelAnimationFrame === 'undefined') {
if (typeof webkitCancelAnimationFrame !== 'undefined') {
/*global cancelAnimationFrame:true */
cancelAnimationFrame = webkitCancelAnimationFrame;
}

if (typeof mozCancelAnimationFrame !== 'undefined') {
} else if (typeof mozCancelAnimationFrame !== 'undefined') {
/*global cancelAnimationFrame:true */
cancelAnimationFrame = mozCancelAnimationFrame;
} else if (typeof msCancelAnimationFrame !== 'undefined') {
/*global cancelAnimationFrame:true */
cancelAnimationFrame = msCancelAnimationFrame;
} else if (typeof cancelAnimationFrame === 'undefined') {
/*global cancelAnimationFrame:true */
cancelAnimationFrame = function(id) {
clearTimeout(id);
};
}
}

Expand Down

0 comments on commit cb3b807

Please sign in to comment.