From 299df65290ef028a997bcfed888b2230ee750f36 Mon Sep 17 00:00:00 2001 From: James Mills Date: Fri, 27 Mar 2020 21:04:10 +1000 Subject: Add optional title and description to video upload --- static/upload.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'static/upload.js') 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 +} -- cgit v1.2.3