Commit a06e23a9 authored by Aral Balkan's avatar Aral Balkan
Browse files

Added Remy’s fix: video now only plays when play button is clicked, not the...

Added Remy’s fix: video now only plays when play button is clicked, not the whole video (usability issue to allow for easy scrolling past the video on narrow viewports + touch. Upped the limit to 75MB since we are now supporting desktops also (for file upload).
parent d65792a0
......@@ -21,9 +21,14 @@ videoTemplate = (fs.readFileSync 'templates/video.html').toString()
app.use '/upload', multer {
dest: './public/videos/'
#
# Todo: if a file above the limit is uploaded, it is currently truncated. This, of course, doesn’t work
# ===== but can be used to fill up the storage quicker. Find a fix for this so such files are just
# rejected.
#
limits:
files: 1,
fileSize: 50000000 # 50MB
fileSize: 75000000 # 75MB
rename: (fieldname, filename) ->
#
......
......@@ -127,14 +127,27 @@ fileInput.onchange = function () {
}
function play(event) {
if (event.target.nodeName === 'VIDEO') {
return;
}
if (event.preventDefault) {
event.preventDefault(); // don't trigger the click event
}
// my kindom for a toggle function...
video[video.paused ? 'play' : 'pause']();
}
// function play(event) {
// if (event.preventDefault) {
// event.preventDefault(); // don't trigger the click event
// }
// // my kindom for a toggle function...
// video[video.paused ? 'play' : 'pause']();
// }
function previewVideo(file) {
var videoURL = URL.createObjectURL(file);
......@@ -187,12 +200,12 @@ uploadItButton.addEventListener('click', function(evt) {
//
// Check the file type and upload if correct and validate for 50MB limit.
//
var limit = 5e7; // 50mb...ish
var limit = 7.5e7; // 75mb...ish
var passesBasicClientSideValidation = (file.type.match('video.*')) && (file.size < limit)
if (file.size > limit) {
displayMessage('Sorry, the file you are trying to upload is too big. Try a shorter message.');
return console.warn('File size too big, sorry folks, 50Mb limit');
return console.warn('File size too big, sorry folks, 75Mb limit');
}
if (file.type.indexOf('video/') !== 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment