diff options
| author | James Mills <prologic@shortcircuit.net.au> | 2020-03-27 21:04:10 +1000 |
|---|---|---|
| committer | James Mills <prologic@shortcircuit.net.au> | 2020-03-27 21:04:10 +1000 |
| commit | 299df65290ef028a997bcfed888b2230ee750f36 (patch) | |
| tree | efb2121a68fc45e100adff16988168281d373ef8 /static/upload.js | |
| parent | 9af98b0382bb8d58b12d45860afd861ec8b04cb4 (diff) | |
Add optional title and description to video upload
Diffstat (limited to 'static/upload.js')
| -rw-r--r-- | static/upload.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/static/upload.js b/static/upload.js index b65684e..457f01e 100644 --- a/static/upload.js +++ b/static/upload.js @@ -12,6 +12,8 @@ let file = null const uploadForm = document.getElementById('upload-form') const videoInput = document.getElementById('video-input') +const videoTitle = document.getElementById('video-title') +const videoDescription = document.getElementById('video-description') const uploadMessageLabel = document.getElementById('upload-message') const uploadFileContainer = document.getElementById('upload-file') const uploadFilenameLabel = document.getElementById('upload-filename') @@ -161,6 +163,8 @@ const startUploading = () => { const formData = new FormData() formData.append('video_file', file) + formData.append('video_title', videoTitle.value) + formData.append('video_description', videoDescription.value) const xhr = new XMLHttpRequest() xhr.upload.addEventListener('progress', uploadProgress, false) @@ -236,4 +240,4 @@ const uploadAbort = () => { // upload abort setMessage('The upload has been canceled by the user or the browser dropped the connection.', true) setProgress(0) setUploadState(false) -}
\ No newline at end of file +} |
