How to play and stop flv files through NetStream in AIR Application

Hi,
In a folder I have 'n' number of flv file, which are DRM protected. when the user try to play those files for the first time through my AIR application, it will prompt for username and password and gets the license/voucher from the server and store it in AIR Runtime. so that from the next time onwords it won't prompt for username and password as because it already has license/voucher.
     My problem is assume there are 500 files, such that for each file the user has to enter his credentials[username and password]. which is a stupid thing. I want to avoid this process by implementing this process internally/programetically. By playing/accessing each file through netstream from the folder and setDRMAuthenticationCredentials for that file and stop the stream. Here I am able to play each file but I am failed to stop it. I mean to say I will get the license for all the flv files internally[while loading my AIR application], such that user should not be interrupted for his credentials for each file.He should play as if he is accessing/playing a non-DRM protected file. I will be very thank full if any one help me out in this.
public function init():void {
      connectStream();
      getLicenseForAllFiles();
      videoStream.addEventListener(DRMAuthenticateEvent.DRM_AUTHENTICATE, drmAuthenticateEventHandler);
      ppt_videoStream.addEventListener(DRMAuthenticateEvent.DRM_AUTHENTICATE, ppt_drmAuthenticateEventHandler);
        private function getFilesRecursive(rootFolderPath:String):void {
            //the current folder object
            var currentFolder:File = new File(rootFolderPath);
            //the current folder's file listing
            var files:Array = currentFolder.getDirectoryListing();
            //iterate and put files in the result and process the sub folders recursively
            for (var f = 0; f < files.length; f++) {
                if (files[f].isDirectory) {
                    if (files[f].name !="." && files[f].name !="..") {
                        //it's a directory
                        getFilesRecursive(files[f].nativePath);
                } else {
                    //it's a file
                    fileList.push(files[f].nativePath);
                    //Alert.show(""+files[0].nativePath);
                    var fileName:String = files[f].name;
                    if(fileName.indexOf("PPT_")!=-1){
                        ppt_videoStream.play(files[f].nativePath);
                        ppt_videoStream.pause();
                    videoStream.play(files[f].nativePath);
                    videoStream.pause();
            private function connectStream():void {
                videoConnection = new NetConnection();
                videoConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                videoConnection.connect(null);
                ppt_videoConnection = new NetConnection();
                ppt_videoConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                ppt_videoConnection.connect(null);
                videoStream = new NetStream(videoConnection);
                videoStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                video.attachNetStream(videoStream);
                ppt_videoStream = new NetStream(ppt_videoConnection);
                ppt_videoStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                ppt_video.attachNetStream(ppt_videoStream);
         private function netStatusHandler(event:NetStatusEvent):void {
            switch (event.info.code) {
                case "NetConnection.Connect.Success":
                    //connectStream();
                    break;
                case "NetStream.Play.StreamNotFound":
                    trace("Unable to locate video: " + videoURL);
                    break;
            private function drmAuthenticateEventHandler(event:DRMAuthenticateEvent):void {
                videoStream.setDRMAuthenticationCredentials("adobe", "adobe", "drm");
            private function ppt_drmAuthenticateEventHandler(event:DRMAuthenticateEvent):void {
                ppt_videoStream.setDRMAuthenticationCredentials("adobe", "adobe", "drm");
Thanks
Sudheer Puppala

Hi,
Please go through following links..this will help you:
http://lucamezzalira.com/2009/02/28/create-pdf-in-runtime-with-actionscript-3-alivepdf-zin c-or-air-flex-or-flash/
http://forums.adobe.com/thread/753959
http://blog.unthinkmedia.com/2008/09/05/exporting-pdfs-in-flex-using-alivepdf/
Thanks and Regards,
Vibhuti Gosavi | [email protected] | www.infocepts.com

Similar Messages

  • How do I protect my FLV files? or How to encrypt and decrypt FLV files using AIR?

    Hi,
         I am working on an AIR application, which is developed on eLearning concept. The application mainly deals with flv files. The application contains a video player component, which will stream flv files from an Apache Server and played in my application. Here my concern is I would like to protect my flv files some how against users who may stream them from Apache Server and use them without my application.
         I thought of with an idea to do it. But I don't know whether it will work or not. So I am requesting for your suggestions and better ways to do this with a sample.
    Here is my thought:
    I would like to place the encrypted FLV files at Apache Server side [ Need to know how to encrpt the FLV files using Flex]
    As my AIR application send a request for a FLV file, the Apache server should send the decryption key and a stream of FLV file.
    AIR application should take the decryption key, stream of flv file and it should capable enough to decrypt the FLV file and play it in my application. [ But I don't know how to encrypt/decrypt FLV files through flex]
    I can do encryption of FLV files using Mac Address of Apache Server system and using Java. But I don't know how can I decrypt the same FLV file ( Encrypted using Mac Address and java ) at AIR application side.
    So I would be greatfull If any body help me in encrypting and decrypting of FLV file with a sample using Flex 3.0.
    Thanks
    Sudheer Puppala

    russellfromblackburn south wrote:
    Is it because the portable drive is NTFS format and the Mac wont recognise this? If so what do I do?
    Yes, this is exactly what is causing the problem. Macs cannot write to NTFS formatted drives, only read. You must move the documents to the internal HDD/SSD of the Mac to be able to edit them.
    Or, since you say you don't want to move the documents to the internal storage, you'll need to format the external HDD as FAT32.

  • Need to play and stop sound file with 1 ms resolution

    Hi,
    I'm trying to open a .wav file then later play it at a time when another parallel loop activates a boolean local variable which controls playback in my "sound" loop. I need high time resolution in stopping the playing of the .wav file, ~1ms. From what I've gathered, I can't use the "sound output write.vi" because it locks the loop until it finishes outputting a set number of samples. Because of this, "sound output stop.vi" has to wait until the next iteration, which is more than ~1 ms.
    In the help menu of the Sound Ouput VIs it says you can set the task ID for the "sound output start.vi" using the "sound output configure.vi." Unfortunately I've only been able to use the "sound output start.vi" following "play sound file.vi", and I don't really know why this is the case.
    I can't start my sound with the "play sound file.vi" because it locks the loop its in until it finishes playing the sound. Oddly this only happens when there is a parallel loop running, if I run it by itself, with no other loops, it doesn't lock the loop. I thought it might have something to do with the local variable, but the loop doesn't lock when the loop restarts the sound using the "sound output start.vi." 
    After opening a .wav file, can i use the "sound output configure.vi" to create a task ID for the "sound output start.vi" to work? Or do I have to use the "sound output write.vi" after calling the "sound output configure.vi." The help menu makes it seem like the prior suggestion is possible.
    Thanks a lot!

    Since it sounds like the problem you're running into is getting the data loaded from the file before you're ready to play it, look at the Files sub-palette, specifically the Sound File Read Simple VI.  You can use this VI to load the data into a waveform and have it ready for use later in the program.
    So in your overall program, read the file with Sound File Read Simple and configure the output with Sound Output Configure and call Sound Output Write when you're ready to play the waveform.
    Alex Person
    NI-RIO Product Support Engineer
    National Instruments

  • How to Play Slow motion FLV File

    Hi,
    I would like to play a Slow Motion FLV File in Flex using Action Script but unable to find any way to do so. I have looked into the Action Script API proposed by Adobe but couldn't find any way. Can you people please help me in this regard?
    Thanks in advance...

    Well I guess you can't do it with play() since it will go real time speed so if thinking out of the box you could edit the movie itself or pause the video and set a timer to move to a specific time location of the flv so it will act like a slow motion. I guess that would require for you to export your movie with a lot of keyframes and I still can't be sure if it would work Good luck with that!

  • How to get and display image file through servlet

    If I've got a jpg file on the server..
    How can I use servlet to return that image via the following calling method
    /displayfile?filename=image.jpg
    the image.jpg in the server will return
    I know that I need to set the content type to image/jpeg
    after that, how can I return the image file to browser?

    - Get the "file" Parameter from the URL QueryString
    - check if the File specified exists on your filesystem
    - read in the jpg from the file (best would be binary)
    - set the right Mime Type (as you already wrote)
    - write the filecontent to the ServletOutput as you would do with any other content
    - that's it.

  • Cue points in dynamically loaded flv file through netstream

    How can i add cue points to a playlist of flv files which are
    loaded dynamically through an xml files. All the sources i have
    found over the internet are using flvplayback control :(

    Lestyn, thanks for the verification.  Took me a frantic 4 hours to arrive at the same conclusion.  Do these people test their software???
    Maddening.

  • How to remove the button "play" and "stop" in that flash animation?

    The animation is this one ...
    http://adf.ly/OTGyh
    Hello, I made a simple flash animation of a character talking ... The only problem is that this animation has the button "play" and "stop" and I do not want it ...
    I want so carry out the main character speak the message and stop yourself automatically without user intervention to push any buttons ...
    I have the animation code, how do I get this code to the buttons and start the animation so load the page?
    Ah, and how to put the link to a page by clicking on this open a flash site?

    How to do it step-by-step? Because i'm beginner in FLash and that things of animation, codes, functions...
    And I create that simple animation in other program, not using the Adobe Flash, but I think can be edited that file animation in Flash because I have the files ".swf" and ".flv"...
    I don't know how to do it in Adobe Flash CS3, but I have that program installed in my pc, then can you talk me what to do it?
    Sorry my bad english, i'm from Brazil.
    That is the folder contains the files:
    https://dl.dropboxusercontent.com/u/11826717/off/laranja/files_animation.jpg
    That is the Download the files of that folder if you want see better:
    https://dl.dropboxusercontent.com/u/11826717/off/laranja/laranja.rar

  • How to control the line in--- PLAY and STOP ?

    Hi,
       This is the  volume control library downloaded  from NI wed site .It is help for my task.
       My task is to control the line in with LabVIEW, for example STOP, PLAY and adjust volume with LabVIEW button.Though the example I see the volume control can  be enablement.But I don't know how to design the PLAY and STOP button.
       I see it is similar to the volume control.There is function to control the the PLAY and STOP in the system Library-winmm.dll. I don't know  whether all I think is right.I have the following serial question. How to use the function?How to understand the system Library?I can't acquire some information  from it and I don't know the input and output parameter in the funcion.
       Can any one help me out please?
       I'm sorry that my English is poor.
       Thanks.
     lizhi
    Attachments:
    VolCtrl.llb ‏193 KB

    I assume you are referring to audio line-in volume control and lerft-right balance...
    If so, then check out this thread:
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000D83A0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0
    Look at the info near the bottom from Paul S & Spectre. They talk about "winmm.dll"
    -cheers-
    JLV

  • How to upload and download any file from plsql through weblogic server

    hi all,
    how to upload and download any file from plsql through weblogic server? i am using oracle 10g express edition and jboss.
    Thanks and Regards,
    MSORA

    hi bala ,
    for a windown server u can use VNC (virtual network connection) which opens a session on u r desktop later u can drag and drop form there vice versa and for a linux box you can use Win SCP which helps to open a session with interface to u r desktop in both cases you can upload and down load files very easiy just as we drag and drop items in a simple pc .. we use the same technique...
    bye
    vamshi

  • I down loaded a rental movie and stopped part way through . i turned the computer on and off and when i went back on itunes it didnt show up on the rental playlist and movie playlist.how can i get the movie back?

    i down loaded a rental movie and stopped part way through . i turned the computer on and off and when i went back on itunes it didnt show up on the rental playlist and movie playlist.how can i get the movie back?

    Unless it has recently changed you can only watch rentals on the device or mac you rent them on.

  • How to play the two video files simultaneously in Xletview

    Hi All,
    How to play the two video files simultaneously in Xletview. But only one video must be visible to user and the other video must run in the background(Invisible to user). I need to implement like broadcasting channel, I don't want to stop the current video while switching to another video and vice versa.
    Is it possible to do in Xletview 0.3.6?. Or Anybody tried this?...
    Sourab.

    I think no one try this with xletview!
    xletview is not for that!

  • Any ideas how I can view this flv file?

    I have CS3 Flash using Flash Player 9 and Actions Script 3.  I am publishing a progressve loading swf, which has an absolute path to an flv of http://www.haleygroup.com/work_images/basics.flv.  The swf file is located here http://www.haleygroup.com/work_images/basics.swf, along withn the html, flv, and skin.  When I click the button (configured by an XML file) on my web site to view the file, I get a flickering box.  Other flvs in the XML file are configured the same way and work fine.  See this flickering box at http://www.haleygroup.com/, enter site and go to "et al" page, then click "Basics".  Any ideas how I can view this flv file?  Many, many thanks.

    I just changed the path to a relative path of just "basics.flv" and still have the problem.  See swf at http://www.haleygroup.com/work_images/basics.swf.  Thanks.

  • How to append records in a file, through file adapter.

    Hi All,
    How to append records in a file, through file adapter.
    I have to read data from database and need to append all records in a file.
    Thanks in Advance.

    Hi,
    I think you have a while loop to hit the DB in your Process (As you said you have to fetch data from DB 10 times if 1000 rec are there)
    First sopy your DB O/P to one var
    and from second time append to previous data.(Otherwise you can directly use append from starting instead of copy and append)
    When loop completes you can transform to File adapter Var.
    Otherwise you can configure yourFileadapter such that it will aapend current records to previous records.
    You can use 'Append= true' in your file adapter wsdl.
    It will append previous records to current records in the same file.
    Regards
    PavanKumar.M

  • How to Start and Stop Processes?

    How to Start and Stop Processes?
    Im trying to create a program which allows me to Start and Stop (and Restart) GameServers. I will then expand on this so i can start and stop them through a web applet with build in useraccounts.
    Currently the way we do this is to log into the server using a RemoteAssistance. Which is not very safe as the users have the abbility to do anything on the server and potentially corrupt it.
    Below is my code for how i start the servers. But i dont know how i would stop the process.
                    private void startServers()
                   for(GameServer gs : servers)
                        int ID = Integer.parseInt(gs.getID());
                        if(isChecked(ID))
                             try
                                  String cmd[] = gs.getStartString();
                                  Runtime.getRuntime().exec(cmd);
                                  int sleepPeriod = Integer.parseInt(sleepField.getText());
                                  Thread.sleep(sleepPeriod*100);     
                             catch(Exception e)
                             System.out.println(e);
                   }//end of iterator
                   JOptionPane.showMessageDialog(null,"All Selected Servers Have been started.","Servers Started",2);     
         }//end of startserversAnyhelp would be great thanks.

    Using the process class would give you a nicer API, but using destroy isn't a nice way to shutdown a process. Its like killing the process with your task manager. You should make a connection in some way with the game server and tell it to shutdown in stead (gracefull termination).

  • How to send business card (VCF file) through sms? it can only be send via email?

    how to send business card (VCF file) through sms? it can only be send via email?

    Go into your contacts click on the person you want to send, when the info opens scroll down to the bottom and click share contact it will as it you want to email or mms. 

Maybe you are looking for