today I will continue on this topic:
and the following installments are here:
In the first part I only discussed the essentials for playing an FLV. Today I will show how to build a re-usable class around those basic ideas. At the end of this tutorial you will have a solid set of classes (3) that you can reuse as a base to play FLV videos in all your widgets.
There will be three classes involved in the development today:
This is a gross preview of where we are heading at:
Will hold the basic information about the FLV to be played: it’s height, width, duration, uri, image to represent it, and title
Will play the actual FLV, using the MediaData object as input, and dispatch MediaEvent’s to inform the outside world of what is going on.
Hold information to be received by the outside world, updating the status on what is happening in the FLVPlayer
This is a simple class, whose role is simply to hold the information on a particular FLV file. It contains:
The FLVPlayer is the core where all the action happens. First let’s start with the most important functions:
For an explanation of the code down here, please refer to the first part of the tutorial, which covers the basics. Note that if you want efficient loading of FLV’s one after the other, where it’s possible that the first one is not completely loaded yet when you want the second one to start playing (each new video replacing the old ones) it’s important to close the NetStream then the NetConnection, and start over with fresh ones (from my experience).
Now we can tackle the rest…
and finally the event handling function
finally the function to push a status code, and analyze the log
The rest is here: Tutorial – Playing FLV video in plain AS3 – Part 3
great tutorial !!!
most comprehensive tutorial I have seen on this! any sign of a follow up?
Great tutorial, do you think you’ll have time to complete the next bit soon? 🙂
Keep up the good work!
Will the tutorial on the Event class be finished?
hello, everyone! I am making a flv video player.I want to complete that click anwhere then play at the position but not care if the position in the buffered scope, I use NetStream.seek(minute), but this only userfull int the buffered scope, can anyone help me? thanks .