如何从服务器显示上传的视频,回到网站的div标签内? 另外,我想在每个视频上提供社交分享选项?

How to display only specific files[.mp4] uploaded videos[using a foreach loop condition] from the server, back inside div tag of the website? Also I want to give social-sharing options on each video?

<section>
<div id ="getFile">
<script type="text/javascript">

$("#getFile").html('');
$("#getFile").html('<video src="pathto/myserver/video.mp4" controls></video>');

</script>  
</div>
</section>

Social-sharing options on each video for: 1.Facebook 2.Twitter 3.YouTube 4.Google Plus 5.Instagram

I think this can be achieved using a combination of JQuery and PHP both, although I am not sure as a newbie.

I want to use the php to display the uploaded files inside div possibly by using a for loop, and the recently uploaded files to appear in the (newest first) order. My html file code is also given.

I am using PHP as my back-end. Help will be appreciated. Thanks in advance.

//my php file//

<?php 

$resource = opendir('resources/uploadFiles/');

//loop for all files
while(($entry = readdir($resource)) !== False) {
if($entry !='.' && $entry !='..')
{
echo($entry)."<br />";
}
}
?>

</div>
enter code here
$("#getFile").html('');
$("#getFile").html('<video src="address of the uploaded-folder on server" controls></video>');

this will append new video into html. I am not sure about what you want in social sharing