Permalink
Browse files

Fixed #471 Updated: RecordRTC, RTCMultiConnection, DetectRTC, DataCha…

…nnel, Canvas-Designer, Chrome-Extensions, Firefox-Extensions, getScreenId, FileBufferReader and Ffmpeg.js
  • Loading branch information...
muaz-khan committed Nov 29, 2016
1 parent c8e0e38 commit 3a423fe453872620cd3fd2a6f0dda4d014511fe1
Showing with 19,440 additions and 14,078 deletions.
  1. +5 −3 Canvas-Designer/Gruntfile.js
  2. +7 −6 Canvas-Designer/README.md
  3. +1 −1 Canvas-Designer/bower.json
  4. +58 −2 Canvas-Designer/dev/common.js
  5. +118 −1 Canvas-Designer/dev/decorator.js
  6. +5 −6 Canvas-Designer/dev/draw-helper.js
  7. +15 −2 Canvas-Designer/dev/events-handler.js
  8. +2 −0 Canvas-Designer/dev/file-selector.js
  9. +4 −48 Canvas-Designer/dev/marker-handler.js
  10. +14 −5 Canvas-Designer/dev/pencil-handler.js
  11. +1 −1 Canvas-Designer/dev/share-drawings.js
  12. +32 −0 Canvas-Designer/dev/zoom-handler.js
  13. +145 −68 Canvas-Designer/index.html
  14. +29 −26 Canvas-Designer/multiple.html
  15. +1 −1 Canvas-Designer/package.json
  16. +104 −45 Canvas-Designer/widget.html
  17. +2,100 −1,915 Canvas-Designer/widget.js
  18. +4 −4 Canvas-Designer/widget.min.js
  19. +2 −2 Chrome-Extensions/file-sharing/manifest.json
  20. +7,699 −9 Chrome-Extensions/file-sharing/rmc-files-handler.js
  21. +12 −0 Chrome-Extensions/screen-recording/README.md
  22. +235 −53 Chrome-Extensions/screen-recording/background.js
  23. +207 −63 Chrome-Extensions/screen-recording/content-script.js
  24. +53 −34 Chrome-Extensions/screen-recording/manifest.json
  25. +18 −1 Chrome-Extensions/screen-recording/options.html
  26. +26 −17 DetectRTC/DetectRTC.js
  27. +2 −2 DetectRTC/DetectRTC.min.js
  28. +14 −15 DetectRTC/dev/CheckDeviceSupport.js
  29. +11 −1 DetectRTC/dev/DetectRTC.js
  30. +506 −512 DetectRTC/index.html
  31. +397 −350 FileBufferReader/FileBufferReader.js
  32. +15 −0 FileBufferReader/FileBufferReader.min.js
  33. +120 −0 FileBufferReader/Gruntfile.js
  34. +40 −16 FileBufferReader/README.md
  35. +61 −0 FileBufferReader/bower.json
  36. +68 −12 FileBufferReader/demo/PeerConnection.js
  37. +466 −178 FileBufferReader/demo/PeerUI.js
  38. +1,065 −0 FileBufferReader/demo/circular-progress-bar.css
  39. +0 −187 FileBufferReader/demo/index.html
  40. +145 −0 FileBufferReader/dev/FileBufferReader.js
  41. +162 −0 FileBufferReader/dev/FileBufferReaderHelper.js
  42. +75 −0 FileBufferReader/dev/FileBufferReceiver.js
  43. +10 −0 FileBufferReader/dev/FileConverter.js
  44. +57 −0 FileBufferReader/dev/FileSelector.js
  45. +676 −0 FileBufferReader/dev/binarize.js
  46. +11 −0 FileBufferReader/dev/common.js
  47. +1 −0 FileBufferReader/dev/head.js
  48. +4 −0 FileBufferReader/dev/tail.js
  49. +19 −3 FileBufferReader/fbr-client/.gitignore
  50. +238 −0 FileBufferReader/index.html
  51. +14 −2 FileBufferReader/package.json
  52. +74 −0 FileBufferReader/server.js
  53. +0 −32 Firefox-Extensions/README.md
  54. 0 Firefox-Extensions/{enable-screen-capturing → enable-screen-capturing-old2}/FirefoxScreenAddon.js
  55. +92 −0 Firefox-Extensions/enable-screen-capturing-old2/README.md
  56. +41 −0 Firefox-Extensions/enable-screen-capturing-old2/content-script.js
  57. +108 −0 Firefox-Extensions/enable-screen-capturing-old2/index.js
  58. +16 −0 Firefox-Extensions/enable-screen-capturing-old2/package.json
  59. +12 −0 Firefox-Extensions/enable-screen-capturing-old2/test/test-index.js
  60. +11 −65 Firefox-Extensions/enable-screen-capturing/README.md
  61. +8 −27 Firefox-Extensions/enable-screen-capturing/content-script.js
  62. +18 −20 Firefox-Extensions/enable-screen-capturing/index.js
  63. +11 −9 RTCMultiConnection/Gruntfile.js
  64. +9 −0 RTCMultiConnection/README.md
  65. +0 −18 RTCMultiConnection/RTCMultiConnection.min.js
  66. +58 −7 RTCMultiConnection/Signaling-Server.js
  67. +1 −1 RTCMultiConnection/bower.json
  68. +3 −2 RTCMultiConnection/config.json
  69. +2 −5 RTCMultiConnection/demos/Audio+ScreenSharing.html
  70. +3 −8 RTCMultiConnection/demos/Audio+Video+TextChat+FileSharing.html
  71. +2 −6 RTCMultiConnection/demos/Audio-Conferencing.html
  72. +2 −6 RTCMultiConnection/demos/Cross-Domain-Screen-Capturing.html
  73. +3 −7 RTCMultiConnection/demos/Disconnect+Rejoin.html
  74. +2 −5 RTCMultiConnection/demos/Files-Scalable-Broadcast.html
  75. +4 −7 RTCMultiConnection/demos/Firebase-Demo.html
  76. +42 −42 RTCMultiConnection/demos/MultiRTC/index.html
  77. +308 −0 RTCMultiConnection/demos/One-to-One.html
  78. +4 −8 RTCMultiConnection/demos/Password-Protected-Rooms.html
  79. +14 −9 RTCMultiConnection/demos/Pre-recorded-Media-Streaming.html
  80. +4 −6 RTCMultiConnection/demos/PubNub-Demo.html
  81. +1 −0 RTCMultiConnection/demos/README.md
  82. +3 −9 RTCMultiConnection/demos/Scalable-Broadcast.html
  83. +3 −9 RTCMultiConnection/demos/Scalable-Screen-Broadcast.html
  84. +3 −9 RTCMultiConnection/demos/Scalable-Screen-plus-Audio-Broadcast.html
  85. +1 −5 RTCMultiConnection/demos/StreamHasData.html
  86. +3 −7 RTCMultiConnection/demos/TextChat+FileSharing.html
  87. +1 −2 RTCMultiConnection/demos/Video-Conferencing.html
  88. +5 −4 RTCMultiConnection/demos/Video-Scalable-Broadcast.html
  89. +3 −7 RTCMultiConnection/demos/addStream-in-Chat-room.html
  90. +3 −7 RTCMultiConnection/demos/admin-guest.html
  91. +1 −4 RTCMultiConnection/demos/applyConstraints.html
  92. +1 −4 RTCMultiConnection/demos/change-resolutions.html
  93. +1 −4 RTCMultiConnection/demos/checkPresence.html
  94. +1 −4 RTCMultiConnection/demos/custom-socket-event.html
  95. +20 −16 RTCMultiConnection/demos/file-sharing.html
  96. +1 −4 RTCMultiConnection/demos/getPublicModerators.html
  97. +18 −12 RTCMultiConnection/demos/index.html
  98. +1 −4 RTCMultiConnection/demos/replaceTrack.html
  99. +2 −5 RTCMultiConnection/demos/screen-sharing.html
  100. +2 −5 RTCMultiConnection/demos/share-part-of-screen.html
  101. +32 −4 RTCMultiConnection/demos/switch-cameras.html
  102. +1 −4 RTCMultiConnection/demos/video-broadcasting.html
  103. +234 −0 RTCMultiConnection/dev/BluetoothConnection.js
  104. +29 −17 RTCMultiConnection/dev/DetectRTC.js
  105. +0 −1,165 RTCMultiConnection/dev/FileBufferReader.js
  106. +14 −2 RTCMultiConnection/dev/IceServersHandler.js
  107. +54 −57 RTCMultiConnection/dev/MultiPeersHandler.js
  108. +96 −10 RTCMultiConnection/dev/RTCMultiConnection.js
  109. +10 −1 RTCMultiConnection/dev/RTCPeerConnection.js
  110. +42 −3 RTCMultiConnection/dev/Screen-Capturing.js
  111. +28 −2 RTCMultiConnection/dev/SocketConnection.js
  112. +5 −1 RTCMultiConnection/dev/StreamsHandler.js
  113. +60 −1 RTCMultiConnection/dev/getScreenId.js
  114. +3 −2 RTCMultiConnection/dev/getUserMedia.js
  115. +284 −98 RTCMultiConnection/{ → dist}/RTCMultiConnection.js
  116. +18 −0 RTCMultiConnection/dist/RTCMultiConnection.min.js
  117. +0 −1,165 RTCMultiConnection/dist/rmc3.fbr.js
  118. +0 −15 RTCMultiConnection/dist/rmc3.fbr.min.js
  119. +0 −5,350 RTCMultiConnection/dist/rmc3.js
  120. +0 −18 RTCMultiConnection/dist/rmc3.min.js
  121. +4 −0 RTCMultiConnection/docs/README.md
  122. +62 −0 RTCMultiConnection/docs/api.md
  123. +3 −3 RTCMultiConnection/docs/getting-started.md
  124. +11 −16 RTCMultiConnection/docs/how-to-use.md
  125. +60 −14 RTCMultiConnection/docs/installation-guide.md
  126. +16 −13 RTCMultiConnection/docs/ios-android.md
  127. +2 −2 RTCMultiConnection/docs/tips-tricks.md
  128. +5 −2 RTCMultiConnection/package.json
  129. +155 −40 RTCMultiConnection/server.js
  130. +6 −6 RecordRTC/AudioVideo-on-Firefox.html
  131. +16 −16 RecordRTC/Canvas-Recording/Canvas-Animation-Recording.html
  132. +9 −10 RecordRTC/Canvas-Recording/index.html
  133. +33 −33 RecordRTC/Canvas-Recording/record-canvas-drawings.html
  134. +3 −2 RecordRTC/Canvas-Recording/webpage-recording.html
  135. +15 −2 RecordRTC/Gruntfile.js
  136. +8 −9 RecordRTC/MRecordRTC/index.html
  137. +1 −1 RecordRTC/README.md
  138. +12 −13 RecordRTC/Record-Mp3-or-Wav.html
  139. +599 −468 RecordRTC/RecordRTC-to-Nodejs/README.md
  140. +1 −1 RecordRTC/RecordRTC-to-Nodejs/config.js
  141. +12 −5 RecordRTC/RecordRTC-to-Nodejs/handlers.js
  142. +1 −1 RecordRTC/RecordRTC-to-Nodejs/index.js
  143. +3 −3 RecordRTC/RecordRTC-to-Nodejs/package.json
  144. +1 −1 RecordRTC/RecordRTC-to-Nodejs/router.js
  145. +1 −1 RecordRTC/RecordRTC-to-Nodejs/server.js
  146. +1 −1 RecordRTC/RecordRTC-to-Nodejs/static/README.md
  147. +291 −292 RecordRTC/RecordRTC-to-Nodejs/static/index.html
  148. +90 −92 RecordRTC/RecordRTC-to-PHP/index.html
  149. +24 −7 RecordRTC/RecordRTC.js
  150. +14 −4 RecordRTC/RecordRTC.min.js
  151. +17 −3 RecordRTC/dev/MRecordRTC.js
  152. +0 −6 RecordRTC/dev/head.js
  153. +106 −107 RecordRTC/index.html
  154. +2 −3 ffmpeg/README.md
  155. +9 −9 ffmpeg/audio-plus-canvas-recording.html
  156. +34 −34 ffmpeg/audio-plus-screen-recording.html
  157. +38 −38 ffmpeg/merging-wav-and-webm-into-mp4.html
  158. +31 −31 ffmpeg/wav-to-ogg.html
  159. +31 −31 ffmpeg/webm-to-mp4.html
  160. +129 −190 getScreenId.js/README.md
  161. +16 −0 getScreenId.js/fake-keys/certificate.pem
  162. +15 −0 getScreenId.js/fake-keys/privatekey.pem
  163. +90 −0 getScreenId.js/getScreenId.html
  164. +230 −0 getScreenId.js/getScreenId.js
  165. +0 −274 getScreenId.js/getStats.js
  166. +268 −298 getScreenId.js/index.html
  167. +0 −41 getScreenId.js/package.json
  168. +55 −38 getScreenId.js/server.js
