Skip to main content
Known Participant
September 11, 2009
Question

Bitmap data & FMS 3.5

  • September 11, 2009
  • 1 reply
  • 4796 views

Hi,

I'm having a problem with using BitmapData with streaming video from Flash Media Server 3.5. What I'm trying to do, is a virtual videowall, with 3x2 grid if videos streaming from FMS. The wall is made with Papervision 3D, so the videos need to be drawn to the bitmapdata that is used as texture on the 3D object. I'm new to Flash Media Server, so I'm probably doing something from.

I know I need to allow sample access, which I did in Application.xml for the dafault VOD service and the Application.xml in the _defaultVHost_ folder. Like this:

<Application>
    <Client>
        <Access>
            <AudioSampleAccess enabled="true">/</AudioSampleAccess>
            <VideoSampleAccess enabled="true">/</VideoSampleAccess>
        </Access>
    </Client>
</Application>

It works occasionally and some times it doesn't, so sometimes I still get the security sandbox violation error from using bitmapdata. What I also noticed that it seems to work better, If I wait for metadata before adding the streams to Video object and add the Video object to display list. Problem with that is, that for some reason, occasionally not all videos send metadata (even though I'm using the same video for all the concurrent streams).

The server is running on my workstation so I'm connecting to localhost and I've added the swf file to the trusted list from security settings. Because it's running on my workstation, there's no regular web server, so I can't use crossdomain.xml. Could that be a problem?

Any ideas what I should do? Or is it even possible to do what I'm trying to do?

    This topic has been closed for replies.

    1 reply

    teel_Author
    Known Participant
    September 16, 2009

    I've had some progress with this. Now I only get one Security sandbox violation error when I connect but everything else works correctly. Can I use try..catch on security sandbox violations or something to prevent this from happening?

    [Fault] exception, information=SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: file:///path...etc/UITest.swf cannot access rtmp://192.168.0.50/vod. No policy files granted access.
    Execution halted in 'UITest.swf' ffffffffat 0xExecution halted in 'UITest.swf' ffffffff (-1)

    September 16, 2009

    There's an article here:

    http://www.shell-tips.com/2009/08/30/flash-how-to-fix-the-security-sandbox-violation-bitmapdata-draw/

    Haven't tested the author's solution, but it seems reasonable.

    teel_Author
    Known Participant
    September 16, 2009

    Thanks, but I have already done that. It does indeed work to some extent; without it you can't get BitmapData access to your media at all. Unfortunately even with those settings I get these errors seemingly randomly.

    I managed to reduce it by adding delay with setTimeout before drawing the to the bitmapdata after the video has started playing, but unfortunately that only works most of the time.

    Also I can't catch the error because the bitmapdata drawing is somewhere deep in the Papervision 3D code. I could try to "fix" the PV3D library, but it's pretty scary stuff for a puny developer like me . And even if I could catch the error, my only option would be to retry until it works properly, which doesn't seem like a very robust solution to me, even though it's the only one I've come up with right now. I haven't tested it yet, though.