Anon, I think this is an issue of poor documentation / too many different products (Flash, Flex, player, flvplayback component) with different versions.
I was able to get the .load()
call to work with all 5 arguments (and verified that it did start playing at the specified start time), but only by compiling a new FLVPlayback_116.swc
from the latest Flex SDK source code (Flex 4.6 with playerglobal.swc
version 11.6).
See my screenshot.
Might as well see if it works for you. Here's what you'll need to do:
- Remove the FLVPlayback component from your library - this defines conflicting classes with the updated version.
- Download my FLVPlayback_116.swc library
- Or FLVPlayback_116_air.swc if you're targeting Adobe AIR, not Flash Player / web
- In Flash, open the
File -> ActionScript Settings
dialog, under the library path tab, click 'Browse to SWC file' and locate theFLVPlayback_116.swc
file you just downloaded. My screenshot above shows this dialog and how theFLVPlayback_116.swc
file is listed after being added. - In the code (see below):
- You need to set:
fl.video.VideoPlayer.iNCManagerClass = fl.video.NCManager;
- Rather than using
innerPlayer = vPlayer.getVideoPlayer
you'll need to useinnerPlayer = new VideoPlayer(width,height)
and thenaddChild(innerPlayer)
andinnerPlayer.play()
- I had to add the
innerVideo.play()
call to start the video playing (which I assume the GUI would handle)
- You need to set:
Here's my code (also visible in the screenshot):
import fl.video.*;
fl.video.VideoPlayer.iNCManagerClass = fl.video.NCManager;
var innerPlayer = new VideoPlayer(640,480);
addChild(innerPlayer);
innerPlayer.load(
"http://10.0.1.3/test.flv"
, 0 // totalTime
, false // isLive
, 5 // startTime
, 5 // duration
);
innerPlayer.play();
Also, you can see that my describeType
of VideoPlayer
shows the proper number of arguments:
<method name="load" declaredBy="fl.video::VideoPlayer" returnType="void">
<parameter index="1" type="String" optional="false"/>
<parameter index="2" type="Number" optional="true"/>
<parameter index="3" type="Boolean" optional="true"/>
<parameter index="4" type="Number" optional="true"/>
<parameter index="5" type="Number" optional="true"/>
<metadata name="__go_to_definition_help">
<arg key="pos" value="41308"/>
</metadata>
</method>
<method name="play" declaredBy="fl.video::VideoPlayer" returnType="void">
<parameter index="1" type="String" optional="true"/>
<parameter index="2" type="Number" optional="true"/>
<parameter index="3" type="Boolean" optional="true"/>
<parameter index="4" type="Number" optional="true"/>
<parameter index="5" type="Number" optional="true"/>
<metadata name="__go_to_definition_help">
<arg key="pos" value="34410"/>
</metadata>
</method>
UPDATE: I've updated the library so that you can instantiate an FLVPlayback(w,h) and hence apply skins or whatnot -- treat it just like you would the vPlayer in your code above (except I added the width/height constructor args, since the size used to come from the component on-stage). Instantiate it like so:
var vPlayer:FLVPlayback = new FLVPlayback(640,480);
vPlayer.skin = "http://10.0.1.3/skin.swf"; // optional skin
addChild(vPlayer);
var innerPlayer = vPlayer.getVideoPlayer(vPlayer.activeVideoPlayerIndex);
innerPlayer.load(
"http://10.0.1.3/test.flv"
, 0 // totalTime
, false // isLive
, 5 // startTime
, 5 // duration
);
Note - to use a skin, I compiled one of the FLA examples from Flash CS6... I tried using a skin I found on the Internet and it didn't work - it was likely compiled for an older version. See this skinned screenshot and download my skin.swf.
Good luck, and let me know if you need further info!