@@ -22,9 +22,8 @@ module.exports = function(grunt) {
dist: {
src: [
'dev/head.js',
'dev/common.js',
'dev/decorator.js',
'dev/draw-helper.js',
'dev/drag-helper.js',
'dev/pencil-handler.js',
@@ -37,10 +36,13 @@ module.exports = function(grunt) {
'dev/rect-handler.js',
'dev/quadratic-handler.js',
'dev/bezier-handler.js',
'dev/zoom-handler.js',
'dev/file-selector.js',
'dev/image-handler.js',
'dev/decorator.js',
'dev/events-handler.js',
'dev/share-drawings.js',
'dev/canvas-designer-widget.js',
View
@@ -265,7 +265,8 @@ designer.setTools({
bezier: true,
quadratic: true,
text: true,
image: true
image: true,
zoom: true
});
```
@@ -308,7 +309,7 @@ designer.iframe.style.border = '5px solid red';
## `toDataURL`
Get data-URL of your drawings!
Get data-URL of your drawings!
```javascript
designer.toDataURL('image/png', function(dataURL) {
@@ -442,7 +443,7 @@ You merely need to set `isYourNewToolIconSelected:true` also `cache.isYourNewToo
## Fourth Step
Create new file in the [`dev`](https://github.com/muaz-khan/Canvas-Designer/tree/master/dev) directory. Name this file as `yourNewToolIcon-handler.js`.
Create new file in the [`dev`](https://github.com/muaz-khan/Canvas-Designer/tree/master/dev) directory. Name this file as `yourNewToolIcon-handler.js`.
This file MUST look like this:
@@ -453,11 +454,11 @@ var yourNewToolIconHandler = {
mousedown: function(e) {
this.ismousedown = true;
},
mouseup: function(e) {
mouseup: function(e) {
this.ismousedown = false;
},
mousemove: function(e) {
if(this.ismousedown) { ... }
}
@@ -1,7 +1,7 @@
{
"name": "canvas-designer",
"preferGlobal": false,
"version": "1.0.9",
"version": "1.2.1",
"author": {
"name": "Muaz Khan",
"email": "muazkh@gmail.com",
@@ -22,11 +22,22 @@ var is = {
};
function addEvent(element, eventType, callback) {
if (eventType.split(' ').length > 1) {
var events = eventType.split(' ');
for (var i = 0; i < events; i++) {
addEvent(element, events[i], callback);
}
return;
}
if (element.addEventListener) {
element.addEventListener(eventType, callback, !1);
return true;
} else if (element.attachEvent) return element.attachEvent('on' + eventType, callback);
else element['on' + eventType] = callback;
} else if (element.attachEvent) {
return element.attachEvent('on' + eventType, callback);
} else {
element['on' + eventType] = callback;
}
return this;
}
@@ -582,3 +593,48 @@ function paste() {
setSelection(find('drag-all-paths'), 'DragAllPaths');
}
}
// marker + pencil
function hexToR(h) {
return parseInt((cutHex(h)).substring(0, 2), 16)
}
function hexToG(h) {
return parseInt((cutHex(h)).substring(2, 4), 16)
}
function hexToB(h) {
return parseInt((cutHex(h)).substring(4, 6), 16)
}
function cutHex(h) {
return (h.charAt(0) == "#") ? h.substring(1, 7) : h
}
function clone(obj) {
if (obj === null || typeof(obj) !== 'object' || 'isActiveClone' in obj)
return obj;
if (obj instanceof Date)
var temp = new obj.constructor(); //or new Date(obj);
else
var temp = obj.constructor();
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
obj['isActiveClone'] = null;
temp[key] = clone(obj[key]);
delete obj['isActiveClone'];
}
}
return temp;
}
function hexToRGB(h) {
return [
hexToR(h),
hexToG(h),
hexToB(h)
]
}
@@ -11,7 +11,8 @@ var tools = {
bezier: true,
quadratic: true,
text: true,
image: true
image: true,
zoom: true
};
if (params.tools) {
@@ -286,7 +287,44 @@ window.addEventListener('load', function() {
decorateArrow();
} else document.getElementById('arrow').style.display = 'none';
function decoreZoomUp() {
var context = getContext('zoom-up');
zoomHandler.icons.up(context);
addEvent(context.canvas, 'click', function() {
zoomHandler.up();
});
}
function decoreZoomDown() {
var context = getContext('zoom-down');
zoomHandler.icons.down(context);
addEvent(context.canvas, 'click', function() {
zoomHandler.down();
});
}
if (tools.zoom === true) {
decoreZoomUp();
decoreZoomDown();
} else {
document.getElementById('zoom-up').style.display = 'none';
document.getElementById('zoom-down').style.display = 'none';
}
function decoratePencil() {
function hexToRGBA(h, alpha) {
return 'rgba(' + hexToRGB(h).join(',') + ',1)';
}
var colors = [
['FFFFFF', '006600', '000099', 'CC0000', '8C4600'],
['CCCCCC', '00CC00', '6633CC', 'FF0000', 'B28500'],
['666666', '66FFB2', '006DD9', 'FF7373', 'FF9933'],
['333333', '26FF26', '6699FF', 'CC33FF', 'FFCC99'],
['000000', 'CCFF99', 'BFDFFF', 'FFBFBF', 'FFFF33']
];
var context = getContext('pencil-icon');
context.lineWidth = 5;
@@ -300,6 +338,81 @@ window.addEventListener('load', function() {
context.fillText('Pencil', 6, 12);
bindEvent(context, 'Pencil');
var pencilContainer = find('pencil-container'),
pencilColorContainer = find('pencil-fill-colors'),
strokeStyleText = find('pencil-stroke-style'),
pencilColorsList = find("pencil-colors-list"),
fillStyleText = find('pencil-fill-style'),
pencilSelectedColor = find('pencil-selected-color'),
pencilSelectedColor2 = find('pencil-selected-color-2'),
btnPencilDone = find('pencil-done'),
canvas = context.canvas,
alpha = 0.2;
// START INIT PENCIL
pencilStrokeStyle = hexToRGBA(fillStyleText.value, alpha)
pencilSelectedColor.style.backgroundColor =
pencilSelectedColor2.style.backgroundColor = '#' + fillStyleText.value;
colors.forEach(function(colorRow) {
var row = '<tr>';
colorRow.forEach(function(color) {
row += '<td style="background-color:#' + color + '" data-color="' + color + '"></td>';
})
row += '</tr>';
pencilColorsList.innerHTML += row;
})
// console.log(pencilColorsList.getElementsByTagName('td'))
Array.prototype.slice.call(pencilColorsList.getElementsByTagName('td')).forEach(function(td) {
addEvent(td, 'mouseover', function() {
var elColor = td.getAttribute('data-color');
pencilSelectedColor2.style.backgroundColor = '#' + elColor;
fillStyleText.value = elColor
});
addEvent(td, 'click', function() {
var elColor = td.getAttribute('data-color');
pencilSelectedColor.style.backgroundColor =
pencilSelectedColor2.style.backgroundColor = '#' + elColor;
fillStyleText.value = elColor;
pencilColorContainer.style.display = 'none';
});
})
// END INIT PENCIL
addEvent(canvas, 'click', function() {
hideContainers();
pencilContainer.style.display = 'block';
pencilContainer.style.top = (canvas.offsetTop + 1) + 'px';
pencilContainer.style.left = (canvas.offsetLeft + canvas.clientWidth) + 'px';
fillStyleText.focus();
});
addEvent(btnPencilDone, 'click', function() {
pencilContainer.style.display = 'none';
pencilColorContainer.style.display = 'none';
pencilLineWidth = strokeStyleText.value;
pencilStrokeStyle = hexToRGBA(fillStyleText.value, alpha);
});
addEvent(pencilSelectedColor, 'click', function() {
pencilColorContainer.style.display = 'block';
});
}
if (tools.pencil === true) {
@@ -731,11 +844,15 @@ function hideContainers() {
colorsContainer = find('colors-container'),
markerContainer = find('marker-container'),
markerColorContainer = find('marker-fill-colors'),
pencilContainer = find('pencil-container'),
pencilColorContainer = find('pencil-fill-colors'),
lineWidthContainer = find('line-width-container');
additionalContainer.style.display =
colorsContainer.style.display =
markerColorContainer.style.display =
markerContainer.style.display =
pencilColorContainer.style.display =
pencilContainer.style.display =
lineWidthContainer.style.display = 'none';
}
@@ -1,16 +1,15 @@
var drawHelper = {
redraw: function(skipSync) {
redraw: function() {
tempContext.clearRect(0, 0, innerWidth, innerHeight);
context.clearRect(0, 0, innerWidth, innerHeight);
var i, point, length = points.length;
for (i = 0; i < length; i++) {
point = points[i];
this[point[0]](context, point[1], point[2]);
}
if (!skipSync && typeof syncPoints !== 'undefined') {
syncPoints(is.isDragAllPaths || is.isDragLastPath ? true : false);
if (point && point.length && this[point[0]]) {
this[point[0]](context, point[1], point[2]);
}
// else warn
}
},
getOptions: function(opt) {
@@ -23,9 +23,12 @@ addEvent(canvas, isTouch ? 'touchstart' : 'mousedown', function(e) {
else if (cache.isMarker) markerHandler.mousedown(e);
drawHelper.redraw();
e.preventDefault();
e.stopPropagation();
});
addEvent(canvas, isTouch ? 'touchend' : 'mouseup', function(e) {
addEvent(canvas, isTouch ? 'touchend touchcancel' : 'mouseup', function(e) {
if (isTouch) e = e.pageX ? e : e.touches.length ? e.touches[0] : {
pageX: 0,
pageY: 0
@@ -47,6 +50,11 @@ addEvent(canvas, isTouch ? 'touchend' : 'mouseup', function(e) {
else if (cache.isMarker) markerHandler.mouseup(e);
drawHelper.redraw();
syncPoints(is.isDragAllPaths || is.isDragLastPath ? true : false);
e.preventDefault();
e.stopPropagation();
});
addEvent(canvas, isTouch ? 'touchmove' : 'mousemove', function(e) {
@@ -69,6 +77,9 @@ addEvent(canvas, isTouch ? 'touchmove' : 'mousemove', function(e) {
else if (cache.isImage) imageHandler.mousemove(e);
else if (cache.isArrow) arrowHandler.mousemove(e);
else if (cache.isMarker) markerHandler.mousemove(e);
e.preventDefault();
e.stopPropagation();
});
var keyCode;
@@ -151,7 +162,7 @@ function onkeyup(e) {
points.length = points.length - 1;
drawHelper.redraw();
syncPoints(true);
syncPoints(is.isDragAllPaths || is.isDragLastPath ? true : false);
}
}
@@ -172,6 +183,8 @@ function onkeyup(e) {
// Ctrl + v
if (isControlKeyPressed && keyCode === 86 && copiedStuff.length) {
paste();
syncPoints(is.isDragAllPaths || is.isDragLastPath ? true : false);
}
// Ending the Control Key
@@ -14,6 +14,8 @@ var FileSelector = function() {
file.multiple = true;
}
file.accept = 'image/*';
file.onchange = function() {
if (multiple) {
if (!file.files.length) {
Oops, something went wrong.

0 comments on commit 3a423fe

Please sign in to comment.