Skip to main content
Participant
May 15, 2008
Question

Streaming Video and Bitmap Draw issues.

  • May 15, 2008
  • 2 replies
  • 1740 views
Hello all,

In the current application I'm developing, I have a custom video console. While watching a video, certain points in the timeline will pop up a dialog box that gives the user the ability to switch to a related video. If the user clicks the button to view the related video, a 3D effect flips the current "main" console to a secondary "branching" console - much like the flip effect the iPhone uses. The videos are streaming from FMS 3, the client application was developed in Flex, and we are using Alex Uhlmann's Distortion Effects to achieve the 3D flip effect.

When I first started developing the application, I ran in to the infamous "Security sandbox violation: BitmapData.draw" error whenever I would try the flip. After some investigation on the web, I found that I needed to set the Client.videoSampleAccess property in my FMS application's main.asc to allow bitmap snapshot access. I did so, and that seemed to do the trick. After playing with the application a bit more, however, I found that the error would still come about if I did the following:

1. Pause the video (stream)
2. Perform a seek while paused.
3. Attempt the flip effect.

When I did the above, the error came back. If I paused, performed a seek, and then unpaused the video, everything worked fine. If I pause and then immediately do the flip without a seek, everything works fine.

It seems as though when you pause and then perform a seek, the player forgets that it has permission to do a frame grab until you restart playback.

Has anyone else had this issue, or anything similar? If so, how did you solve it?

Thanks,
--G

(For reference, here is the actual Error that is getting thrown)

SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: http://localhost/Bison/trunk/BisonClient/bin/BisonClient-debug.swf cannot access rtmp://localhost/digitaltutors. No policy files granted access.
at flash.display::BitmapData/draw()
at sandy.util::DistortImage/renderVector()
at sandy.util::DistortImage/initialize()
at com.adobe.ac.mxeffects::SimpleDistortion/initDistortImage()
at com.adobe.ac.mxeffects::SimpleDistortion/renderSides()
at com.adobe.ac.mxeffects::SimpleDistortion/flipFront()
at com.adobe.ac.mxeffects.effectClasses::FlipInstance/updateFront()
at mx.effects::Tween/ http://www.adobe.com/2006/flex/mx/internal::doInterval()[C:\dev\flex_201_gmc\sdk\frameworks\mx\effects\Tween.as:567
at mx.effects::Tween$/timerHandler()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
    This topic has been closed for replies.

    2 replies

    April 2, 2009
    I seem to remember the fix for this to be waiting for the netStatusEvent to complete after the seek.
    Participant
    April 2, 2009
    Hallo,
    Thank you for your reply. What I did is:
    -using flvplayback 2.5 (flash 10)
    add the following code
    flvplayback_instancer.ncMgr.netConnection.addEventListener(NetStatusEvent.NET_STATUS,onNetStatus);

    But that event never fires. I also wated (inded about a minute) before performing the bitmapdata.draw, still the same sandbox violation. It's seems to be just like Caffeinerabbit said in his initial post:
    quote:

    It seems as though when you pause and then perform a seek, the player forgets that it has permission to do a frame grab until you restart playback.

    I would be so great to get this working....
    December 5, 2008
    Hi,

    I've been searching all over for someone having the same problem that I am.

    I'm seeing nearly the same thing that you are. I have SWFVerification turned on and the swf copied over to the correct directory. If I stream an FLV and attempt to capture grab the bitmap data it works fine. Always.

    If I try the same thing with a .mov or .mp4 file it mostly works, but sometimes (after doing basically the same thing you've described in your message), I get the SecurityError. If I try again after a delay of a few seconds, sometimes it works. When that doesn't work, if I seek a 1/10th of a second ahead in the video then try again, it almost always works. But sometimes that, too, fails.

    Have you found a reliable solution to your problem? Has anyone else seen this issue? I would file a bug for FMS, but it looks like the bug-tracking system for FMS is not public. It would be nice for it to be public.

    regards,

    david
    Participant
    April 1, 2009
    Same issue here. When I play a video, I can use Bitmapdata.draw and capture the stream. But after performing a seek, it does throw the violation error. I set it up all correct (main.asc on server.....). I am using the 3.5 development version and this is the only thing that keeps me from buying the license - because this way I cannot serve it to a client (arg)
    PLEASE ADOBE HELP!