1 Reply Latest reply on Mar 15, 2011 5:29 AM by Laurentiu Pop

    can OSMF play video from user's computer


      I played with OSMF a while back, but at the tim it wasn't mature enough to do much. I'm giving it another try for something else. I want to creae a player that would load video from the user's computer and play it. The user will follow a process similar to when you're uploading a file (click a button, navigate to the file and choose it), then the video starts playing in the player. Is this something OSMF can do? Any hints what classes I need to look at?

        • 1. Re: can OSMF play video from user's computer
          Laurentiu Pop

          OSMF can play media from a users computer and it falls under the same case as progressive download. The only difference in playing a preogressive download resource from local disk or a server is the way you input the resource path:

          1. server path: http://SomeAdress.com/SomeVideo.flv

          2. local file system path: file:///C:/SomeDirectory/SomeVideo.flv


          One thing to keep in mind - Flash doesn't allow both file system access and network access at the same time. It's one or the other. Trying to load a local resource in a .swf that has only network access will generate a security sandbox violation and vice versa with network access only and trying to load from a local file system. Hence if you plan to allow your users to play videos from their file system, remember to set permitions to local file system only.


          As far as classes go, there's nothing special about that. You can easily use something like:


          mediaFactory = new DefaultMediaFactory();

          var videoElement:MediaElement = mediaFactory.createMediaElement (new URLResource ("file:///C:/test.flv"));


          player = new mediaPlayer(videoElement);


          container = new MediaContainer();





          I hope this helps.