Saturday, January 10, 2009

Make Your FLV Playable in iPhone iMobileCinema

If you host a flash video site, you can make the flv file playable on iPhone by adding some html codes.

The simplest way is writing a embed tag like this,
<embed src="" type="application/x-shockwave-flash" width="320" height="240" flashvars="file=URLEncoded_FLV_File_URL&image=URLEncoded_Thumb_Image_URL"></embed>

e.g., if the flv file url is, and thumbnail image url is, the embed tag should be like this,
<embed src="" type="application/x-shockwave-flash" width="320" height="240" flashvars=""></embed>

The source swf is a fake swf file for triggering iMobileCinema only. So we recommend that the embed tag code should be showed on iPhone only. You can detect the device by checking User Agent, or using javascript.

HTTP redirection is supported, so if your embed src is, and is 302 redirected to
It will work like the previous example.

An advanced usage is using req argument instead of file argument. This is useful if you want to generate different flv file urls, for mirror sites or temperory files. e.g., if your flashvars is
The result of will be used as flv file url, which should be plaintext.


Beloko said...

Hello, I would know how to update the flashvars value field in the embed tag with a new video URL by using a Javascript ... to have something like a dynamic video Flash player. Is this possible and how ?

habla said...

Youtube, dailymotion, etc all work fine. I tried to use the embed code on my server to play a flv file but I got a blue box.

Krewx said...

How can i use the code for embed videos like megavideo, because i can't play it on the iphone xD


Paolo said...

Very usefull, but...
It works with flv video.
Is it possible to play realtime video connecting to a flash media server in rtmp?
Thanks again!!!

Luis Edgar said...

Does this support the rmtp protocol?

yili360 said...

@Paolo, Does your problem still exist? Or have you figured it out? If yes, then how? Kindly share the solution! flv to dvd

zieg mian said...

Ah, sad to see the post so works for me.convert avi to mp4