Jump to content
GreenSock

Nickbee

Using a LoaderMax video player with streaming video?

Recommended Posts

I’ve seen the posts that say this class is for loading, not streaming. I’ve also seen the comments saying it’s possible but why bother using a loading class if you are not loading anything?

 

My comment to that is let’s say I developed an awesome video player based on LoaderMax. It’s configurable from flash vars, it’s scalable to any size movie (without republishing) and it’s VERY easy to skin. So let’s say I want to take all the hard work I put into this player and instead of loading an FLV I want to point to streaming content. Is this possible? Will all my seeking script still work? Can someone point me to how the syntax might look?

 

Ultimately I would love to add another flash var, something like “isStreaming” to shift the player to streaming mode.

 

THANKS!

Link to comment
Share on other sites

I see the dilemma, yes. But the challenge for me is that I need to protect VideoLoader from a serious case of feature bloat. I try to do this in all GreenSock tools - it's a balancing act between a robust feature set, tight file size, and outstanding performance. Most developers seem to really appreciate how tight things are compared to the bloated monsters out there. If I add streaming-specific features to VideoLoader, I'd want to do it with excellence which means a lot more code (and consequently kb). Seeing as how streaming video won't generally allow full preloads and VideoLoader is, at its core, about downloading/preloading files, it just doesn't feel like a good fit to me. I'll keep it in mind, though, and maybe at some point I'll see the light. :)

 

At its heart, VideoLoader uses a NetStream. Typically it creates its own and manages things for you, but you can use the "netStream" special property in the vars parameter to define your own. Like new VideoLoader("myVideo.f4v", {netStream:myNetStream}). Then you could use VideoLoader to load and control things, but I haven't done testing on a streaming video so I can't guarantee that'd work. If you run into trouble or have specific suggestions to make it easier, just let me know.

Link to comment
Share on other sites

Thanks for the reply and that makes perfect sense.

 

I will try passing a netStream object to the videoLoader and reprot back the results.

 

Here's a question regarding your loader class and file size...

If you made the streaming video element a separate object in LoaderMax, like "videoStreamer" wouldn't that prevent from adding bulk to LoaderMax or videoLoader if "videoStreamer" is not used? Just curious as it would be great to have LoaderMax ease for setting up and playing streaming content.

 

Thanks for all your help!

Link to comment
Share on other sites

Yep, splitting it apart into a different class like StreamingVideoLoader would avoid the kb issue, but it would create another one - how would LoaderMax.parse() figure out which type of video loader to use for various video files (.mp4, .flv, .f4v, .mov)? If there are two loaders that both handle the same types of files the API would need to change somehow to allow you to tell it which ones to map to which loader type, although one thing it could look at is whether or not the URL starts with rtmp:// but this is still a bit of an issue. If you never use parse(), you'd never see the problem though.

 

I'll keep this suggestion in mind. I've got LOTS of things on my plate and ideas that I want to implement so I've got to prioritize the ones that I think will benefit the most GreenSock users. Please keep the suggestions coming.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×