Home mail me! Syndication

Peng

This is my collection of How To …






How to embed and play part of a video from the internet?

How to embed and play part of a video from the internet?

This came up recently from a friend’s request. It got me stumbled for a while; I’ve been embedding Youtube videos and we all know how to do that with the Youtube widgets for WordPress. But how to embed and play part of a video from the internet is something I have not done.

So I Google around and voila! there was indeed such controls. Below is the code that would do just that:

<_object classid=”clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B” codebase=”http://www.apple.com/qtactivex/qtplugin.cab” height=”400″ width=”450″>
<_param name=”src” value=”http://content5.catalog.video.msn.com/e2/ds/3ad3256e-86f7-46ee-b853-0d785427db29.mp4″>
<_param name=”scale” value=”aspect”>
<_param name=”controller” value=”true”>
<_param name=”autoplay” value=”false”>
<_param name=”STARTTIME” value=”00:08:29:01″>
<_param name=”ENDTIME” value=”00:11:51:01″>
<_embed type=”video/quicktime” pluginspage=”http://www.apple.com/quicktime/download/” src=”http://content5.catalog.video.msn.com/e2/ds/3ad3256e-86f7-46ee-b853-0d785427db29.mp4″ scale=”aspect” controller=”true” autoplay=”false” starttime=”00:08:29:01″ endtime=”00:11:51:01″ height=”400″ width=”450″>
<_/object>

If you cut-and-paste the above lines of code, do remember to remove the single underscore character after each < character. The space was inserted so that the browser won’t process the code. I tried using the code tags in WordPress, but it does not display properly.

The “src” value is merely the URL to the video stream. Here I am using the Quicktime Player to provide the controls. I’ve not tested the same codes for Windows Media Player or any other video players. The values for the STARTTIMEENDTIME is in the format of HH:MM:SS:Frame.

Remember to cite the video correctly for copyright and place a back link to the actual web page.

And if you want the video to autoplay, just change the corresponding value from “false” to “true“. And you can even add a ‘@HH:MM:SS:Frame‘ to the autoplay value to instruct Quicktime to preload an amount of video before starting to playback. I like this a lot, for users with lower bandwidth and to ensure that when they view the video it would playback at a reasonably smooth manner, this value could be tuned.

References:
developer.apple.com
purdue.edu

Sample video of the above code:


Original Video Source at XINMSN: Click Here to View
Show Me The Money: Episode 7
4 hosts takes on the role as women from different levels of the social hierarchy: A ‘Tai-Tai’ who leads an extravagant lifestyle (Belinda Lee), a single OL who spends every single cent of her salary by month-end (Pat Mok), a calculative housewife (Kym Ng) and a hardworking hairdresser (Quan Yifong) from neighbourhood salon.
Published: 23/6/11
Network: Channel 8