| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
rather be programming
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
|
Hi Guys,
I'm okay with code, so I'm not asking about that. However, I'd like to get a little help with coming up with a OOP structure for a video player; you know, just the standard youtube player. From what I've learn so far I can rule out the use of several patterns: Factory - doesn't seem to be any need for a factorySo that leaves me with: Observer - this is built into the way flash event handlingBut I also want to keep in mind (and what I haven't in the the past) is "A class should have only one reason to change" e.g. 1 class 1 job. Could I get some help how to make a OO video player Cheers ![]()
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman |
|
|
|
|
|
#2 |
|
rather be programming
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
|
I've just started reading about MVC, and that seems like the perfect design. Though I'm up for discussion.......
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman |
|
|
|
|
|
|
|
|
#3 |
|
rather be programming
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
|
Well....i think I'll do it 2 ways for fun:
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman |
|
|
|
|
|
#4 |
|
Registered User
Join Date: Jan 2006
Posts: 10
|
I am working on the same project. How has it been going?
I definitely see using the state pattern, but I'm not sure exactly how it fits into an mvc pattern. For example, I'm thinking that the model would be the context in the state pattern, and that the controllers would be the states. The view would be the user interface. Would each ui element be a view? I'm working on the code but I'm not sure how it will all work in the end. Is there a pattern for the views calling the controllers? Or do you just hard code that in, since you're dealing with ui elements using flash event handling? Also, I'm looking at using the Observer pattern as well. The model would be the subject in the observer pattern, with the views being the observers. Last edited by m23; 10-22-2007 at 06:39 AM.. Reason: forgot something |
|
|
|
|
|
#5 |
|
rather be programming
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
|
on the adobe site, they have a tutorial how to do it as a state pattern. It looked pretty stupid to me. The MVC turned out great.
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman |
|
|
|
|
|
#6 |
|
Registered User
Join Date: Jan 2006
Posts: 10
|
So which patterns did you use?
Also, why did the state pattern not work for you? (I'm not looking to debate any particular pattern, just curious about your experience.) Last edited by m23; 10-23-2007 at 06:13 PM.. |
|
|
|
|
|
#7 |
|
rather be programming
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
|
Adobe State Pattern Tutorial
I used MVC. State Pattern doesn't make sense to me for this. There really are no "states" for a video player.
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman |
|
|
|
|
|
#8 |
|
Registered User
Join Date: Jan 2006
Posts: 10
|
I'm guess I'm looking for various code examples. So you used an mvc framework like this? Colin Moock provides some class files for implementing mvc.
http://www.adobe.com/devnet/flash/ar...ontroller.html If you could post any example code, I would greatly appreciate it! Can I see your video player online as well? Let's see your handy work ![]() |
|
|
|
|
|
#9 |
|
rather be programming
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
|
The video player is propritary. I can't give you any help there, other than just guiding you.
Your best best is just to start coding it in several pattern and find the limitations yourself. For me and what I wanted, MVC made the most sense. You may have different needs.
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman |
|
|
|
|
|
#10 |
|
Registered User
Join Date: Jan 2006
Posts: 10
|
Not looking for anything for free. Just some code examples. So I didn't mean to imply that. I couldn't post any code from actual production projects either.
If anyone would like to post some examples of design patterns they have used and found suited to a video player, I would appreciate it. For example, to me, in the mvc pattern, it makes sense to use the observer pattern between the view and the model, with the model being the subject and view being the observer. So, within mvc, there are multiple design patterns used to implement mvc. That's my understanding. I working this out in uml and I would be glad to post selected examples later. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to detect video stream freeze in player | jgpandit | Flash 8 General Questions | 3 | 07-30-2007 04:27 PM |
| Building a Custom Multi-Video Player | senan | Components | 0 | 09-22-2006 03:05 PM |
| Custom FLV Streaming Video Player - Smooth Scrub/Seek Needed | jrock | ActionScript 2.0 | 4 | 07-24-2006 06:32 PM |
| video buffer not behaving in Firefox with player 7 | sho nuff | ActionScript 2.0 | 0 | 04-24-2006 08:55 PM |