Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Jul 30, 2013 Jul 30, 2013

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

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.

TOPICS
ActionScript
777
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 30, 2013 Jul 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 30, 2013 Jul 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 30, 2013 Jul 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 30, 2013 Jul 30, 2013

Ah.  One thing I should have mentioned is that I don't want the end user to know that there is more video beyond the start time and end time, and the ideal way is to make sure scrub tool doesn't show this.  

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 30, 2013 Jul 30, 2013

don't use a skin or, at least, don't use one with a playprogress bar.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 30, 2013 Jul 30, 2013
LATEST

Consider using the OSMF player too: http://osmf.org/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines