Jump to content
Search Community

Asking for media state

Sam test
Moderator Tag

Recommended Posts

Hi Greensock,

 

I was looking over using your VideoLoader as a replacement for the spark VideoPlayer and had some questions for you:

 

1) I was not able to find an equivalent to the mediaPlayerState call on the VideoPlayer. I am using this to verify that the video is acting appropriately in conjunction with other motion on the stage. I periodically inspect it to make sure it has not slipped into an unexpected state, particularly something other than 'playing' once I have told it to play. Am I just missing your version of this?

 

2) Failing to get the high level view into the player state, is there an accessor that I could use to push the loaded video into the spark video player? I like the loader itself and am forcing the videos to be fully downloaded before allowing their use. My little glance at this didn't yield promising results though.

Link to comment
Share on other sites

1) Are you just wanting to determine if the video is paused or not? If so, there's a "videoPaused" property you can inspect.

 

2) I'm not familiar with the Spark VideoPlayer (I try to avoid Flex), but if you need to access the VideoLoader's NetStream, you can do that using its "netStream" property, and the Video to which the NetStream gets attached is the VideoLoader's "rawContent".

 

Does that help?

Link to comment
Share on other sites

Not just paused, really I am looking for playable but not playing. I have run into a number of cases where the video slips off the rails and needs to be prompted to get back to the correct frame and play. Particularly if you tell the player to seek or pause often. Try it.

 

I have been delving a little bit deeper into what the mediaPlayerState is doing and it's all coming from the org.osmf.media.MediaPlayer which is just an EventDispatcher wrapper on the media. It looks like there is several layers of logic that sit on top of the net loader. Have you done any experiments with the osmf libraries?

Link to comment
Share on other sites

Nope, I haven't experimented with OSMF mostly because the solutions I've seen from Adobe like that tend to be massively bloated and overarchitected. Just look at Flex. The goal with LoaderMax was to pack a bunch of functionality into a relatively tiny footprint that's clean and efficient. That's not to say OSMF is "bad" - sometimes a big framework is useful.

 

As far as checking to see if the VideoLoader's NetStream is playable, there are several things you can inspect, like its bufferProgress, progress, videoPaused, and status. Of course you can listen for the various events it dispatches too in order to stay informed. See the ASDocs for details. (you know about those, right?)

Link to comment
Share on other sites

Yep. I was looking at reproducing the issue, where a video would hang when a user clicked restart or play / pause a couple times, in an example for you but have not been able to isolate it. I suspect I am doing something to 'help' the flex component that I may not need any longer.

 

If I discover something I will pass it along.

 

Thanks for your time.

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...