How To: Adding Embedded Movies to Domiono Pages - With Demo
Karen and I watched The Apprentice last night when we went to bed. We don't have a TV in the bedroom though and we didn't watch it at its 9pm slot as I was busy getting the new office ready for the plasterer, who's here today. Instead we watched it at a time that suited us in a place that suited us (we've gotten in to the naughty habit of watching DVDs in bed instead of reading a book). All this thanks to the BBC's iPlayer.
All the TV stations here in the UK seem to getting in to streaming their programmes once they've aired and letting you "catch up" for a week or so after. It seems like the internet has gone streaming mad. Some say it will choke it to death.
Whether or not all this streaming media is a bad thing for the web, it's obviously what the people want. So where does that leave us Domino developers when we're asked to "add YouTube" to a Domino-based sites?
This is something I was asked to do recently. A customer wanted to embed movies in the news items on their site. Although I knew this would be possible and was sure there be an off-the-shelf Flash player available I didn't realise just how easy it would be. Adding embedded movies to Domino pages is so easy.
The first thing you need is a player. The best I could find was the JW FLV Media Player. The best part about it being that it's free (buy a licence and the right-click "about" menu goes).
Once downloaded all you need to do is import the SWF for the player in to your database's design and follow the site's instructions on how to set it up. Once you have it on your form you just need to tell it what file to play. The bit I was initially unsure of was whether it would play a file that was attached to the document itself. No reason why it shouldn't, but I just wasn't sure it would. So, I configured it to use the first attachment it found on the document and, hey presto, it worked.
You can see the player playing a file attached to a Notes document in this demo. View the source to see how it's configured. So easy and so, so cheap.
The second thing you need is a way to convert movies to the FLV format, which has a 99% chance of being playable by the user's browser.
To do this I bought a copy of On2's Flix Standard for $39. The interface is a bit clunky but it does the trick and converts all the common video formats to FLV.
And that's it! The simplest way to embed movies in your Domino applications. It couldn't get any simpler than that.
The third thing you need to do is give the site's authors a way to upload and place the movies within the document's "body" field at a point of their choosing. This is the bit I'll be on with next and I'll let you know how I get on. I'll probably be writing a plugin for the TinyMCE editor if one doesn't exist already.
Note: I used the term streaming liberally in the above post, although I'm not sure it is streaming in the truly technical sense. You get what I mean though, right...
Do you mind sharing the database in the demo?
I don't mind Robert but it would be easier for you to recreate it than for me to share it. There's nothing to it at all.
Jake
Hello Jake
Riva FLV Encoder is a free convertor
Check out 'Anarchy Media Player'. It is a combination of the above FLV player and some JavaScript and a few other bits and bobs.
It will allow you to just add a link to the media on your webpage and the scripts will replace the links with the code for the correct player so you have more options on media types to display. ( Mp3, FLV, Mov, Wmv etc ).
I added this to BlogSphere V3 beta 8, although I did update the individual components in AMP to their latest versions to make it better.
I've hosted video that was fed from my Domino host but it was slow and cost me the bandwidth. I've found it much easier to use one of the many free web hosting services.
You will find a mix of videos on my web site hosted by several services, but I've been using blip.tv for the most part. Click on the "News" link for the latest stuff.
Here are the steps I suggest:
1. Go to blip.tv and set up a free account.
2. Upload your video in whatever format you have. They will convert it to Flash.
3. Go to your blip.tv show page. For example, mine is shaverassociates.blip.tv.
5. Click on the "Syndicate Show" button.
6. Configure the player and click the "Update Player Code" button.
7. Copy the HTML embed code and paste it into your web site.
On my web site the pages have a rich text field. I edit that in my Notes Client, paste the HTML embed code into it and then mark it as Pass-through HTML. (I do put <center> tags around the code too.)
The good part about doing this is you make it easy for anybody to embed your video in their web page. That's what makes it possible for it to become "viral". Just be sure to put your web site URL in the video's credits or visible somewhere.
Oh and blip.tv has lots of features to help distribute your video to other places. For example I record and upload the Sunday talk from our church and blip.tv sends it on to the church iTunes account. Most of our listeners come through iTunes.
Feel free to contact me directly if you want more info.
Peace,
Rob:-]
Jake,
If you want a way to play movies without the pain of re-jigging your page layouts (to add an area for the player), check out ShadowBox at {Link}
One of the coolest components I've seen in a long time.
Funny as was just looking at that very same package this week too.. the other one to take a look at is flowplayer.org
I've got JW's picking up a list of media files to play and rotate based on an XML view that domino generates (using rss categorised view feed based on ferdys blogo not (wqofeed) ).
I see you got the swfObject working also. Good work.