Franklin Vaz
Franklin Vaz

Reputation: 19

How to retrieve videos from server and play it onclick?

I am doing a tutorial website project. In this i hav a video player at the right side, and vertical menu at the left side of the page. I hav lots of videos to put in. I am trying to play the videos in the same video player in the same page. How to retrieve videos from database and play it onclick from menu?

I am using video tag for video player. Also i wanted to display the video name at th bottom of the video player in the page, that changes for every videos. Like youtube website!!. I am using Wamp local server. Below is the code for single static video and video name.

<div class="video" align="right"><video id="movie" class="video" width="800" height="520" title="franklin" data-uid="movie" controls poster="images/LMS.JPG"><source src="videos/Learning Management System.mp4" /></video></div>

<div id="video_heading"><p><b>Introduction to Learning Management System</b></p></div>    

How to make use of database system to retrieve the video and name of the video using PHP. Please help. I am desperately in need of someone's help.

Upvotes: 0

Views: 1565

Answers (1)

jeffjenx
jeffjenx

Reputation: 17457

Use AJAX to send a request from JavaScript to your server to retrieve the correct video information from the database and return it in a format that you can use, like JSON. Then, using the response data, update your video object and other DOM elements accordingly.

Upvotes: 1

Related Questions