Note that there are some explanatory texts on larger screens.

plurals
  1. POFLVPlayback/VideoPlayer: How to access VideoPlayer.load() method that accepts 5 parameters?
    primarykey
    data
    text
    <p>I want to use the following <code>load()</code> method that accepts five parameters so that I can load a small "excerpt" from a larger video:</p> <p><a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/video/VideoPlayer.html#load()" rel="nofollow">http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/video/VideoPlayer.html#load()</a></p> <p>In particular, the <code>startTime</code> and <code>duration</code> parameters seem to be what I need, but I am getting errors that seem to indicate that I don't have the right object/version of something, even though the Adobe docs say that it should work. Here are my steps:</p> <ul> <li>Start a new, blank FLA document (AS3).</li> <li>Drag an FLVPlayback component to the stage and name it vPlayer.</li> <li><p>Create a new layer and add Actionscript in frame 1:</p> <pre><code>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 ); </code></pre></li> </ul> <p>This should give me a ten-second clip starting from the one-minute mark, but I keep getting errors like <code>ArgumentError: Error #1063: Argument count mismatch on fl.video::VideoPlayer/load(). Expected 1, got 5.</code></p> <p>I've also tried casting innerPlayer to fl.video.VideoPlayer, but that doesn't work.</p> <p>What am I doing wrong?</p> <hr> <p><strong>EDITS</strong>: Even though I'm on CS4/AS3 and the documentation claims to apply to CS4/AS3, the class files in my "Component Source" folder don't seem to match the documentation. I also tried this in CS6, and I got <em>"1137: Incorrect number of arguments. Expected no more than 3."</em> </p> <p>@SunilD. - For CS4: <code>FLVPlayback.VERSION</code>=2.1.0.19, and I am targeting Flash Player 10 (the most recent available)+AS3. For CS6, <code>FLVPlayback.VERSION</code>=2.5.0.26, and I am targeting Flash Player 11.4.</p> <p>In CS4 and CS6, the errors say that VideoPlayer <code>load()</code> only requires one argument (with two optional), and <code>play()</code> has three optional arguments. The output of <code>describeType(innerPlayer)</code> confirms:</p> <pre><code>&lt;type name="fl.video::VideoPlayer" base="flash.media::Video" isDynamic="false" isFinal="false" isStatic="false"&gt; ... &lt;method name="play" declaredBy="fl.video::VideoPlayer" returnType="void"&gt; &lt;parameter index="1" type="String" optional="true"/&gt; &lt;parameter index="2" type="Number" optional="true"/&gt; &lt;parameter index="3" type="Boolean" optional="true"/&gt; &lt;/method&gt; ... &lt;method name="load" declaredBy="fl.video::VideoPlayer" returnType="void"&gt; &lt;parameter index="1" type="String" optional="false"/&gt; &lt;parameter index="2" type="Number" optional="true"/&gt; &lt;parameter index="3" type="Boolean" optional="true"/&gt; &lt;/method&gt; ... &lt;/type&gt; </code></pre> <p>Other notes: Flash CS6 is up to date. Manually installing the FLVPlayback 2.5 component didn't work. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload