Issue with play2() and ExternalInterface
It seems I have run into an issue which has so far been
undocumented. If you call ExternalInterface.addCallback before useing the new DynamicStreamItem() class it breaks.
(need to have FMS dev server installed)
Add a flvPlayback component (v 2.5) to your stage with an instance name of videoPlayer_mc.
Then add the following actionscript to your main timeline:
----------------------------------------------------------------------------------------------------------
import fl.video.*;
import flash.external.ExternalInterface;
VideoPlayer.iNCManagerClass = NCManagerDynamicStream;
var dsi:DynamicStreamItem = new DynamicStreamItem();
dsi.uri = "rtmp://localhost/vod/";
dsi.addStream("mp4:sample1_150kbps.f4v", 150);
dsi.addStream("mp4:sample1_500kbps.f4v", 500);
dsi.addStream("mp4:sample1_700kbps.f4v", 700);
dsi.addStream("mp4:sample1_1000kbps.f4v", 1000);
dsi.addStream("mp4:sample1_1500kbps.f4v", 1500);
//------
ExternalInterface.addCallback("pauseContent", pauseContent);
videoPlayer_mc.play2( dsi );
function pauseContent():void
{
videoPlayer_mc.pause();
}
----------------------------------------------------------------------------------------------------------
publish the swf and open it in the standalone Flash Player application. You will see it does not work. But if you comment out the ExternalInterface.addCallback and the function it works fine. These are 2 unrelated classes with no relationship. What gives. Any insight would be a great help. Commented working code below:
----------------------------------------------------------------------------------------------------------
import fl.video.*;
//import flash.external.ExternalInterface;
VideoPlayer.iNCManagerClass = NCManagerDynamicStream;
var dsi:DynamicStreamItem = new DynamicStreamItem();
dsi.uri = "rtmp://localhost/vod/";
dsi.addStream("mp4:sample1_150kbps.f4v", 150);
dsi.addStream("mp4:sample1_500kbps.f4v", 500);
dsi.addStream("mp4:sample1_700kbps.f4v", 700);
dsi.addStream("mp4:sample1_1000kbps.f4v", 1000);
dsi.addStream("mp4:sample1_1500kbps.f4v", 1500);
//------
/*
ExternalInterface.addCallback("pauseContent", pauseContent);
videoPlayer_mc.play2( dsi );
function pauseContent():void
{
videoPlayer_mc.pause();
}
*/
