How to add a video in your website : a panorama of the different solutions (Youtube, Flash, HTML5..)

Add the youtube video in your web site with the JQuery plugin fancy box

For MosaLingua, I finally choose to add the youtube video in my website, in order to save bandwidth.
But in a beautiful way (at least I hope, see the home page of MosaLingua, and click the button ‘Voir Video’) :

This was very easy, thanks to the excellent JQuery plugin fancybox :

Download the JQuery plugin here, and simply add a link to your video :

<a id=“screencast” title=“‘MosaLingua Espagnol iPhone” href=”http://www.youtube.com/watch?v=xG9kh1hDiFg“>View the screencast</a>

And the following Javascript code :

$(“#screencast“).click(function() {
$.fancybox({
‘padding’ : 0,
‘autoScale’ : false,
‘transitionIn’ : ‘none’,
‘transitionOut’ : ‘none’,
‘title’ : this.title,
‘width’ : 680,
‘height’ : 495,
‘href’ : this.href.replace(new RegExp(“watch\\?v=”, “i”), ‘v/’),
‘type’ : ‘swf’,
‘swf’ : {
‘wmode’ : ‘transparent’,
‘allowfullscreen’ : ‘true’
}
});

return false;
});

That’s it. Again, a live preview of the video in action on MosaLingua, you can check out the source ;-).

Add your own video without youtube

Ok, then you want to follow the hard way? No problem, it’s not that hard 😉

The simple code to embed the video

The following code is not working on all browser, I didn’t test on IE, but it’s working on safari, firefox and chrome :

<div class=”screencast”>
    <embed src=”screencast.mov” width=”240″ height=”355″ autoplay=”true” controller=”false” loop=”true” scale=”tofit”>
</div>

and the css code :

.screencast {
    background: transparent url(iphone.jpg) no-repeat;
    width: 291px;
    height: 546px;
    position: absolute;
    top: 30px;
    left: 30px;
}
.screencast embed {
    position: absolute;
    top: 100px;
    left: 25px;
}

The iphone.jpg background can be download in iTune connect (you must sign the Apple agreement).

This code is simple, but you are not sure it is working everywhere (need a descent browser : not IE6 and quicktime plugin)/

To be sure your video will be working everywhere, see this article : http://camendesign.com/code/video_for_everybody

Embed the flash video

I hate to say that, but currently, the only way to be sure that the video is working (almost) everywhere, you need to encod it in flash. I am waiting for html5 video implemented everywhere. I have done that for others site, and it’s pretty simple :

Convert your video into flash flv video

I use this free converter :
http://www.leawo.com/free-mac-video-converter/
It’s simple and easy.

Include the flv into your html

You need a player for that. The easiest way is to use the free and open source flowplayer. Example are in the download bundle, so it’s really simple/

Here it is, all the possibilities to include video into your website

How to create a Screencast video for a mobile (iPhone or Android) application with your Mac

I have created my first screencast for MosaLingua (only in french for now), and I want to share my experience here because I spent a lot of time searching disparate information, and with several trials and errors.

With this article, it will be very straightforward, and you will quickly create a video to promote your application

Application video recording

To have a perfect looking screencast, I followed the advices in this article : Not Your average iphone screencast.

So I used the application Simfinger to replace the mouse cursor by the circle, and to install the fake application in the iPhone simulator.

If you don’t want to spend time checking the sources on github and compiling the application, you can download simfinger ready to use here.

I did not use the fake iPhone body image of Simfinger, because I wanted to integrate the video on different mobile platform, and on my website.

To record the video of the application in action, I used the excellent Snapz Pro X to record the iPhone screen with  :

http://www.ambrosiasw.com/utilities/snapzprox/

Regarding the settings of Snapz Pro X, make sure you choose million of colour, and the max quality settings or the result will be ugly.

Video editing with iMovie

So you want to add a speech, transitions and maybe some marketing slides.

iMovie is really easy to use and included in Mac OS. It provides all feature needed to create a good screencast :

iMovie Quicktime export for iPhone:

When the video is finished, we need to export it in the right format, to be able to play it on the iPhone.

According to apple, the following compression standards are supported:

  • H.264 Baseline Profile Level 3.0 video, up to 640 x 480 at 30 fps. Note that B frames are not supported in the Baseline profile.
  • MPEG-4 Part 2 video (Simple Profile)
  • AAC-LC audio, up to 48 kHz

Movie files with the extensions .mov, .mp4, .m4v, and .3gp are supported.

See Creating Video for Safari on iPhone and Creating Content for Safari on iPhone.

In iMovie, export your movies using QuickTime Pro 7.2, as described in “Encoding Video for Wi-Fi, 3G, and EDGE,” :

Choose Share -> Export with Quicktime and change the settings :

After a lot of trials and errors, I can say that the optimal settings, in term of quality and size (6Mo for 2.5min) are :

Sorry for the french screenshot, but I don’t know how to change the language settings in the Apple applications.

Export your application screencast on Youtube

So you don’t want to waste your bandwith, and Youtube is perfect to host your video.

High quality export for youtube :

If you have a demo video of your iPhone app in 320×480 (portrait) and whish to upload it to YouTube, you should upscale it to HD. Open the video in QuickTime 7 Pro and export it as MP4 with Video Format H.264, 2000 kBit/sec, 1280×720 HD and check “Preserve aspect ratio using Letterbox”.

(from http://forums.macrumors.com/showthread.php?t=798599)

Add the video into an iPhone Web App :

To include your video in an iPhone web application, or a native application with UIWebView (with phonegap for example), you can use the html5 video tag :

<video src=”media/ScreenCast.mp4″ height=”100″ width=”100″>

Or you can also include the embed code presented by youtube. It works only on a real iPhone/iPod Touch and not in the simulator.

Add the video in your website

As you can see in the most of iPhone app websites (see for example 40 Awesome iPhone Application Websites), your site should include in the frontpage your screencast.

For better result, you need to use the video hosted in your website (control your bandwidth…), because the youtube video cannot be included in the iPhone body image.

The next article talk about the different way to include your video into your web site (hosting your own video, or use youtube), with code sample. Stay tuned.