Jump to content
Search Community

PreLoad Video With VideoLoader circularly got videoTime always 0

wangzf test
Moderator Tag

Recommended Posts

Thank you in advance for reading.
In my Player, I preLoad videos with two VideoLoader circularly from Flash Media Server.
Init code as:

videoLoader = new VideoLoader("flv:Y/sample", { autoPlay:true, x:150,y:200,netStream:_ns,container:this,width:200,height:150} );
videoLoader1 = new VideoLoader("flv:Y/bikes", { autoPlay:false, netStream:_ns1,container:this,width:200,height:150} );

The first loader loads a video with autoPlay=true,the second loader loads another video with autoPlay=false.
When the first loader play complete, I call the second loader playVideo(). Meanwhile, let the first loader do the followings:

videoLoader.unload();
videoLoader.vars.autoPlay = false;
videoLoader.url = "mp4:Y/mp4.mp4";
videoLoader.load();

But two problems bother me a lot:
1.After one play circulation, the loaders return videoTime always 0.

Do i have to create a new NetStream and pass it to the loader everytime?
2.Playing a .flv video preloaded would only see first few frames ,and then quickly to the end.
Playing a .mp4 video preloaded was normal.
I debugged into the VideoLoader's source code, _forceTime was 0.

The comment says waitForRender,but how can I let the NetStream dispatch RENDER Event?

 

Plz help!

Link to comment
Share on other sites

Are you saying that you expect a VideoLoader to maintain the playhead position even when you completely change the video (url)? If so, I think that's neither possible nor wise - what if the video is shorter? Plus, in order to get the playhead to a certain position, it must have rendered (and loaded) that far. 

 

Also, you mentioned that you're using Flash Media Server - are you aware that LoaderMax/VideoLoader is only for progressively downloaded videos (mentioned in the docs)? Flash Media Server is for streaming (generally) which isn't supported. 

  • Like 1
Link to comment
Share on other sites

Thanks a lot Jack!

I am really not aware that VideoLoader is only for progressively downloaded videos!

 

Create the NetStream manually and then feed it to the VideoLoader through the vars object (it recognizes a "netStream" property) like:
var loader:VideoLoader = new VideoLoader("flv:Y/sample", {netStream:myNetStream});

The above code worked, so I thought VideoLoader support Flash Media Server streaming videos.

 

I know it's not that easy, but do you have any plan on implementing  greensock  to work with Flash Media Server streaming videos wonderfully?

 

By now, I'll get back to working with NetStream to play videos streaming from FMS.

Thank you again for your GreenSock, it is really amazing!

Link to comment
Share on other sites

I know it's not that easy, but do you have any plan on implementing  greensock  to work with Flash Media Server streaming videos wonderfully?

 

Sorry, but no, we don't have any plans to do that sort of thing. The playback features of VideoLoader were really just meant to be icing on the cake - the whole LoaderMax library was built to solve problems with progressive loading of assets. 

 

Enjoy!

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.
×
×
  • Create New...