-
-
Notifications
You must be signed in to change notification settings - Fork 313
Closed
Labels
Milestone
Description
Hi I am facing issue with video recording and got the below issue.its been 2 days since im trying to fix but dint
In Angular we need to declare a variable for videojs
In component.ts:
let videojs = require('./../../../../../node_modules/video.js/dist/video.js');
ngAfterViewInit() {
var player = videojs("myVideo", {
controls: true,
width: 320,
height: 240,
fluid: false,
plugins: {
record: {
audio: true,
video: true,
maxLength: 15,
debug: true
}
}
});
// error handling
player.on('deviceError', function () {
console.log('device error:', player.deviceErrorCode);
});
player.on('error', function (error) {
console.log('error:', error);
});
// user clicked the record button and started recording
player.on('startRecord', function () {
console.log('started recording!');
});
// user completed recording and stream is available
player.on('finishRecord', function () {
// the blob object contains the recorded data that
// can be downloaded by the user, stored on server etc.
console.log('finished recording: ', player.recordedData);
});
}
angualrcli.json:
"styles": [
"styles.scss",
"assets/sass/style.scss",
"../node_modules/videojs-record/dist/css/videojs.record.css",
"../node_modules/video.js/dist/video-js.min.css"
],
"scripts": [
"assets/js/app.js",
"assets/js/bootstrap.min.js",
"assets/js/bootstrap-select.js",
"assets/js/bootstrap-datepicker.js",
"assets/js/ion.rangeSlider.min.js",
"assets/js/jquery.ui.js",
"assets/js/jquery.scrollbar.js",
"assets/js/photobooth_min.js",
"../node_modules/chart.js/dist/chart.min.js",
"../node_modules/videojs-record/dist/videojs.record.js",
"../node_modules/video.js/dist/video.min.js",
"../node_modules/recordrtc/RecordRTC.js",
"../node_modules/webrtc-adapter/out/adapter.js"
],
index.html
<script src="http://cdnjs.cloudflare.com/ajax/libs/video.js/4.12.5/video.js"></script>
<script src="http://cdn.WebRTC-Experiment.com/RecordRTC.js"></script>
css
http://cdnjs.cloudflare.com/ajax/libs/video.js/4.12.5/video-js.css" rel="stylesheet
package.json:
"@angular/cli": "1.4.9",
"recordrtc": "^5.4.7",
"video.js": "^7.1.0",
"videojs-record": "^2.0.3",
"videojs-vr": "^1.4.7",
"videojs-wavesurfer": "^2.5.1",
"webrtc-adapter": "^6.3.2",
"@dfl/videojs-record": "^2.4.1",
"@types/videojs": "^5.16.2",
thanks
priya