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.


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

The Code

//dynamically load in a movie using Quicktime player
    var JQUERY4U = {};

        play: function(movieUrl)
            //quicktime video html
            var output = '<object width="640" height="360" id="qt" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" style="float:left; left:0; position:relative; top:0;">';
            output += '<param name="src" value="'+movieUrl+'"/>';
            output += '<param name="autoplay" value="true"/>';
            output += '<param name="controller" value="false"/>';
            output += '<embed id="player" name="player" src="'+movieUrl+'" bgcolor="000000" width="640" height="360" scale="ASPECT" qtsrc="'+movieUrl+'"  kioskmode="true" showlogo=false" autoplay="true" controller="true" pluginspage="http://www.apple.com/quicktime/download/"/>';
            output += '</object>';

            //insert the player

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

})(jQuery, window, document);

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

Sam Deering Sam Deering
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.

  • phomsopheak

    why no download and also no full description

Related books & courses
Available now on SitePoint Premium

Preview for $1