Easy Video Embed

The form below is an easy way to get the right code for embedding a video. For more information about each option, find the appropriate section below.

Extra Instructions:

Code:


Embedding MP3 Audio

To embed an MP3 file, you can use Google’s audio player. Just copy the code below and paste it in the code for your survey page, right where you want the audio player to appear. Then replace both URLs in red with the URL of the audio file: <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="27" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"> <param name="flashvars" value="audioUrl=http://artsresearch.uwaterloo.ca/~j4hughes/mp3/audio_file.mp3" /> <param name="src" value="http://www.google.com/reader/ui/3523697345-audio-player.swf" /> <param name="quality" value="best" /> <embed type="application/x-shockwave-flash" width="400" height="27" src="http://www.google.com/reader/ui/3523697345-audio-player.swf" quality="best" flashvars="audioUrl=http://artsresearch.uwaterloo.ca/~j4hughes/mp3/audio_file.mp3"></embed> </object>

Please note: Your URL must be the complete URL to the file (“http://” and all), and cannot have any spaces or funny characters in it. Hyphens (-) and underscores (_) are okay.

If you want to make your video start as soon as it loads, add this to the end of both URLs: ?autoPlay=true

Embedding Other Audio

If you have an audio file that is not in MP3 format, your best bet is to convert your file to MP3. A couple online converters can be found here and here.

If you really need your audio file to be in its original file format for some reason, email me (Jeff Hughes), and we can try to find a good audio player that will suit your needs.


Embedding a YouTube Video

To embed a YouTube video, just copy the code below and paste it in the code for your survey page, right where you want the video to appear. Then replace the URL in red with the URL of the video: <iframe width="420" height="315" src="http://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allowfullscreen></iframe>

If you want to make your video start as soon as it loads, add this to the end of the URL: ?autoplay=1
Or, if your URL already has a question mark in it, add this instead: &autoplay=1

Please note that if your survey is using a secure server (signified by a URL starting with “https” instead of “http”), you will need to use a secure URL for the YouTube video. Just change the “http” to “https” in the URL.

Embedding a Vimeo Video

To embed a Vimeo video, just copy the code below and paste it in the code for your survey page, right where you want the video to appear. Then replace the URL in red with the URL of the video: <iframe src="http://player.vimeo.com/video/11712103" width="400" height="320" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>

If you want to make your video start as soon as it loads, add this to the end of the URL: ?autoplay=1
Or, if your URL already has a question mark in it, add this instead: &autoplay=1

Please note: Vimeo has no easy way to use a secure connection for its videos. This means that if your survey is using a secure server (signified by a URL starting with “https” instead of “http”), your participants may get warning messages about insecure content – which might freak them out! If you want to use the secure connection for your survey, you are best to use something other than Vimeo.

Embedding Other Video Files

If you have a video file that you don't particularly feel like uploading to YouTube, you can use JW Player, a free video player. It supports a number of video formats: .mp4, .m4v, .f4v, .flv, and .mov (not recommended).

To use this player, download this zip file and unzip the contents into the same file directory as your survey pages. Then paste in the code below for your survey page, right where you want the video to appear, and replace the filename (in red) with the name of your video: <div id="video_container">Loading video...</div> <script type="text/javascript" src="jwplayer/jwplayer.js"></script> <script type="text/javascript"> jwplayer("video_container").setup({ flashplayer: "jwplayer/player.swf", file: "video.mp4", width: 400, height: 320 }); </script>

If you want to make your video start as soon as it loads, add this to the end of the list of parameters (don’t forget to put a comma at the end of the previous line!): autostart: true

JW Player has a number of more advanced options to control your video, if needed.

Embedding Audio/Video in SurveyMonkey

To embed audio or video into a SurveyMonkey survey, most of the above codes will work as is. Just click “Add Text” and then copy and paste the desired code into the box. The only one that won’t work is the JW Player code. You may use the code below instead. For this, you will not need to download the zip file. You just need to insert the complete URL of your video file in the two places below: <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="470" height="320" id="video1" name="video1"> <param name="movie" value="http://www.jeffhughes.ca/survey_scripts/downloads/player.swf" /> <param name="flashvars" value="file=http://artsresearch.uwaterloo.ca/~j4hughes/survey/videos/video.mp4" /> <param name="allowfullscreen" value="true" /> <param name="allowscriptaccess" value="always" /> <param name="wmode" value="transparent" /> <embed type="application/x-shockwave-flash" src="http://www.jeffhughes.ca/survey_scripts/downloads/player.swf" flashvars="file=http://artsresearch.uwaterloo.ca/~j4hughes/survey/videos/video.mp4" id="video1" name="video1" width="470" height="320" bgcolor="#000000" allowscriptaccess="always" allowfullscreen="true" /> </object>

If you want to make your video start as soon as it loads, add this to the end of both video URLs: &autostart=true