Upload isn't Working
See original GitHub issueHi I tried to upload using the explaination and simple file example everything works fine in console but i can’t find the uploaded file Here is my script :
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Audio/Video Example - Record Plugin for Video.js</title>
<link href="../node_modules/video.js/dist/video-js.min.css" rel="stylesheet">
<link href="../dist/css/videojs.record.css" rel="stylesheet">
<script src="../node_modules/video.js/dist/video.min.js"></script>
<script src="../node_modules/recordrtc/RecordRTC.js"></script>
<script src="../node_modules/webrtc-adapter/out/adapter.js"></script>
<script src="../dist/videojs.record.js"></script>
<style>
/* change player background color */
#myVideo {
background-color: #9ab87a;
}
</style>
</head>
<body>
<video id="myVideo" class="video-js vjs-default-skin"></video>
<script>
var options = {
controls: true,
width: 640,
height: 480,
fluid: false,
plugins: {
record: {
audio: true,
video: true,
maxLength: 1800,
debug: true
}
}
};
var player = videojs('myVideo', options, function() {
// print version information at startup
var msg = 'Using video.js ' + videojs.VERSION +
' with videojs-record ' + videojs.getPluginVersion('record') +
' and recordrtc ' + RecordRTC.version;
videojs.log(msg);
});
// 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);
//player.record().saveAs({'video': 'my-video-file-name.webm'});
player.record().stopDevice();
upload(player.recordedData);
});
function upload(blob) {
var serverUrl = '/upload';
var formData = new FormData();
formData.append('file', blob, blob.name);
console.log('upload recording ' + blob.name + ' to ' + serverUrl);
// start upload
fetch(serverUrl, {
method: 'POST',
body: formData
}).then(
success => console.log('upload recording complete.')
).catch(
error => console.error('an upload error occurred!')
);
}
</script>
</body>
</html>
Issue Analytics
- State:
- Created 5 years ago
- Comments:26 (13 by maintainers)
Top Results From Across the Web
File Upload not working, how do i fix this? - Microsoft Community
1) Reset the browsers in Windows Settings > Apps & Features > Browser > Advanced Options > Reset and Repair to see if...
Read more >Common uploading errors - YouTube Help - Google Support
If you're having problems uploading your video, select the error message you're seeing and follow the troubleshooting steps to solve your issue.
Read more >What is Wrong With a Computer When Your Pictures Won't ...
Many factors come into play when uploading photos to a website; ... If one type of uploader isn't working, see if the website...
Read more >Troubleshooting file upload problems - UK Copyright Service
Make sure the file is not corrupted. · Copy the file to your home/desktop folder and upload from there. · Don't upload folders...
Read more >[Solved] Google Drive not Uploading! [2021]
I. How To Solve Google Drive Not Uploading On Computer · 1. Storage Space · 2. Network Issues · 3. Browser Issues ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
it worked , thanks
ok that will be better , thanks