Skip to main content
Participant
July 30, 2013
Question

How to access VideoPlayer.load() method that accepts 5 parameters?

  • July 30, 2013
  • 1 reply
  • 851 views

Please see my SO question here for details: http://stackoverflow.com/questions/17776642/flvplayback-videoplayer-how-to-access-videoplayer-load-method-that-accepts-5

Basically, in CS4 (or CS6), I want to call the five-argument version of VideoPlayer.load() that is documented here: 

    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/video/VideoPlayer.html#load()    

But I keep getting errors along the lines of  "incorrect number of arguments."

Steps to reproduce:

  • Start a new, blank FLA document (AS3).
  • Drag an FLVPlayback component to the stage and name it vPlayer.
  • Create a new layer and add Actionscript in frame 1:
    import fl.video.*;  
    var innerPlayer = vPlayer.getVideoPlayer(vPlayer.activeVideoPlayerIndex);
    trace
    (innerPlayer); // "[object VideoPlayer]" appears in Output window 

    innerPlayer
    .load( "RTMP://..." ,
    0 // totalTime ,
    false // isLive ,
    60 // startTime ,
    10 // duration );

This should give me a ten-second clip starting from the one-minute mark, but I keep getting errors like

ArgumentError: Error #1063: Argument count mismatch on fl.video::VideoPlayer/load(). Expected 1, got 5.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
July 30, 2013

that looks like a documentation error unless there was a player 9 version for which that was valid.  otherwise, it looks like it will accept the first 3 parameters.

use other videoplayer methods/properties/events to do what you want.

Participant
July 30, 2013

kglad - Thanks for the reply. I would be pretty disappointed if the documentation has been wrong since CS4. Even in CS6 + Flash Player 11, the code doesn't work.

I looked at the documentation, and there don't seem to be any properties I can use to simulate startTime and duration.  Any suggestions?

sinious
Legend
July 30, 2013

FLVPlayback load supports a totalTime argument and if it's coming from a streaming server you can just seek instantly to any starting point you like.