videojs-record
Advanced tools
Comparing version 1.1.0 to 1.2.0
{ | ||
"name": "videojs-record", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"homepage": "https://github.com/collab-project/videojs-record", | ||
@@ -36,24 +36,14 @@ "description": "A video.js plugin for recording audio/video/image files.", | ||
"video.js": ">=5.0.0", | ||
"wavesurfer.js": ">=1.0.50", | ||
"videojs-wavesurfer": ">=1.0.6", | ||
"recordrtc": ">=5.2.7", | ||
"libvorbis.js": ">=0.5.1", | ||
"wavesurfer.js": ">=1.0.57", | ||
"videojs-wavesurfer": ">=1.1.0", | ||
"recordrtc": ">=5.2.9" | ||
}, | ||
"devDependencies": { | ||
"libvorbis.js": ">=1.1.1", | ||
"recorderjs": "https://github.com/mattdiamond/Recorderjs.git", | ||
"lamejs": "https://github.com/zhuker/lamejs.git", | ||
"opus-recorderjs": ">=0.4.4" | ||
}, | ||
"devDependencies": { | ||
"grunt": ">=0.4.5", | ||
"grunt-contrib-jshint": ">=0.10.0", | ||
"grunt-contrib-watch": ">=0.6.1", | ||
"grunt-contrib-concat": ">=0.4.0", | ||
"grunt-contrib-uglify": ">=0.5.0", | ||
"grunt-contrib-cssmin": ">=0.11.0", | ||
"grunt-sass": "git://github.com/sindresorhus/grunt-sass.git", | ||
"grunt-videojs-languages": ">=0.0.4", | ||
"videojs-font": "git://github.com/videojs/font.git", | ||
"lodash": "^3.9.3", | ||
"material-design-icons": "^2.0.0", | ||
"webfonts-generator": "git://github.com/sunflowerdeath/webfonts-generator.git" | ||
"opus-recorderjs": ">=0.4.4", | ||
"fine-uploader": ">=5.4.1", | ||
"blueimp-file-upload": ">=9.11.2" | ||
} | ||
} |
videojs-record changelog | ||
======================== | ||
1.2.0 - 2016/02/27 | ||
------------------ | ||
- Add compatibility for single file recording introduced in Chrome 49+ (by | ||
@zang) | ||
- Prefer `navigator.mediaDevices.getUserMedia` instead of deprecated | ||
`navigator.getUserMedia` if available | ||
- Stop using deprecated `MediaStream.stop()`; use `MediaStreamTrack.stop()` | ||
instead | ||
- Add `audioRecorderType` and `videoRecorderType` options | ||
- Bump required version for videojs-wavesurfer to 1.1.0, wavesurfer.js to | ||
1.0.57 and recordrtc to 5.2.9 for microphone and Chrome fixes | ||
- Fixes for latest release of the libvorbis.js plugin (1.1.1). This also | ||
removes the `audioModuleURL` option | ||
- IE8 font fixes | ||
1.1.0 - 2016/01/19 | ||
@@ -5,0 +22,0 @@ ------------------ |
@@ -8,2 +8,4 @@ 'use strict'; | ||
module.exports = function(grunt) { | ||
require('time-grunt')(grunt); | ||
var pkg, version, verParts; | ||
@@ -88,6 +90,21 @@ pkg = grunt.file.readJSON('package.json'); | ||
files: { | ||
'src/css/videojs.record.css': 'src/css/font/scss/videojs-icons.scss' | ||
'src/css/videojs.record.css': 'src/css/font/scss/videojs-icons-codepoints.scss' | ||
} | ||
} | ||
}, | ||
jscs: { | ||
src: ['<%= jshint.src.src %>'], | ||
options: { | ||
config: '.jscsrc', | ||
esnext: false, // If you use ES6 http://jscs.info/overview.html#esnext | ||
verbose: true, // If you need output with rule names http://jscs.info/overview.html#verbose | ||
fix: false, // Autofix code style violations when possible. | ||
requireCurlyBraces: [ "if" ] | ||
} | ||
}, | ||
jsonlint: { | ||
language: { | ||
src: ['lang/*.json'] | ||
} | ||
}, | ||
watch: { | ||
@@ -119,5 +136,7 @@ gruntfile: { | ||
grunt.loadNpmTasks('grunt-sass'); | ||
grunt.loadNpmTasks('grunt-jscs'); | ||
grunt.loadNpmTasks('grunt-jsonlint'); | ||
grunt.registerTask('font', ['generate-font', 'update-base64']); | ||
grunt.registerTask('pretask', ['jshint', 'concat', 'vjslanguages', 'sass']); | ||
grunt.registerTask('font', ['generate-font', 'update-base64', 'sass', 'wrapcodepoints']); | ||
grunt.registerTask('pretask', ['jshint', 'jscs', 'jsonlint', 'concat', 'vjslanguages', 'sass', 'wrapcodepoints']); | ||
grunt.registerTask('default', ['pretask', 'build', 'uglify']); | ||
@@ -176,3 +195,3 @@ | ||
fontName: iconConfig['font-name'], | ||
cssDest: 'src/css/font/scss/_icons.scss', | ||
cssDest: 'src/css/font/scss/_icons-codepoints.scss', | ||
cssTemplate: 'src/css/font/templates/scss.hbs', | ||
@@ -205,4 +224,19 @@ htmlDest: 'src/css/font/preview.html', | ||
// Sass turns unicode codepoints into utf8 characters. | ||
// We don't want that so we unwrapped them in the templates/scss.hbs file. | ||
// After sass has generated our css file, we need to wrap the codepoints | ||
// in quotes for it to work. | ||
grunt.registerTask('wrapcodepoints', function() { | ||
var cssPath = path.normalize('./src/css/videojs.record.css'); | ||
var css = grunt.file.read(cssPath); | ||
grunt.file.write(cssPath, css.replace(/(\\f\w+);/g, "'$1';")); | ||
var sassPath = path.normalize('./src/css/font/scss/_icons-codepoints.scss'); | ||
var normalSassPath = path.normalize('./src/css/font/scss/_icons.scss'); | ||
var sass = grunt.file.read(sassPath); | ||
grunt.file.write(normalSassPath, sass.replace(/(\\f\w+),/g, "'$1',")); | ||
}); | ||
grunt.registerTask('update-base64', function() { | ||
var iconScssFile = './src/css/font/scss/_icons.scss'; | ||
var iconScssFile = './src/css/font/scss/_icons-codepoints.scss'; | ||
var fontFiles = { | ||
@@ -209,0 +243,0 @@ ttf: './src/css/font/videojs-record.ttf', |
{ | ||
"name": "videojs-record", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "A video.js plugin for recording audio/video/image files.", | ||
@@ -37,9 +37,5 @@ "main": "src/js/videojs.record.js", | ||
"video.js": ">=5.0.0", | ||
"wavesurfer.js": ">=1.0.50", | ||
"videojs-wavesurfer": ">=1.0.6", | ||
"recordrtc": ">=5.2.7", | ||
"libvorbis.js": ">=0.5.1", | ||
"recorderjs": "https://github.com/mattdiamond/Recorderjs.git", | ||
"lamejs": ">=1.0.0", | ||
"opus-recorder": ">=0.4.4" | ||
"wavesurfer.js": ">=1.0.57", | ||
"videojs-wavesurfer": ">=1.1.0", | ||
"recordrtc": ">=5.2.9" | ||
}, | ||
@@ -53,10 +49,19 @@ "devDependencies": { | ||
"grunt-contrib-watch": ">=0.6.1", | ||
"grunt-jscs": "^2.7.0", | ||
"grunt-jsonlint": "^1.0.7", | ||
"grunt-sass": "^1.0.0", | ||
"grunt-videojs-languages": ">=0.0.4", | ||
"videojs-font": ">=1.3.0", | ||
"lodash": "^3.9.3", | ||
"material-design-icons": "^2.0.0", | ||
"webfonts-generator": "^0.2.4" | ||
"videojs-font": ">=1.3.0", | ||
"webfonts-generator": "^0.2.4", | ||
"time-grunt": "^1.2.1", | ||
"libvorbis.js": ">=1.1.1", | ||
"recorderjs": "https://github.com/mattdiamond/Recorderjs.git", | ||
"lamejs": ">=1.0.0", | ||
"opus-recorder": ">=0.4.4", | ||
"blueimp-file-upload": ">=9.11.2", | ||
"fine-uploader": ">=5.4.1" | ||
}, | ||
"author": "", | ||
"author": "Collab", | ||
"license": "MIT", | ||
@@ -63,0 +68,0 @@ "readmeFilename": "README.md", |
@@ -26,2 +26,5 @@ Video.js Record | ||
Take a look at the [changelog](./CHANGES.md) when upgrading from a previous | ||
version of videojs-record. | ||
Dependencies | ||
@@ -56,4 +59,4 @@ ------------ | ||
```html | ||
<link href="//vjs.zencdn.net/5.4.6/video-js.css" rel="stylesheet"> | ||
<script src="//vjs.zencdn.net/5.4.6/video.min.js"></script> | ||
<link href="//vjs.zencdn.net/5.7.1/video-js.css" rel="stylesheet"> | ||
<script src="//vjs.zencdn.net/5.7.1/video.min.js"></script> | ||
``` | ||
@@ -98,4 +101,5 @@ | ||
Note that recording both audio and video into a single WebM file is currently | ||
only supported in Mozilla Firefox >= 29. In the Chrome browser two separate | ||
Blob objects are created: one for audio and one for video. | ||
only supported in Mozilla Firefox >= 29 and Chrome >= 49. In older versions of | ||
the Chrome browser two separate Blob objects are created: one for audio and one | ||
for video. | ||
@@ -169,7 +173,8 @@ ### Audio-only | ||
| `audioEngine` | string | `recordrtc` | Audio recording library to use. Legal values are `recordrtc`, `libvorbis.js`, `lamejs`, `opus-recorder` and `recorder.js`. | | ||
| `audioRecorderType` | string or function | `auto` | Audio recorder type to use. This allows you to specify an alternative recorder class, e.g. `StereoAudioRecorder`. Defaults to `auto` which let's recordrtc specify the best available recorder type. Currently this setting is only used with the 'recordrtc' `audioEngine`. | | ||
| `audioBufferSize` | float | `4096` | The size of the audio buffer (in sample-frames per second). Legal values: 0, 256, 512, 1024, 2048, 4096, 8192 and 16384. | | ||
| `audioSampleRate` | float | `44100` | The audio sample rate (in sample-frames per second) at which the `AudioContext` handles audio. Legal values are in the range of 22050 to 96000. | | ||
| `audioChannels` | float | `2` | Number of audio channels. Using a single channel results in a smaller filesize. | | ||
| `audioWorkerURL` | string | `''` | URL for the audio worker, for example: `libvorbis.oggvbr.asyncencoder.worker.min.js`. Currently only used for libvorbis.js, opus-recorder and lamejs. | | ||
| `audioModuleURL` | string | `''` | URL for the audio module, for example: `libvorbis.asmjs.min.js`. Currently only used for libvorbis.js. | | ||
| `audioWorkerURL` | string | `''` | URL for the audio worker, for example: `/opus-recorder/oggopusEncoder.js`. Currently only used for opus-recorder and lamejs. | | ||
| `videoRecorderType` | string or function | `auto` | Video recorder type to use. This allows you to specify an alternative recorder class, e.g. `WhammyRecorder`. Defaults to `auto` which let's recordrtc specify the best available recorder type. | | ||
| `animationFrameRate` | float | `200` | Frame rate for animated GIF (in frames per second). | | ||
@@ -310,3 +315,3 @@ | `animationQuality` | float | `10` | Sets quality of color quantization (conversion of images to the maximum 256 colors allowed by the GIF specification). Lower values (minimum = 1) produce better colors, but slow processing significantly. The default produces good color mapping at reasonable speeds. Values greater than 20 do not yield significant improvements in speed. | | ||
```html | ||
<script src="/path/to/libvorbis.oggvbr.asyncencoder.min.js" async></script> | ||
<script src="/path/to/libvorbis.min.js"></script> | ||
``` | ||
@@ -321,4 +326,3 @@ | ||
And specify the `libvorbis.js` `audioEngine`, `audioWorkerURL` and | ||
`audioModuleURL` options. | ||
And use `libvorbis.js` for the `audioEngine` option. | ||
@@ -403,3 +407,3 @@ Check out the audio-only Ogg example ([demo](https://collab-project.github.io/videojs-record/examples/audio-only-ogg.html) / [source](https://github.com/collab-project/videojs-record/blob/master/examples/audio-only-ogg.html)). | ||
<script src="videojs-record/dist/lang/nl.js"></script> | ||
<script src="//vjs.zencdn.net/5.4.6/lang/nl.js"></script> | ||
<script src="//vjs.zencdn.net/5.7.1/lang/nl.js"></script> | ||
``` | ||
@@ -447,8 +451,2 @@ | ||
Or using bower: | ||
``` | ||
bower install | ||
``` | ||
Build a minified version: | ||
@@ -455,0 +453,0 @@ |
@@ -38,9 +38,3 @@ (function (root, factory) | ||
this.options = { | ||
workerURL: this.audioWorkerURL, | ||
moduleURL: this.audioModuleURL, | ||
encoderOptions: { | ||
channels: this.audioChannels, | ||
sampleRate: this.sampleRate, | ||
quality: 0.8 | ||
} | ||
audioBitsPerSecond: 32000 | ||
}; | ||
@@ -55,11 +49,8 @@ }, | ||
this.chunks = []; | ||
this.audioContext = new AudioContext(); | ||
this.audioSourceNode = this.audioContext.createMediaStreamSource(this.inputStream); | ||
this.scriptProcessorNode = this.audioContext.createScriptProcessor(this.bufferSize); | ||
this.engine = new VorbisMediaRecorder(this.inputStream, | ||
this.options); | ||
this.engine.ondataavailable = this.onData.bind(this); | ||
this.engine.onstop = this.onRecordingAvailable.bind(this); | ||
libvorbis.OggVbrAsyncEncoder.create( | ||
this.options, | ||
this.onData.bind(this), | ||
this.onRecordingAvailable.bind(this)).then( | ||
this.onEngineCreated.bind(this)); | ||
this.engine.start(); | ||
}, | ||
@@ -72,54 +63,15 @@ | ||
{ | ||
this.audioSourceNode.disconnect(this.scriptProcessorNode); | ||
this.scriptProcessorNode.disconnect(this.audioContext.destination); | ||
this.encoder.finish(); | ||
this.audioContext.close(); | ||
this.audioContext = null; | ||
this.engine.stop(); | ||
}, | ||
/** | ||
* Invoked when the libvorbis encoder is ready for recording. | ||
*/ | ||
onEngineCreated: function(encoder) | ||
onData: function(event) | ||
{ | ||
this.encoder = encoder; | ||
this.scriptProcessorNode.onaudioprocess = this.onAudioProcess.bind(this); | ||
this.audioSourceNode.connect(this.scriptProcessorNode); | ||
this.scriptProcessorNode.connect(this.audioContext.destination); | ||
this.chunks.push(event.data); | ||
}, | ||
/** | ||
* Continous encoding of audio data. | ||
*/ | ||
onAudioProcess: function(ev) | ||
{ | ||
var channelData; | ||
var channels = []; | ||
var inputBuffer = ev.inputBuffer; | ||
var samples = inputBuffer.length; | ||
for (var channel = 0; channel < this.audioChannels; channel++) | ||
{ | ||
channelData = inputBuffer.getChannelData(channel); | ||
// script processor reuses buffers; we need to make copies | ||
channelData = new Float32Array(channelData); | ||
channels.push(channelData); | ||
} | ||
this.encoder.encode(channels); | ||
}, | ||
onData: function(data) | ||
{ | ||
this.chunks.push(data); | ||
}, | ||
onRecordingAvailable: function() | ||
{ | ||
this.onStopRecording(new Blob(this.chunks, {type: 'audio/ogg'})); | ||
var blob = new Blob(this.chunks, {type: this.chunks[0].type}); | ||
this.chunks = []; | ||
this.onStopRecording(blob); | ||
} | ||
@@ -126,0 +78,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
1800769
4
74
5107
0
0
0
21
467
- Removedlamejs@>=1.0.0
- Removedlibvorbis.js@>=0.5.1
- Removedopus-recorder@>=0.4.4
- Removedrecorderjs@https://github.com/mattdiamond/Recorderjs.git
- Removedlamejs@1.2.1(transitive)
- Removedlibvorbis.js@1.1.2(transitive)
- Removedopus-recorder@8.0.5(transitive)
- Removeduse-strict@1.0.1(transitive)
Updatedrecordrtc@>=5.2.9
Updatedvideojs-wavesurfer@>=1.1.0
Updatedwavesurfer.js@>=1.0.57