tags:

views:

104

answers:

5

I want to write a Flash applet(or any other possible app) to embed in my website that will play part of a video (for example: from the 0:20 to 0:40). The video is in MPEG format. I'm new to Flash - any suggestions on how to get started on this?

+2  A: 

Well if you are referring to YouTube videos, then Splicd is an online web service that lets you cut the part of video of your choice.

TStamper
hehehe, the revision list is hilarious. So close each time...
Adam Davis
I am referring general videos such as a MPEG format video
Lily
A: 

You can't do it unless you extract just that section or write a tool to play FLV files with actionscript (which can programmatically move through the video)

altCognito
A: 

Youtube allows linking to a specific point in time in the video by appending this to your link: “#t=1m45s”, for example:

http://www.youtube.com/watch?v=1bibCui3lFM#t=1m45s

This blog post also shows an example of how to embed it in your site, with the specified starting point in time:

<object width=”425″ height=”344″><param name=”movie” value=”http://www.youtube.com/v/Z_zxRAfAWug&amp;hl=en&amp;fs=1&amp;start=20“&gt;&lt;/param&gt;&lt;param name=”allowFullScreen” value=”true”></param><embed src=”http://www.youtube.com/v/Z_zxRAfAWug&amp;hl=en&amp;fs=1&amp;start=20” type=”application/x-shockwave-flash” allowfullscreen=”true” width=”425″ height=”344″></embed></object>
Yevgeny Doctor
+1  A: 

Well, if you're new to flash (as the edit says;) ), this might be a bit too complicated to explain it all here, but what you'll need to do is write a custom flv player using NetStream, and make sure your flv's (or other video media) are hosted on a rtmp server (media temple has a cheap one if it's just for personal use) you can then call netStream.play(flvName, startPosition); and add a listener to stop it when it reaches the point you wanted to stop it at using a cuePoint.

There's an example here: http://www.actionscript.org/forums/showthread.php3?p=875934

quoo
It works! Thanks~
Lily
A: 

You have a couple of options:

  • You can split your video offline to the fragments you want, and serve them over http to standard FLVPlayback/VideoPlayer component. This is pretty straightforward, but won't allow you to choose how to segment the video on the fly (at serving time). This is because using HTTP, you have to start downloading the video from the start.
  • You can use Flash Media Server, or an open source equivalent (such as Red5) to stream the video over RTMP, which will allow you start downloading/playing the video from any keyframe.
  • You can use youtube, as suggested by other answers.
Scotty Allen