Files
IPA/ipa-customer/pages/upload-video.php
diptimhabadi351 1cf6f290de IPA
2024-06-18 13:31:13 +05:30

40 lines
1.4 KiB
PHP

<?php $currentPage = "wishlisted-properties" ?>
<?php include('../components/header.php') ?>
<div class="container">
<input type="file" class="fileuploader" style="display: none;" accept="video/*">
<button class="fileuploader-btn">Select a Video File</button><br>
</div>
<?php include('../components/footer.php') ?>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
jQuery(document).ready(function ($) {
// Click button to activate hidden file input
$(".fileuploader-btn").on("click", function () {
$(".fileuploader").click();
});
// Once something is selected the change function will run
$(".fileuploader").change(function () {
// Create new FileReader as a variable
var reader = new FileReader();
// Onload Function will run after video has loaded
reader.onload = function (file) {
var fileContent = file.target.result;
$("body").append(
'<video src="' +
fileContent +
'" width="320" height="240" controls></video>'
);
};
// Get the selected video from Dialog
if (this.files && this.files[0]) {
reader.readAsDataURL(this.files[0]);
}
});
});
</script>