Be the first to write a review
Video Streaming with an AJAX Video Gallery Part Three
Welcome to part three of the video streaming tutorial. In part two we got the JavaScript file including the main AJAX function written and working, and added some CSS to position our player selection buttons and logo's. This part of the tutorial is going to finish the tutorial with some more CSS to style the AJAX-generated buttons, write the server-side ASP code that returns the list of available files in the chosen format and add a function that plays another video when its button is clicked. We'll begin with the ASP code.
A Little ASP
As wonderful as our AJAX is, it won’t do anything without the data returned from the server and in order to generate that data, we need some script to run on the server. ASP provides exactly the functionality we require and can happily run on the server and pass the required data back to the AJAX function. One simple function in our ASP file will do everything we need. In a text editor, begin by opening the ASP file and setting the variables the function will need:
<%
dim fs,fo,x
Dan Wellman
Dan Wellman is an author and web developer based in the UK. Dan has written three books so far; the latest, jQuery UI 1.7: The User Interface Library for jQuery, was released at the end of 2009.
Dan has been writing web development tutorials for over 5 years and works by day for a local digital media agency in his home town of Southampton.