jQuery demo + code snippet to insert a quicktime video player into your webpage dynamically. This is a raw video play with minimal controls, if you want to customise you can set the parameters in the player object quite easily. To use the code remember to change the url of the video and you’ll need a div with id=”player”. In my demo I included a screenshot of the video to use as a thumbnail but quite easily just be a hyperlink with id=”start-movie-btn”, these can be changed accordingly.

Demo

Note: You will need quicktime installed to play the movie.
piper-horse

The Code

//dynamically load in a movie using Quicktime player
(function($,W,D)
{
    var JQUERY4U = {};

    JQUERY4U.QUICKTIME =
    {
        play: function(movieUrl)
        {
            //quicktime video html
            var output = '';
            output += '';
            output += '';
            output += '';
            output += '';
            output += '';

            //insert the player
            jQuery('#player').html(output);
        }
    }

    $(D).ready(function($) 
    {
        $('#start-movie-btn').live('click', function(e)
        {
            e.preventDefault();
            JQUERY4U.QUICKTIME.play('location of movie'); //.mov .mp4 etc
        });
    });

})(jQuery, window, document);

Movie source: http://www.youtube.com/watch?v=jAqvcdiAgAA

Sam Deering is a Front-end Web Developer who specialises in JavaScript & jQuery. Sam is driven and passionate about sharing his knowledge to educate others.

Free Guide:

How to Choose the Right Charting Library for Your Application

How do you make sure that the charting library you choose has everything you need? Sign up to receive this detailed guide from FusionCharts, which explores all the factors you need to consider before making the decision.


  • phomsopheak

    why no download and also no full description

Learn JavaScript for free!
Free course: Introduction to JavaScript

Yours when you take up a free 14-day SitePoint Premium trial.