Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Use test instead of exec in conditionals for testing regex matches. #84

Merged
merged 2 commits into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 21, 2012
  1. @nickdesaulniers
  2. @nickdesaulniers

    Fixed this warning in newer versions of express.js:

    nickdesaulniers authored
    Warning: express.createServer() is deprecated, express
    applications no longer inherit from http.Server,
    please use:
    
      var express = require("express");
      var app = express();
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +1 −1  examples/express-stream.js
  2. +2 −2 lib/processor.js
View
2  examples/express-stream.js
@@ -1,7 +1,7 @@
var express = require('express'),
ffmpeg = require('../index');
-var app = express.createServer();
+var app = express();
app.use(express.static(__dirname + '/flowplayer'));
View
4 lib/processor.js
@@ -459,9 +459,9 @@ exports = module.exports = function Processor(command) {
if (this.options.video.fpsInput) {
args.push('-r', this.options.video.fpsInput);
}
- if (/^[a-z]+:\/\//.exec(this.options.inputfile)) {
+ if (/^[a-z]+:\/\//.test(this.options.inputfile)) {
args.push('-i', this.options.inputfile.replace(' ', '%20'));
- } else if (/%\d*d/.exec(this.options.inputfile)) { // multi-file format - http://ffmpeg.org/ffmpeg.html#image2-1
+ } else if (/%\d*d/.test(this.options.inputfile)) { // multi-file format - http://ffmpeg.org/ffmpeg.html#image2-1
args.push('-i', this.options.inputfile.replace(' ', '\ '));
} else {
var fstats = fs.statSync(this.options.inputfile);
Something went wrong with that request. Please try again.