NetStream video total time

Hello!
I try to make a video player using NetStream, NetConnection
and Video all from flash.
My problem is that I don't know how to get totalTime for a
video, can anybody help me with that? I work with Flex 2.
I use that for the initialization for NetStream,
NetConnectionand Video:
_netConnection = new NetConnection();
_netConnection.connect (null);
_netStream = new NetStream(_netConnection);
_video = new Video();
addChild (_video);
_client = new Object();
_netStream.client = _client;
_client.onMetaData = onNetStreamMetaDataCallback;
_video.attachNetStream (_netStream);
This is for metadata, this suppose to give me the information
about the video and totalTime, but I put a breakpoint here and
never stop wit debug:
private function onNetStreamMetaDataCallback
(mdata:Object):void
trace (mdata.duration);
The path for video is a local path, a video file flv in my
project:
_netSTream.play("video/phone.flv");

Hi,
There is function in the NetStream to check it out the status
and the Informations embeded in all the FLV.
To find out the Infromations of the videos
you can use this functions.......
NetStream.onMetaDeta = function();
To find out the status of the playng video.
You can use this function...
NetStream.onStatus = function()

Similar Messages

  • How to display the time length of video (current time/ total time) ?

    Hi,everyone. I would like to ask how to display the time length of the video which show only in system example: it show the current time and total time? using AS 3.0.
    It there any information or solution to solve it? .
    I appreciate it any of you able to answer it. ^^
    Thank you.

    Hi,
    Actually I have this requirement for MAC OS 10.5. With the code you provided, I got the output as "6289375". When I changed the URL to point to my file (file:///Users/VPKVL/Desktop/MyRecord/tempAudio.wav), I am getting the below mentioned Exception:
    Exception in thread "main" javax.sound.sampled.LineUnavailableException: Failed to allocate clip data: Requested buffer too large.
         at com.sun.media.sound.MixerClip.implOpen(MixerClip.java:561)
         at com.sun.media.sound.MixerClip.open(MixerClip.java:165)
         at com.sun.media.sound.MixerClip.open(MixerClip.java:256)
         at TestWavLength.main(TestWavLength.java:13)The "tempAudio.wav" file is created by using java sound API. I am using the SSB USB Headphone Set to record the audio with the following settings for AudioFormat object:
    AudioFormat audioFormat = new AudioFormat(
              AudioFormat.Encoding.PCM_SIGNED, // the audio encoding
                                                            // technique
              48000.0F,// sampleRate the number of samples per second
              16, // sampleSizeInBits the number of bits in each sample
              2, // channels the number of channels (1 for mono, 2 for
                            // stereo, and so on)
              4, // frameSize the number of bytes in each frame
              48000.0F,// frameRate the number of frames per second
              false); // bigEndian indicates whether the data for a single
                            // sample is stored in big-endian byte order
                            // (false means little-endian)Can you please suggest where I am going wrong ?

  • Get the flv total time in AS2

    Hi.
    I am loading a flv video in AS2:
    var conexion:NetConnection = new NetConnection();
    conexion.connect(null);
    var stream:NetStream = new NetStream(conexion);
    mi_video.attachVideo(stream);
    stream.play("motto.flv");
    this.onEnterFrame = function() {
        if (stream.time>0) {
            var integer:String = String((stream.time*.0166) >> 0);
            var decimal:String = String((stream.time%60) >> 0);
            timer_txt.text = ((integer.length<2) ? "0"+integer : integer)+":"+((decimal.length<2) ? "0"+decimal : decimal)
        } else {
            timer_txt.text = String("00:00");
    It wokrs very good, In this line, I get de current time of the flv:
    timer_txt.text = ((integer.length<2) ? "0"+integer : integer)+":"+((decimal.length<2) ? "0"+decimal : decimal)
    An I need to display the total time too..
    By the way, I am not using the any flv component, I need to play the video in a custom player....
    Thanks

    I answer myself:
    stream.onMetaData = function(info:Object) {
            var totalInteger:String = String((info.duration*.0166) >> 0);
            var totalDecimal:String = String((info.duration%60) >> 0);
            total = ((totalInteger.length<2) ? "0"+totalInteger : totalInteger)+":"+((totalDecimal.length<2) ? "0"+totalDecimal : totalDecimal);

  • Using a function to change Netstream video size.

    Hi folks,
    forgive me I am new to script in Flex.  I got an Application that has two scripted functions.  The first is called at creationComplete and sets up a netconnect/netstream video playback.  And a second that is fired when a button is clicked, which sets the application to Full Screen.  What I want to do is resize the video at the same time.  For testing purpose I am using hard coded values that match my monitor size.
    The problem I am having is that the code I wrote to change the video size spits out an error "1120: Access of undefined property vid."  - Is it possible to have one function access the vairibles of another function?
    My code:
    <mx:Script>
            <![CDATA[
                private function initApp():void
                    var nc:NetConnection = new NetConnection();
                    nc.connect(null);
                    var ns:NetStream = new NetStream(nc);
                    ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler); 
                    ns.addEventListener(DRMAuthenticateEvent.DRM_AUTHENTICATE, DRMAuthHandler);
                    ns.play("gm.f4v");
                    function asyncErrorHandler(event:AsyncErrorEvent):void
                        // ignore error
                    var vid:Video = new Video();
                    vid.attachNetStream(ns);
                    vidUI.addChild(vid);
                    vid.width=851;
                    vid.height=480;
                    function DRMAuthHandler(event:DRMAuthenticateEvent):void
                        ns.setDRMAuthenticationCredentials("test","test","drm");
                public function goFull():void
                    stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
                    vid.width=1920;
                    vid.height=1080;
            ]]>
        </mx:Script>
    I want the function goFull to change the video size that is loaded from the initApp function.... possible?
    Cheers!
    Chris

    altering size of text already in a textfield:
    var fmt:TextFormat = new TextFormat();
    fmt.size = newvalue;
    textfield.setTextFormat(fmt)
    textfield.defaultTextFormat = fmt; // ensure that text typed after the change is same size

  • Video start time

    Hello,
    i am using DIADem 2012. i want to sync my data and video togther.
    I have channel of type time and channel of values. the time channel start from: 20/01/2013 16:44:47.8560 to  20/01/2013 16:49:32.5540
    I succeeded to sync between data and video by offset correlation function that change each date to start from 01/01/0000 00:00:00.0000 and start video time 0.
    My question is can i program some how and tell the video start time to start from the first time of the time channel? without perform any math tasks.
    video.StartTime= first time of the time channel is seconds.
    *** there's a way to get total seconds of date?(assuming the start time is 01/01/0000 00:00:00.0000)
    thanks.

    Hello OzShimon,
    Check out the TTR and RTT functions in the help system, they do what you want (both ways, from time to numeric and from numeric to time).
    TTR Example:
    Dim SecSinceZero
    SecSinceZero = TTR("28/01/2013 01:22:00.8560","dd/mm/yyyy hh:nn:ss.dddd")
    If the data channel you're talking about is already loaded in the Data Portal, and if it already has a clock symbol to the left of it in the Data Portal, then all you need to do is change the display of the channel values.  DIAdem date/time channels are regular DBL channels that have a display property set to show the data differently in DIAdem (as a date/time string).  So you don't need to convert anything.  Look for the property "Display format" in the Data Portal and change it from "Time" to "Numeric".  You may have to force a refresh by clicking in VIEW, but that channel should immediately display as DBL values.
    You could simply substract the minimum channel value from the complete channel to get the time starting at 0 seconds.
    Assuming you have a channel called "Time" here is an example:
    Call Calculate("Ch(""[1]/Time"")=Ch(""[1]/Time"")-CMin(1)",NULL,NULL,"")
    The result of this would be a time channel that starts at 0 seconds, not at a date/time
    Hope that helps,
        Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

  • Total Time Of Load as on date

    Hi,
    There was initialization done around year back and there are deltas comming in i want to find the total time since start.
    Is it possible???
    thanx
    sachin k

    Hi Sachin
    RSA1 -> Infosource -> Infopackage -> Scheduler(tab in menu) -> Select "Init options in Spource system"
    There you can get the date and time it was done.
    Or other option is
    Infoprovider -> Manage -> check the time stamp for first request and latest time stamp. That will give you the total time.
    I hope this is what you are looking for.
    Regards,
    Rohihni
    Dont forget to assign points if it helps...
    Message was edited by: Rohini Garg

  • How do get particular date of total time

    this is our java code
        private static PreparedStatement preparedStatement;
        private static ResultSet rs;
        public static void main(String[] args) throws NamingException, SQLException
            int objectId;
            int clientId;
             DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            // String gpstime = null;
             PreparedStatement preparedStatement = null;
             Connection conn=null;
             long mill;
             long diffSeconds=0;
             long diffMinutes=0;
             try
              Class.forName("com.mysql.jdbc.Driver");
            Connection conn1=DriverManager.getConnection("jdbc:mysql://108.108.8.4:3306/navl?","root", "ajmani@%");
            preparedStatement = conn1.prepareStatement("select gpstime from xydata a inner join fm4features f on a.ID=f.ID where a.objectId= '18'  AND a.clientId = '1' AND a.gpstime > '2010-05-11 00:00:00'  AND a.gpstime < '2010-05-13 23:59:59' AND f.DataId='1' AND f.value = '1'");
            rs = preparedStatement.executeQuery();
            int a = 0;
            int b=0;
             int b1=0;
             int b2=0;
             int x=0;
             float secs = 0;
            Set<String> dates = new HashSet<String>();
            ArrayList<Integer> l=new ArrayList<Integer>();
              Timestamp t1 = null;
              Timestamp t2 = null;
              int count  = 0;
              while ( rs.next() )
                    String gpstime = rs.getString("GpsTime");
                 if (dates.add(gpstime) )
                     //System.out.println(rs.getTimestamp(1));
                     t2 =   rs.getTimestamp(1);
                     count++;
                   if (t1 == null )
                       int nano = t2.getSeconds();
                         System.out.println(nano);
                       System.out.println(nano);
                       System.out.println(t2);
                       System.out.println(count);
                  else
                        mill= (t1.getTime() - t2.getTime())/-1;
                        //System.out.println(mill);
                        diffSeconds = mill / 1000;
                        diffMinutes = mill / (60 * 1000);
                        long diffHours = mill / (60 * 60 * 1000);
                        long diffDays = mill / (24 * 60 * 60 * 1000);
                        //System.out.println("\nThe Date Different");
                        //System.out.println("Time in milliseconds: " + mill+ " milliseconds.");
                        System.out.println("GPSTime " +gpstime+ " Time in seconds: " + diffSeconds+ " seconds.");
                        //System.out.println("Time in minutes: " + diffMinutes+ " minutes.");
                        //System.out.println("Time in hours: " + diffHours+ " hours.");
                        //System.out.println("Time in days: " + diffDays+ " days.");
                  t1 = t2;
                //System.out.println("Time in minutes: " + diffSeconds+ " seconds.");
                if(diffSeconds < 80)
                  b=(int) diffSeconds;
                  System.out.println(b);
                  l.add(b);
                 else if(diffSeconds > 80)
                    b2=(int)diffSeconds%60;
                    System.out.println(b2);
                    l.add(b2);
                 a++;
              for (int i=0; i<l.size();)
                  secs+=l.get(i);
                  i++;
                 System.out.println(secs);
                 int hours = (int) (secs / 3600),
                 remainder = (int) (secs % 3600),
                 minutes = remainder / 60,
                 seconds = remainder % 60;
                    String disHour = (hours < 10 ? "0" : "") + hours,
                    disMinu = (minutes < 10 ? "0" : "") + minutes ,
                    disSec = (seconds < 10 ? "0" : "") + seconds ;
                    if (count < 2)
                        int se = Integer.parseInt(disSec);
                        String min = (t2.getSeconds() < 10 ? "0" : "") + t2.getSeconds();
                        System.out.println("00" + ":" +  "00" + ":" + min + " hh:mm:ss");
                    System.out.println(disHour +":"+ disMinu+":"+disSec+ " hh:mm:ss");
             }catch(Throwable th)
               Logger.getLogger(testing1.class.getName()).log(Level.SEVERE, null, th);
             }finally
               if(preparedStatement!=null)
                   preparedStatement.close();
               if(conn!=null)
                   conn.close();
    }this is output
    GPSTime 2010-05-13 20:16:13.0 Time in seconds: 60 seconds.
    60
    GPSTime 2010-05-13 20:17:10.0 Time in seconds: 57 seconds.
    57
    GPSTime 2010-05-13 20:18:10.0 Time in seconds: 60 seconds.
    60
    GPSTime 2010-05-13 20:19:10.0 Time in seconds: 60 seconds.
    60
    GPSTime 2010-05-13 20:20:10.0 Time in seconds: 60 seconds.
    60
    GPSTime 2010-05-13 20:21:11.0 Time in seconds: 61 seconds.
    61
    GPSTime 2010-05-13 20:22:11.0 Time in seconds: 60 seconds.
    60
    GPSTime 2010-05-13 20:23:11.0 Time in seconds: 60 seconds.
    60
    GPSTime 2010-05-13 20:24:11.0 Time in seconds: 60 seconds.
    60
    GPSTime 2010-05-13 20:25:11.0 Time in seconds: 60 seconds.
    60
    GPSTime 2010-05-13 20:26:11.0 Time in seconds: 60 seconds.
    60
    GPSTime 2010-05-13 20:27:11.0 Time in seconds: 60 seconds.
    60
    GPSTime 2010-05-13 20:28:12.0 Time in seconds: 61 seconds.
    61
    GPSTime 2010-05-13 20:29:12.0 Time in seconds: 60 seconds.
    60
    GPSTime 2010-05-13 20:30:12.0 Time in seconds: 60 seconds.
    60
    GPSTime 2010-05-13 20:31:12.0 Time in seconds: 60 seconds.
    60
    GPSTime 2010-05-13 20:32:12.0 Time in seconds: 60 seconds.
    60
    GPSTime 2010-05-13 20:37:46.0 Time in seconds: 334 seconds.
    34
    GPSTime 2010-05-13 20:38:46.0 Time in seconds: 60 seconds.
    60
    GPSTime 2010-05-13 20:47:22.0 Time in seconds: 516 seconds.
    36
    GPSTime 2010-05-13 21:12:54.0 Time in seconds: 1532 seconds.
    32
    GPSTime 2010-05-13 21:13:54.0 Time in seconds: 60 seconds.
    60
    GPSTime 2010-05-13 21:14:55.0 Time in seconds: 61 seconds.
    61
    GPSTime 2010-05-13 21:37:08.0 Time in seconds: 1333 seconds.
    13
    GPSTime 2010-05-13 21:38:09.0 Time in seconds: 61 seconds.
    61
    31169.0
    08:39:29 hh:mm:ssi am getting the total time for all date
    i need only the particular date of total time
    2010-05-11-->total time
    2010-05-12->Total time
    2010-05-13->total time
    how do i change the given code to get the above output
    please help me anybody having idea

    Bakthavachalam wrote:
    i am getting the total time for all date
    i need only the particular date of total timeIn which case your while(rs.next()) loop needs to process 1 day at a time and print its results when the date changes (assuming your Timestamps come in in date sequence; if not, you'll have to sort them first).
    I suspect you'll also have to decide what you want to do with
    GPSTime 2010-05-13 23:59:59.0
    followed by
    GPSTime 2010-05-14 00:00:01.0
    Do you still need to calculate the difference? And if so, which "date" does it go in, or is it split?
    Your logic seems incredibly convoluted for such a simple task. What exactly are you trying to do?
    Winston
    BTW: TimeStamp.getSeconds() is deprecated, which means you use it at your peril.

  • How do I change the new iTunes play list total time display from 1.5 hours format to exact display of 1hr 31min 12sec.

    In the new iTunes the play list total time displays in 1.5 hours format, how do I get it to clearly show 1hr 31min 12sec like before, I want the exact time so I can properly fit all the songs when I want to burn this playlist to a disc. You can no longer just click on it to change the display format. Nor can you right click, control click, or change it in options. If anyone knows I would very much appreciate your imput. Thank You.

    Actually, that's the problem ... in iTunes *11* it has stopped working.  I have the status bar displayed, and it is stuck on the 1.x hours format.
    That is very, very strange !!
    I can't get that to happen on mine. It worked in 11.0 and I updated today to 11.0.1 and it's OK.
    I've tried making a new playlist, I've tried changing an old playlist, smart playlist ...... all OK ????

  • Total time balances in HRFORMS

    I designed a form to report total time balances overview
    using TIM_SALDO in HRFORMS.
    when evaluate <b>NOT</b> a complete time evaluation periods  by specifying the data selection period on the selection screen.it gives  total time balances of complete time evaluation periods!?
    Time evaluation periods  is 10.01 - 10.31 ,
    I evaluate 10.01 to 10.15,
    but the result of total  time balances is for 10.01-10.31.
    BUT form designed by PE50,using SALDO too.
    when evaluate 10.01 to 10.15,it gives right result.
    I know table Table SALDO stores all cumulated balances. The balances are added from table TES to SALDO in month-end processing.
    BUT WHY PE50 form can evaluate partly period ,while HRFORMS can not.
    How to design using HRFORMS to evaluate partly period or corss periods?
    Must I write code by using table ZES to cumulate manully?

    Here is your sum in minutes
    WITH your_data AS
           (SELECT       '4.30' emp_ot FROM DUAL
        UNION ALL SELECT '5.50' emp_ot FROM DUAL)
    SELECT SUM(minutes) FROM (
    SELECT   REGEXP_REPLACE (emp_ot, '(\d{1,2})\.(\d{2})', '\1') * 60
           + REGEXP_REPLACE (emp_ot, '(\d{1,2})\.(\d{2})', '\2') minutes
      FROM your_data)
    620
    Message was edited by:
            Bolev                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Calculating total time from a query

    Hi everyone,
    I have a simple database and one of the fields in this
    database is time spent on stuff, for example a bike ride lasted
    00:45:00, 01:33:03, 01:23:03 ETC
    what I am trying to do is calculate total time. so do a sum
    of that column.
    Simple enough.
    the column is a VarChar, I tried Time as well and well that
    did not go well.
    if I use mysql command line I get this:
    mysql> SELECT SUM(mv_time) FROM data WHERE user_id = 2;
    +--------------+
    | SUM(mv_time) |
    +--------------+
    | 8 |
    +--------------+
    1 row in set (0.00 sec)
    No idea how it came up with that one as 8 is incorrect
    so I got a bit fancier:
    mysql> SELECT SEC_TO_TIME(SUM(TIME_TO_SEC(mv_time))) AS
    mv_time FROM data WHERE user_id = 2;
    +----------+
    | mv_time |
    +----------+
    | 26:14:58 |
    +----------+
    1 row in set (0.00 sec)
    Bingo that is correct.
    but if I use that same query within cfquery I get a nice java
    error telling that you can't have 26 hours in a single day.
    Any ideas how I can accomplish this should be simple task?
    Thank you.
    Luc

    Hi Cf_dev2,
    How would I go about making easy for my users to submit the
    seconds into the database?
    for example I would want them (them being me really :) ) to
    enter 01:35:00 (for one hour and 35 minutes) and then have CF or
    SQL convert that to seconds (instead of having myself figure that
    out manually I am no good at math)
    Jdeline, I don't understand what you mean by not storing it
    as comma delimited, as far as I know its not comma delimited, its
    stored in a table called data along with a primary key id, userid,
    date, etc
    Thanks
    Luc

  • Capturing total time for a report..

    Hi all..
    I have a query. Is there a way to capture total time spent to show a report on browser
    If I understand the way it works in OBIEE
    Browser -Presentation Services -- HTTP Request or Response (This we can see by increasing sawlog config file to see more details in sawlog0.)
    Presentation services - BI Server (By Usage Tracking S_NQ_* tables, it gives response time, elapsed time and such statstics)
    BI Server - DB ( The query running time also captured in usage tracking table)
    My understanding is on whole when Presentation services pass the request to BI Server..and when it BI server returns the data to Presentation services..
    There shoud some COMMON PARAMETER to match the request sent and received ..Mapping the requests...
    Is there a way to get that parameter/variable/sytem variable..so that I can accomplish objective of tracking total time spend for a request..
    I could increase saw log and see there is no common parameter that I could match from Sawlog to NQQuery Log, but no luck
    Can anybody help here to find someway? any pointers?
    Thanks in advance..

    There is no parameter that captures the browser rendering time of the report. In the manage sessions if you check the report run time stats you should be able to find the elapsed time, db connect time and compilation time
    To find a more accurate time to render the report and the time when it has become active you can check that information Under Manage sessions in the RPD. That will give the start time and report active time which is the time at which the report is active.
    If you closely monitor this time in the sessions will be a little higher than the time present in the view logs elapsed time which includes the browser rendering time as well because it gives the report active time on it.
    Hope it will be helpful
    thanks
    prash

  • I'm in need of a variable that I can use to display total time spent in a course.

    I'm attempting to create a custom certificate of completion that a learner can print at the end of a course.
    I'd like to have the total time spent in the course displayed on it but am not sure about the variable to use.

    Thanks for the quick reply!
    I was hoping for a quick solution to have the elapsed time appear only on a printable certificate of completion.
    Unfortunately, this goes beyond my limited knowledge and experience in using variables. (Admittedly, I'm not a frequent Captivate user)
    Thanks again!

  • Why is acrobat pro XI does not open a video (Quick Time) using the interactive object tools ?

    Hi
    I have a Macbook pro using OS X 8.5.1.
    I have just download acrobat pro XI.
    When I try putting a video (Quick time) in a PDF document, the button is there, but when I clic to play, the document is close without notice.
    Acrobat pro XI is suppose to read .mov file, so why it is not working ?
    Thank's

    Video in the Acrobat XI Family must be in H.264 or FLV format, as it's displayed using Flash Player.

  • How do you display total time for playlist in Itunes 11

    how do you display total time for playlist in Itunes 11

    "I can see the total time in my playlist on the computer but not on my device??"
    I have just posted a question asking the same!
    Did you have any joy?

  • How come Mac OS X's Software Update doesn't show a total time ETA and size?

    Hello.
    I noticed when downloading big updates from Mac OS X 10.5's Software Update, it doesn't show the TOTAL time left and size. It only shows the individual updates (e.g., iTunes). Is there a way to show the totals especially when downloading takes forever?
    Thank you in advance.

    Kappy wrote:
    Well not in Software Update, but if you download standalone updates directly from Apple's download site - support.apple.com/downloads/ - using Safari then you will get that information reported in the browser's download manager. However, Software Update does report the size of each listed update.
    Yeah, I wanted to know the total of all updates since some updates are so huge. Like Java update 5 is like over 160 MB! Add iTunes and others! Yikes.

Maybe you are looking for

  • The music tating on my Ipod Touch don't show up on my Itunes

    I recently upgraed my Ipod Touch and much of my music was deleted. I managed to get most of it back but the ratings I had for my songs had been deleted. As I went through all of my songs on my Ipod, I realized that the rating I gave them, would not s

  • Printer will not be recognized by Airport Utility

    Ok- so I have read for many hours and tried many solutions to get this to work still no avail... iBook G4 with AP Extreme n + USB hub + Canon i450 + Samsung ML1210. I had the AP Extreme n working with the Samsung printer for awhile then suddenly it s

  • OWB 9.0.4 and OLAP

    Hi, I have questions regarding the OWB 9.0.4 and his OLAP features. I tried to set up an Analytical Workspace and OLAP objects (dimensions and a cube) as it was written in the OWB904UsersGuide. Therefore I created an PL/SQL script with the OWB Export

  • I want to play a video within a picture frame (kind of like picture in picture with perspective)

    Hi, i'll try to describe what i'm trying to do. I want to slowly zoom in on an empty desk.  The desk does have a picture frame, with a child in a soccer uniform.  As the camera zooms in, the child starts to move within the frame, as if the picture ca

  • Warning When Enabling Media Bypass

    Hey, everyone! I went to enable Media Bypass in Network Configuration > Global > Show Details and check Enable Media Bypass then "Use Sites and Region Configuration" and check "Enable Bypass for Non-Mapped Sites," but I get the following warning: One