I have successfully uploaded images and displayed them on an HTML page. Now, I am looking to do the same for videos.
Here is my current code:
$('#addPhotosBtn').click(function() {
$(this).parents().find('#addPhotosInput').click();
});
document.getElementById('addPhotosInput').onchange = e => {
const file = e.target.files[0];
const url = URL.createObjectURL(file);
const li = ` <li> <img src="${url}">
<span><i class="fa fa-trash"></i></span>
</li>`
$('.photos-list ul').append(li);
};
If you have any insight or suggestions on how to modify this code for video uploads, I'd greatly appreciate it!
Thank you in advance for your help!