BiFace_Server_Config_API/node_modules/node-rtsp-stream/test/tests.js
2020-05-22 14:53:57 +07:00

38 lines
1023 B
JavaScript

// Generated by CoffeeScript 2.4.1
(function() {
var assert;
assert = require('assert');
describe('node-rstp-stream', function() {
var VideoStream;
VideoStream = require('../');
return it('should not throw an error when instantiated', function(done) {
var videoStream;
videoStream = new VideoStream({
name: 'wowza',
streamUrl: 'rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov',
wsPort: 9999,
width: 240,
height: 160,
ffmpegOptions: {
'-stats': '',
'-r': '30'
}
});
videoStream.on('exitWithError', () => {
videoStream.stop();
assert.fail('videoStream exited with error');
return done();
});
// Must use setTimeout because we need the stream instantiated before we can stop it
// otherwise it blocks the test runner from exiting.
return setTimeout(() => {
videoStream.stop();
return done();
}, 1900);
});
});
}).call(this);