Recommended Posts

I have a slideshow where each slide can be a video, swf, image ect. Each video slide is a VideoLoader instance and has its own video player.

 

So I am running into this issue where if I watch one video slide and then navigate to another video slide when I hit the play pause button it stops the current video and starts playing the previous slide's video. So its like there are 2 streams currently in memory. So I thought that what I needed to do was on transition out of a slide I should close the netstream for the video slide I am navigating away from. Like this

 

 


public function disableMedia():void {
  _player.playPause();
  _player.videoLoader.gotoVideoTime(0);
  _player.videoLoader.netStream.close();

}

 

But because (I think) I am taking a bitmapdata snapshot of each slide to handle some transition effects between slides netStream.close() causes a Sandbox Violation error.

 

 

SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: file:///D|/Media%20Prime/Gaia/deploy/swf/intro.swf cannot access null. No policy files granted access.
at flash.display::BitmapData/draw()
at com.jammin.slideshow.view::SlideshowView/updateMedia()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.jammin.slideshow.model::SlideshowModel/changeMedia()
at com.jammin.slideshow.controller::SlideshowController/mediaLoaded()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.jammin.services::LoaderMaxService/mediaLoaded()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.greensock.loading.core::LoaderCore/_passThroughEvent()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.greensock.loading.core::LoaderCore/_completeHandler()
at com.greensock.loading::VideoLoader/_enterFrameHandler()
NetStatusEvent. code: NetStream.Seek.Notify

 

 

 

Now I only get the error when I try to close the stream. Otherwise I am able to take a snapshot of the video on transition out with no problem.

 

So maybe I am not approaching this problem the right way. And I am not sure if it is an issue with Greensock Loading classes or Flash video classes.

Share this post


Link to post
Share on other sites

Why are you closing the NetStream? That's probably the cause of the problems, especially if you're trying to capture a BitmapData on a closed NetStream.

 

In general, I wouldn't recommend hijacking the netStream and trying to control it yourself. Instead, I'd rely on VideoLoader's methods/properties.

Share this post


Link to post
Share on other sites

Why are you closing the NetStream? That's probably the cause of the problems, especially if you're trying to capture a BitmapData on a closed NetStream.

 

In general, I wouldn't recommend hijacking the netStream and trying to control it yourself. Instead, I'd rely on VideoLoader's methods/properties.

 

Ok but I only tried to shut down the stream in the first place because I am having the issues with mulitple streams playing at the same time. Like I mentioned if I go to a different video slide and then I hit the play/pause button the current video slide stops playing but the previous video slide starts, so although I am not seeing the previous video I can hear it playing, which lets me know that the previous video slides stream is still active right??

 

This may help some. Each video slide carries with it a unique VideoLoader as well as a unique instance of my custom VideoPlayer class (which handles the video controls logic and skinning of the video player)

 

So how would you recommend handling this issue with the multiple streams, if that is what the problem really is. How do you disable and active video streams with VideoLoader. Hope some of this is making sense and you can see what problem I am trying to solve here.

 

thanks ;)

Share this post


Link to post
Share on other sites

Don't you pauseVideo() the VideoLoader(s) that you don't want playing? It sounds like maybe you left them playing and that's why you're hearing them (and performance would degrade).

 

There's a tutorial that uses multiple VideoLoaders here:

http://active.tutsplus.com/tutorials/actionscript/smart-as3-video-loading-with-greensock-loadermax-free-active-premium/

 

And it juggles between them, fading one to the other. Does that help?

Share this post


Link to post
Share on other sites

Hi All!

 

I' m new to this forum and Greensock also! I´m facing the same problem here.

The link you are pointing is dead... and the only reference I found about crossfading videos was

 

http://codeknow.com/opensource/videoLoader/

 

But there are only chunks of code, a nice start tough. I face the same issue, all videos starting at once, no matter they are loaded  in xml with property autoplay="false"

 

I´m not sure about loading all videos at once is a good approach anymore. My guess is stick with two, one playing the other buffering and so on.

 

Any suggestions or pieces of code would be great help!

 

Cheers!

Roberto.

Share this post


Link to post
Share on other sites

Hi Apri3d,

 

Welcome to the forums. Please understand you are responding to a post from 2012.

We haven't actively developed LoaderMax in years. We just don't have the resources to actively support our tools from the Flash days.

The market has demanded that we give HTML5 our full focus. 

We still make LoaderMax available to use but we rely on the documentation (which is packed with sample code) for helping people get started.

 

If you believe autoPlay:false is not working, you can create a very simple example (2 small videos max), zip it and post it. We will do our best to take a look.

We aren't aware of any bugs in LoaderMax at this time. 

Share this post


Link to post
Share on other sites
Thanks Carl for your feedback!

 

I know I´m a bit out of time... But I have developed a few years ago a kiosk that shows pictures and videos at a scheduled time. It still works, but video transitions were a bit jerky. That was the beginning of a general code refresh. If it is a dead end alley maybe it´s time to switch to another tecnology. But right now I will give Adobe Air a try.

 

Thanks for your kind response!

Best regards,

Robert.

Share this post


Link to post
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.